Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
apache
Iotdb
提交
427631d2
I
Iotdb
项目概览
apache
/
Iotdb
11 个月 前同步成功
通知
25
Star
3344
Fork
916
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
Iotdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
427631d2
编写于
2月 27, 2019
作者:
X
xiangdong huang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove incorrect javadoc
上级
f78ae5be
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
1 addition
and
291 deletion
+1
-291
iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
...rg/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
+1
-4
iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/TimeIntervalTsFile.java
...g/apache/iotdb/db/engine/filenode/TimeIntervalTsFile.java
+0
-287
未找到文件。
iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessor.java
浏览文件 @
427631d2
...
...
@@ -430,7 +430,7 @@ public class FileNodeProcessor extends Processor implements IStatistic {
}
/**
* execute filenode recovery.
and finally release the write lock this processor.
* execute filenode recovery.
*/
public
void
fileNodeRecovery
()
throws
FileNodeProcessorException
{
// restore bufferwrite
...
...
@@ -462,8 +462,6 @@ public class FileNodeProcessor extends Processor implements IStatistic {
bufferWriteProcessor
=
new
BufferWriteProcessor
(
baseDir
,
getProcessorName
(),
fileNames
[
fileNames
.
length
-
1
],
parameters
,
versionController
,
fileSchema
);
}
catch
(
BufferWriteProcessorException
e
)
{
// unlock
//writeUnlock();
LOGGER
.
error
(
"The filenode processor {} failed to recovery the bufferwrite processor, "
+
"the last bufferwrite file is {}."
,
...
...
@@ -480,7 +478,6 @@ public class FileNodeProcessor extends Processor implements IStatistic {
overflowProcessor
=
new
OverflowProcessor
(
getProcessorName
(),
parameters
,
fileSchema
,
versionController
);
}
catch
(
IOException
e
)
{
//writeUnlock();
LOGGER
.
error
(
"The filenode processor {} failed to recovery the overflow processor."
,
getProcessorName
());
throw
new
FileNodeProcessorException
(
e
);
...
...
iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/TimeIntervalTsFile.java
已删除
100644 → 0
浏览文件 @
f78ae5be
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package
org.apache.iotdb.db.engine.filenode
;
import
java.io.File
;
import
java.io.Serializable
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.Map
;
import
java.util.Set
;
import
org.apache.iotdb.db.conf.directories.Directories
;
/**
* This class is used to store the TsFile status.<br>
*/
public
class
TimeIntervalTsFile
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
4309683416067212549L
;
public
OverflowChangeType
overflowChangeType
;
private
int
baseDirIndex
;
private
String
relativePath
;
private
Map
<
String
,
Long
>
startTimeMap
;
private
Map
<
String
,
Long
>
endTimeMap
;
private
Set
<
String
>
mergeChanged
=
new
HashSet
<>();
/**
* construct function for TimeIntervalTsFile.
*/
public
TimeIntervalTsFile
(
Map
<
String
,
Long
>
startTimeMap
,
Map
<
String
,
Long
>
endTimeMap
,
OverflowChangeType
type
,
int
baseDirIndex
,
String
relativePath
)
{
this
.
overflowChangeType
=
type
;
this
.
baseDirIndex
=
baseDirIndex
;
this
.
relativePath
=
relativePath
;
this
.
startTimeMap
=
startTimeMap
;
this
.
endTimeMap
=
endTimeMap
;
}
/**
* This is just used to construct a new TsFile.
*/
public
TimeIntervalTsFile
(
OverflowChangeType
type
,
String
relativePath
)
{
this
.
overflowChangeType
=
type
;
this
.
relativePath
=
relativePath
;
startTimeMap
=
new
HashMap
<>();
endTimeMap
=
new
HashMap
<>();
}
public
void
setStartTime
(
String
deviceId
,
long
startTime
)
{
startTimeMap
.
put
(
deviceId
,
startTime
);
}
/**
* get start time.
*
* @param deviceId -Map key
* @return -start time
*/
public
long
getStartTime
(
String
deviceId
)
{
if
(
startTimeMap
.
containsKey
(
deviceId
))
{
return
startTimeMap
.
get
(
deviceId
);
}
else
{
return
-
1
;
}
}
public
Map
<
String
,
Long
>
getStartTimeMap
()
{
return
startTimeMap
;
}
public
void
setStartTimeMap
(
Map
<
String
,
Long
>
startTimeMap
)
{
this
.
startTimeMap
=
startTimeMap
;
}
public
void
setEndTime
(
String
deviceId
,
long
timestamp
)
{
this
.
endTimeMap
.
put
(
deviceId
,
timestamp
);
}
/**
* get end time for given device.
*
* @param deviceId -id of device
* @return -end time of the device
*/
public
long
getEndTime
(
String
deviceId
)
{
if
(
endTimeMap
.
get
(
deviceId
)
==
null
)
{
return
-
1
;
}
return
endTimeMap
.
get
(
deviceId
);
}
public
Map
<
String
,
Long
>
getEndTimeMap
()
{
return
endTimeMap
;
}
public
void
setEndTimeMap
(
Map
<
String
,
Long
>
endTimeMap
)
{
this
.
endTimeMap
=
endTimeMap
;
}
/**
* remove given device'startTime start time and end time.
*
* @param deviceId -id of the device
*/
public
void
removeTime
(
String
deviceId
)
{
startTimeMap
.
remove
(
deviceId
);
endTimeMap
.
remove
(
deviceId
);
}
/**
* get file path.
*/
public
String
getFilePath
()
{
if
(
relativePath
==
null
)
{
return
relativePath
;
}
return
new
File
(
Directories
.
getInstance
().
getTsFileFolder
(
baseDirIndex
),
relativePath
)
.
getPath
();
}
public
String
getRelativePath
()
{
return
relativePath
;
}
public
void
setRelativePath
(
String
relativePath
)
{
this
.
relativePath
=
relativePath
;
}
public
boolean
checkEmpty
()
{
return
startTimeMap
.
isEmpty
()
&&
endTimeMap
.
isEmpty
();
}
/**
* clear the member variable of the given object.
*/
public
void
clear
()
{
startTimeMap
.
clear
();
endTimeMap
.
clear
();
mergeChanged
.
clear
();
overflowChangeType
=
OverflowChangeType
.
NO_CHANGE
;
relativePath
=
null
;
}
/**
* change file type corresponding to the given param.
*/
public
void
changeTypeToChanged
(
FileNodeProcessorStatus
fileNodeProcessorState
)
{
if
(
fileNodeProcessorState
==
FileNodeProcessorStatus
.
MERGING_WRITE
)
{
overflowChangeType
=
OverflowChangeType
.
MERGING_CHANGE
;
}
else
{
overflowChangeType
=
OverflowChangeType
.
CHANGED
;
}
}
public
void
addMergeChanged
(
String
deviceId
)
{
mergeChanged
.
add
(
deviceId
);
}
public
Set
<
String
>
getMergeChanged
()
{
return
mergeChanged
;
}
public
void
clearMergeChanged
()
{
mergeChanged
.
clear
();
}
/**
* judge whether the time interval is closed.
*/
public
boolean
isClosed
()
{
return
!
endTimeMap
.
isEmpty
();
}
/**
* back up the time interval of tsfile.
*/
public
TimeIntervalTsFile
backUp
()
{
Map
<
String
,
Long
>
startTimeMap
=
new
HashMap
<>(
this
.
startTimeMap
);
Map
<
String
,
Long
>
endTimeMap
=
new
HashMap
<>(
this
.
endTimeMap
);
return
new
TimeIntervalTsFile
(
startTimeMap
,
endTimeMap
,
overflowChangeType
,
baseDirIndex
,
relativePath
);
}
@Override
public
int
hashCode
()
{
final
int
prime
=
31
;
int
result
=
1
;
result
=
prime
*
result
+
((
endTimeMap
==
null
)
?
0
:
endTimeMap
.
hashCode
());
result
=
prime
*
result
+
((
relativePath
==
null
)
?
0
:
relativePath
.
hashCode
());
result
=
prime
*
result
+
((
overflowChangeType
==
null
)
?
0
:
overflowChangeType
.
hashCode
());
result
=
prime
*
result
+
((
startTimeMap
==
null
)
?
0
:
startTimeMap
.
hashCode
());
return
result
;
}
@Override
public
boolean
equals
(
Object
obj
)
{
if
(
this
==
obj
)
{
return
true
;
}
if
(
obj
==
null
)
{
return
false
;
}
if
(
getClass
()
!=
obj
.
getClass
())
{
return
false
;
}
TimeIntervalTsFile
other
=
(
TimeIntervalTsFile
)
obj
;
if
(
endTimeMap
==
null
)
{
if
(
other
.
endTimeMap
!=
null
)
{
return
false
;
}
}
else
if
(!
endTimeMap
.
equals
(
other
.
endTimeMap
))
{
return
false
;
}
if
(
relativePath
==
null
)
{
if
(
other
.
relativePath
!=
null
)
{
return
false
;
}
}
else
if
(!
relativePath
.
equals
(
other
.
relativePath
))
{
return
false
;
}
if
(
overflowChangeType
!=
other
.
overflowChangeType
)
{
return
false
;
}
if
(
startTimeMap
==
null
)
{
if
(
other
.
startTimeMap
!=
null
)
{
return
false
;
}
}
else
if
(!
startTimeMap
.
equals
(
other
.
startTimeMap
))
{
return
false
;
}
return
true
;
}
@Override
public
String
toString
()
{
return
"TimeIntervalTsFile [relativePath="
+
relativePath
+
", overflowChangeType="
+
overflowChangeType
+
", startTimeMap="
+
startTimeMap
+
", endTimeMap="
+
endTimeMap
+
", mergeChanged="
+
mergeChanged
+
"]"
;
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录