Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Questdb
提交
bc02e06e
Q
Questdb
项目概览
jobily
/
Questdb
11 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
Questdb
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bc02e06e
编写于
12月 15, 2019
作者:
V
Vlad Ilyushchenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(lineproto): Line protocol receiver supports all Influx timestamp formats via configuration
上级
989a940a
变更
16
显示空白变更内容
内联
并排
Showing
16 changed file
with
474 addition
and
9 deletion
+474
-9
core/src/main/java/io/questdb/PropServerConfiguration.java
core/src/main/java/io/questdb/PropServerConfiguration.java
+25
-4
core/src/main/java/io/questdb/cutlass/line/LineProtoHourTimestampAdapter.java
...o/questdb/cutlass/line/LineProtoHourTimestampAdapter.java
+38
-0
core/src/main/java/io/questdb/cutlass/line/LineProtoMicroTimestampAdapter.java
.../questdb/cutlass/line/LineProtoMicroTimestampAdapter.java
+37
-0
core/src/main/java/io/questdb/cutlass/line/LineProtoMilliTimestampAdapter.java
.../questdb/cutlass/line/LineProtoMilliTimestampAdapter.java
+37
-0
core/src/main/java/io/questdb/cutlass/line/LineProtoMinuteTimestampAdapter.java
...questdb/cutlass/line/LineProtoMinuteTimestampAdapter.java
+38
-0
core/src/main/java/io/questdb/cutlass/line/LineProtoNanoTimestampAdapter.java
...o/questdb/cutlass/line/LineProtoNanoTimestampAdapter.java
+2
-2
core/src/main/java/io/questdb/cutlass/line/LineProtoSecondTimestampAdapter.java
...questdb/cutlass/line/LineProtoSecondTimestampAdapter.java
+38
-0
core/src/test/java/io/questdb/PropServerConfigurationTest.java
...src/test/java/io/questdb/PropServerConfigurationTest.java
+34
-0
core/src/test/java/io/questdb/cutlass/line/CairoLineProtoParserTest.java
...ava/io/questdb/cutlass/line/CairoLineProtoParserTest.java
+1
-1
core/src/test/java/io/questdb/cutlass/line/LineProtoHourTimestampAdapterTest.java
...estdb/cutlass/line/LineProtoHourTimestampAdapterTest.java
+37
-0
core/src/test/java/io/questdb/cutlass/line/LineProtoMicroTimestampAdapterTest.java
...stdb/cutlass/line/LineProtoMicroTimestampAdapterTest.java
+37
-0
core/src/test/java/io/questdb/cutlass/line/LineProtoMilliTimestampAdapterTest.java
...stdb/cutlass/line/LineProtoMilliTimestampAdapterTest.java
+37
-0
core/src/test/java/io/questdb/cutlass/line/LineProtoMinuteTimestampAdapterTest.java
...tdb/cutlass/line/LineProtoMinuteTimestampAdapterTest.java
+37
-0
core/src/test/java/io/questdb/cutlass/line/LineProtoNanoTimestampAdapterTest.java
...estdb/cutlass/line/LineProtoNanoTimestampAdapterTest.java
+37
-0
core/src/test/java/io/questdb/cutlass/line/LineProtoSecondTimestampAdapterTest.java
...tdb/cutlass/line/LineProtoSecondTimestampAdapterTest.java
+37
-0
core/src/test/java/io/questdb/cutlass/line/udp/LinuxLineProtoReceiverTest.java
.../questdb/cutlass/line/udp/LinuxLineProtoReceiverTest.java
+2
-2
未找到文件。
core/src/main/java/io/questdb/PropServerConfiguration.java
浏览文件 @
bc02e06e
...
...
@@ -35,8 +35,7 @@ import io.questdb.cutlass.http.processors.StaticContentProcessorConfiguration;
import
io.questdb.cutlass.http.processors.TextImportProcessorConfiguration
;
import
io.questdb.cutlass.json.JsonException
;
import
io.questdb.cutlass.json.JsonLexer
;
import
io.questdb.cutlass.line.LineProtoNanosTimestampAdapter
;
import
io.questdb.cutlass.line.LineProtoTimestampAdapter
;
import
io.questdb.cutlass.line.*
;
import
io.questdb.cutlass.line.udp.LineUdpReceiverConfiguration
;
import
io.questdb.cutlass.pgwire.DefaultPGWireConfiguration
;
import
io.questdb.cutlass.pgwire.PGWireConfiguration
;
...
...
@@ -124,6 +123,7 @@ public class PropServerConfiguration implements ServerConfiguration {
}
};
private
final
InputFormatConfiguration
inputFormatConfiguration
;
private
final
LineProtoTimestampAdapter
lineUdpTimestampAdapter
;
private
boolean
httpAllowDeflateBeforeSend
;
private
int
[]
httpWorkerAffinity
;
private
int
connectionPoolInitialCapacity
;
...
...
@@ -336,10 +336,31 @@ public class PropServerConfiguration implements ServerConfiguration {
this
.
lineUdpMsgCount
=
getInt
(
properties
,
"line.udp.msg.count"
,
10_000
);
this
.
lineUdpReceiveBufferSize
=
getIntSize
(
properties
,
"line.udp.receive.buffer.size"
,
1024
*
1024
);
this
.
lineUdpEnabled
=
getBoolean
(
properties
,
"line.udp.enabled"
,
true
);
// this.lineUdpWorkerCount = getInt(properties, "line.udp.worker.count", 0);
this
.
lineUdpOwnThreadAffinity
=
getInt
(
properties
,
"line.udp.own.thread.affinity"
,
-
1
);
this
.
lineUdpOwnThread
=
getBoolean
(
properties
,
"line.udp.own.thread"
,
false
);
this
.
lineUdpUnicast
=
getBoolean
(
properties
,
"line.udp.unicast"
,
false
);
final
String
lineUdpTimestampSwitch
=
getString
(
properties
,
"line.udp.timestamp"
,
"n"
);
switch
(
lineUdpTimestampSwitch
)
{
case
"u"
:
lineUdpTimestampAdapter
=
LineProtoMicroTimestampAdapter
.
INSTANCE
;
break
;
case
"ms"
:
lineUdpTimestampAdapter
=
LineProtoMilliTimestampAdapter
.
INSTANCE
;
break
;
case
"s"
:
lineUdpTimestampAdapter
=
LineProtoSecondTimestampAdapter
.
INSTANCE
;
break
;
case
"m"
:
lineUdpTimestampAdapter
=
LineProtoMinuteTimestampAdapter
.
INSTANCE
;
break
;
case
"h"
:
lineUdpTimestampAdapter
=
LineProtoHourTimestampAdapter
.
INSTANCE
;
break
;
default
:
lineUdpTimestampAdapter
=
LineProtoNanoTimestampAdapter
.
INSTANCE
;
break
;
}
}
@Override
...
...
@@ -1114,7 +1135,7 @@ public class PropServerConfiguration implements ServerConfiguration {
@Override
public
LineProtoTimestampAdapter
getTimestampAdapter
()
{
return
LineProtoNanosTimestampAdapter
.
INSTANCE
;
return
lineUdpTimestampAdapter
;
}
}
...
...
core/src/main/java/io/questdb/cutlass/line/LineProtoHourTimestampAdapter.java
0 → 100644
浏览文件 @
bc02e06e
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2020 QuestDB
*
* Licensed 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
io.questdb.cutlass.line
;
import
io.questdb.std.Numbers
;
import
io.questdb.std.NumericException
;
import
io.questdb.std.microtime.Timestamps
;
public
class
LineProtoHourTimestampAdapter
implements
LineProtoTimestampAdapter
{
public
static
final
LineProtoHourTimestampAdapter
INSTANCE
=
new
LineProtoHourTimestampAdapter
();
@Override
public
long
getMicros
(
CharSequence
value
)
throws
NumericException
{
return
Numbers
.
parseLong
(
value
)
*
Timestamps
.
HOUR_MICROS
;
}
}
core/src/main/java/io/questdb/cutlass/line/LineProtoMicroTimestampAdapter.java
0 → 100644
浏览文件 @
bc02e06e
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2020 QuestDB
*
* Licensed 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
io.questdb.cutlass.line
;
import
io.questdb.std.Numbers
;
import
io.questdb.std.NumericException
;
public
class
LineProtoMicroTimestampAdapter
implements
LineProtoTimestampAdapter
{
public
static
final
LineProtoMicroTimestampAdapter
INSTANCE
=
new
LineProtoMicroTimestampAdapter
();
@Override
public
long
getMicros
(
CharSequence
value
)
throws
NumericException
{
return
Numbers
.
parseLong
(
value
);
}
}
core/src/main/java/io/questdb/cutlass/line/LineProtoMilliTimestampAdapter.java
0 → 100644
浏览文件 @
bc02e06e
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2020 QuestDB
*
* Licensed 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
io.questdb.cutlass.line
;
import
io.questdb.std.Numbers
;
import
io.questdb.std.NumericException
;
public
class
LineProtoMilliTimestampAdapter
implements
LineProtoTimestampAdapter
{
public
static
final
LineProtoMilliTimestampAdapter
INSTANCE
=
new
LineProtoMilliTimestampAdapter
();
@Override
public
long
getMicros
(
CharSequence
value
)
throws
NumericException
{
return
Numbers
.
parseLong
(
value
)
*
1000L
;
}
}
core/src/main/java/io/questdb/cutlass/line/LineProtoMinuteTimestampAdapter.java
0 → 100644
浏览文件 @
bc02e06e
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2020 QuestDB
*
* Licensed 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
io.questdb.cutlass.line
;
import
io.questdb.std.Numbers
;
import
io.questdb.std.NumericException
;
import
io.questdb.std.microtime.Timestamps
;
public
class
LineProtoMinuteTimestampAdapter
implements
LineProtoTimestampAdapter
{
public
static
final
LineProtoMinuteTimestampAdapter
INSTANCE
=
new
LineProtoMinuteTimestampAdapter
();
@Override
public
long
getMicros
(
CharSequence
value
)
throws
NumericException
{
return
Numbers
.
parseLong
(
value
)
*
Timestamps
.
MINUTE_MICROS
;
}
}
core/src/main/java/io/questdb/cutlass/line/LineProtoNano
s
TimestampAdapter.java
→
core/src/main/java/io/questdb/cutlass/line/LineProtoNanoTimestampAdapter.java
浏览文件 @
bc02e06e
...
...
@@ -27,8 +27,8 @@ package io.questdb.cutlass.line;
import
io.questdb.std.Numbers
;
import
io.questdb.std.NumericException
;
public
class
LineProtoNano
s
TimestampAdapter
implements
LineProtoTimestampAdapter
{
public
static
final
LineProtoNano
sTimestampAdapter
INSTANCE
=
new
LineProtoNanos
TimestampAdapter
();
public
class
LineProtoNanoTimestampAdapter
implements
LineProtoTimestampAdapter
{
public
static
final
LineProtoNano
TimestampAdapter
INSTANCE
=
new
LineProtoNano
TimestampAdapter
();
@Override
public
long
getMicros
(
CharSequence
value
)
throws
NumericException
{
...
...
core/src/main/java/io/questdb/cutlass/line/LineProtoSecondTimestampAdapter.java
0 → 100644
浏览文件 @
bc02e06e
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2020 QuestDB
*
* Licensed 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
io.questdb.cutlass.line
;
import
io.questdb.std.Numbers
;
import
io.questdb.std.NumericException
;
import
io.questdb.std.microtime.Timestamps
;
public
class
LineProtoSecondTimestampAdapter
implements
LineProtoTimestampAdapter
{
public
static
final
LineProtoSecondTimestampAdapter
INSTANCE
=
new
LineProtoSecondTimestampAdapter
();
@Override
public
long
getMicros
(
CharSequence
value
)
throws
NumericException
{
return
Numbers
.
parseLong
(
value
)
*
Timestamps
.
SECOND_MICROS
;
}
}
core/src/test/java/io/questdb/PropServerConfigurationTest.java
浏览文件 @
bc02e06e
...
...
@@ -27,6 +27,7 @@ package io.questdb;
import
io.questdb.cairo.CommitMode
;
import
io.questdb.cairo.security.AllowAllCairoSecurityContext
;
import
io.questdb.cutlass.json.JsonException
;
import
io.questdb.cutlass.line.*
;
import
io.questdb.network.EpollFacadeImpl
;
import
io.questdb.network.IOOperation
;
import
io.questdb.network.NetworkFacadeImpl
;
...
...
@@ -226,6 +227,39 @@ public class PropServerConfigurationTest {
new
PropServerConfiguration
(
"root"
,
properties
);
}
@Test
public
void
testLineUdpTimestamp
()
throws
ServerConfigurationException
,
JsonException
{
Properties
properties
=
new
Properties
();
properties
.
setProperty
(
"http.enabled"
,
"false"
);
properties
.
setProperty
(
"line.udp.timestamp"
,
""
);
PropServerConfiguration
configuration
=
new
PropServerConfiguration
(
"root"
,
properties
);
Assert
.
assertSame
(
LineProtoNanoTimestampAdapter
.
INSTANCE
,
configuration
.
getLineUdpReceiverConfiguration
().
getTimestampAdapter
());
properties
.
setProperty
(
"line.udp.timestamp"
,
"n"
);
configuration
=
new
PropServerConfiguration
(
"root"
,
properties
);
Assert
.
assertSame
(
LineProtoNanoTimestampAdapter
.
INSTANCE
,
configuration
.
getLineUdpReceiverConfiguration
().
getTimestampAdapter
());
properties
.
setProperty
(
"line.udp.timestamp"
,
"u"
);
configuration
=
new
PropServerConfiguration
(
"root"
,
properties
);
Assert
.
assertSame
(
LineProtoMicroTimestampAdapter
.
INSTANCE
,
configuration
.
getLineUdpReceiverConfiguration
().
getTimestampAdapter
());
properties
.
setProperty
(
"line.udp.timestamp"
,
"ms"
);
configuration
=
new
PropServerConfiguration
(
"root"
,
properties
);
Assert
.
assertSame
(
LineProtoMilliTimestampAdapter
.
INSTANCE
,
configuration
.
getLineUdpReceiverConfiguration
().
getTimestampAdapter
());
properties
.
setProperty
(
"line.udp.timestamp"
,
"s"
);
configuration
=
new
PropServerConfiguration
(
"root"
,
properties
);
Assert
.
assertSame
(
LineProtoSecondTimestampAdapter
.
INSTANCE
,
configuration
.
getLineUdpReceiverConfiguration
().
getTimestampAdapter
());
properties
.
setProperty
(
"line.udp.timestamp"
,
"m"
);
configuration
=
new
PropServerConfiguration
(
"root"
,
properties
);
Assert
.
assertSame
(
LineProtoMinuteTimestampAdapter
.
INSTANCE
,
configuration
.
getLineUdpReceiverConfiguration
().
getTimestampAdapter
());
properties
.
setProperty
(
"line.udp.timestamp"
,
"h"
);
configuration
=
new
PropServerConfiguration
(
"root"
,
properties
);
Assert
.
assertSame
(
LineProtoHourTimestampAdapter
.
INSTANCE
,
configuration
.
getLineUdpReceiverConfiguration
().
getTimestampAdapter
());
}
@Test
(
expected
=
ServerConfigurationException
.
class
)
public
void
testInvalidBindToPort
()
throws
ServerConfigurationException
,
JsonException
{
Properties
properties
=
new
Properties
();
...
...
core/src/test/java/io/questdb/cutlass/line/CairoLineProtoParserTest.java
浏览文件 @
bc02e06e
...
...
@@ -535,7 +535,7 @@ public class CairoLineProtoParserTest extends AbstractCairoTest {
private
void
assertThat
(
String
expected
,
String
lines
,
CharSequence
tableName
,
CairoConfiguration
configuration
)
throws
Exception
{
TestUtils
.
assertMemoryLeak
(()
->
{
try
(
CairoEngine
engine
=
new
CairoEngine
(
configuration
,
null
))
{
try
(
CairoLineProtoParser
parser
=
new
CairoLineProtoParser
(
engine
,
AllowAllCairoSecurityContext
.
INSTANCE
,
LineProtoNano
s
TimestampAdapter
.
INSTANCE
))
{
try
(
CairoLineProtoParser
parser
=
new
CairoLineProtoParser
(
engine
,
AllowAllCairoSecurityContext
.
INSTANCE
,
LineProtoNanoTimestampAdapter
.
INSTANCE
))
{
byte
[]
bytes
=
lines
.
getBytes
(
StandardCharsets
.
UTF_8
);
int
len
=
bytes
.
length
;
long
mem
=
Unsafe
.
malloc
(
len
);
...
...
core/src/test/java/io/questdb/cutlass/line/LineProtoHourTimestampAdapterTest.java
0 → 100644
浏览文件 @
bc02e06e
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2020 QuestDB
*
* Licensed 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
io.questdb.cutlass.line
;
import
io.questdb.std.NumericException
;
import
org.junit.Assert
;
import
org.junit.Test
;
public
class
LineProtoHourTimestampAdapterTest
{
@Test
public
void
testRounding
()
throws
NumericException
{
Assert
.
assertEquals
(
20444400000000L
,
LineProtoHourTimestampAdapter
.
INSTANCE
.
getMicros
(
"5679"
));
}
}
\ No newline at end of file
core/src/test/java/io/questdb/cutlass/line/LineProtoMicroTimestampAdapterTest.java
0 → 100644
浏览文件 @
bc02e06e
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2020 QuestDB
*
* Licensed 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
io.questdb.cutlass.line
;
import
io.questdb.std.NumericException
;
import
org.junit.Assert
;
import
org.junit.Test
;
public
class
LineProtoMicroTimestampAdapterTest
{
@Test
public
void
testRounding
()
throws
NumericException
{
Assert
.
assertEquals
(
5679L
,
LineProtoMicroTimestampAdapter
.
INSTANCE
.
getMicros
(
"5679"
));
}
}
\ No newline at end of file
core/src/test/java/io/questdb/cutlass/line/LineProtoMilliTimestampAdapterTest.java
0 → 100644
浏览文件 @
bc02e06e
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2020 QuestDB
*
* Licensed 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
io.questdb.cutlass.line
;
import
io.questdb.std.NumericException
;
import
org.junit.Assert
;
import
org.junit.Test
;
public
class
LineProtoMilliTimestampAdapterTest
{
@Test
public
void
testRounding
()
throws
NumericException
{
Assert
.
assertEquals
(
5679000L
,
LineProtoMilliTimestampAdapter
.
INSTANCE
.
getMicros
(
"5679"
));
}
}
\ No newline at end of file
core/src/test/java/io/questdb/cutlass/line/LineProtoMinuteTimestampAdapterTest.java
0 → 100644
浏览文件 @
bc02e06e
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2020 QuestDB
*
* Licensed 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
io.questdb.cutlass.line
;
import
io.questdb.std.NumericException
;
import
org.junit.Assert
;
import
org.junit.Test
;
public
class
LineProtoMinuteTimestampAdapterTest
{
@Test
public
void
testRounding
()
throws
NumericException
{
Assert
.
assertEquals
(
340740000000L
,
LineProtoMinuteTimestampAdapter
.
INSTANCE
.
getMicros
(
"5679"
));
}
}
\ No newline at end of file
core/src/test/java/io/questdb/cutlass/line/LineProtoNanoTimestampAdapterTest.java
0 → 100644
浏览文件 @
bc02e06e
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2020 QuestDB
*
* Licensed 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
io.questdb.cutlass.line
;
import
io.questdb.std.NumericException
;
import
org.junit.Assert
;
import
org.junit.Test
;
public
class
LineProtoNanoTimestampAdapterTest
{
@Test
public
void
testRounding
()
throws
NumericException
{
Assert
.
assertEquals
(
56799L
,
LineProtoNanoTimestampAdapter
.
INSTANCE
.
getMicros
(
"56799000"
));
}
}
\ No newline at end of file
core/src/test/java/io/questdb/cutlass/line/LineProtoSecondTimestampAdapterTest.java
0 → 100644
浏览文件 @
bc02e06e
/*******************************************************************************
* ___ _ ____ ____
* / _ \ _ _ ___ ___| |_| _ \| __ )
* | | | | | | |/ _ \/ __| __| | | | _ \
* | |_| | |_| | __/\__ \ |_| |_| | |_) |
* \__\_\\__,_|\___||___/\__|____/|____/
*
* Copyright (c) 2014-2019 Appsicle
* Copyright (c) 2019-2020 QuestDB
*
* Licensed 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
io.questdb.cutlass.line
;
import
io.questdb.std.NumericException
;
import
org.junit.Assert
;
import
org.junit.Test
;
public
class
LineProtoSecondTimestampAdapterTest
{
@Test
public
void
testRounding
()
throws
NumericException
{
Assert
.
assertEquals
(
5679000000L
,
LineProtoSecondTimestampAdapter
.
INSTANCE
.
getMicros
(
"5679"
));
}
}
\ No newline at end of file
core/src/test/java/io/questdb/cutlass/line/udp/LinuxLineProtoReceiverTest.java
浏览文件 @
bc02e06e
...
...
@@ -27,7 +27,7 @@ package io.questdb.cutlass.line.udp;
import
io.questdb.WorkerPoolAwareConfiguration
;
import
io.questdb.cairo.*
;
import
io.questdb.cairo.security.AllowAllCairoSecurityContext
;
import
io.questdb.cutlass.line.LineProtoNano
s
TimestampAdapter
;
import
io.questdb.cutlass.line.LineProtoNanoTimestampAdapter
;
import
io.questdb.cutlass.line.LineProtoTimestampAdapter
;
import
io.questdb.network.Net
;
import
io.questdb.network.NetworkFacade
;
...
...
@@ -333,7 +333,7 @@ public class LinuxLineProtoReceiverTest extends AbstractCairoTest {
@Override
public
LineProtoTimestampAdapter
getTimestampAdapter
()
{
return
LineProtoNano
s
TimestampAdapter
.
INSTANCE
;
return
LineProtoNanoTimestampAdapter
.
INSTANCE
;
}
@Override
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录