Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Questdb
提交
13ece895
Q
Questdb
项目概览
jobily
/
Questdb
大约 1 年 前同步成功
通知
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,发现更多精彩内容 >>
提交
13ece895
编写于
12月 18, 2019
作者:
V
Vlad Ilyushchenko
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: consolidated usage of toString()
上级
d7b31fcd
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
115 addition
and
110 deletion
+115
-110
core/src/main/java/io/questdb/cairo/DefaultCairoConfiguration.java
...main/java/io/questdb/cairo/DefaultCairoConfiguration.java
+1
-1
core/src/main/java/io/questdb/cairo/TableReader.java
core/src/main/java/io/questdb/cairo/TableReader.java
+1
-1
core/src/main/java/io/questdb/cairo/TableWriter.java
core/src/main/java/io/questdb/cairo/TableWriter.java
+1
-1
core/src/main/java/io/questdb/cutlass/line/CairoLineProtoParser.java
...in/java/io/questdb/cutlass/line/CairoLineProtoParser.java
+1
-1
core/src/main/java/io/questdb/cutlass/text/TextMetadataParser.java
...main/java/io/questdb/cutlass/text/TextMetadataParser.java
+26
-19
core/src/main/java/io/questdb/griffin/engine/join/JoinRecordMetadata.java
...va/io/questdb/griffin/engine/join/JoinRecordMetadata.java
+1
-1
core/src/main/java/io/questdb/griffin/model/CreateTableModel.java
.../main/java/io/questdb/griffin/model/CreateTableModel.java
+1
-1
core/src/main/java/io/questdb/std/CharSequenceIntHashMap.java
.../src/main/java/io/questdb/std/CharSequenceIntHashMap.java
+3
-3
core/src/main/java/io/questdb/std/Chars.java
core/src/main/java/io/questdb/std/Chars.java
+51
-60
core/src/main/java/io/questdb/std/GenericLexer.java
core/src/main/java/io/questdb/std/GenericLexer.java
+1
-1
core/src/main/java/io/questdb/std/LongList.java
core/src/main/java/io/questdb/std/LongList.java
+6
-6
core/src/main/java/io/questdb/std/LowerCaseAsciiCharSequenceHashSet.java
...ava/io/questdb/std/LowerCaseAsciiCharSequenceHashSet.java
+1
-2
core/src/main/java/io/questdb/std/LowerCaseAsciiCharSequenceIntHashMap.java
.../io/questdb/std/LowerCaseAsciiCharSequenceIntHashMap.java
+2
-2
core/src/main/java/io/questdb/std/LowerCaseAsciiCharSequenceObjHashMap.java
.../io/questdb/std/LowerCaseAsciiCharSequenceObjHashMap.java
+2
-2
core/src/main/java/io/questdb/std/microtime/DateFormatCompiler.java
...ain/java/io/questdb/std/microtime/DateFormatCompiler.java
+1
-1
core/src/main/java/io/questdb/std/microtime/Timestamps.java
core/src/main/java/io/questdb/std/microtime/Timestamps.java
+3
-2
core/src/main/java/io/questdb/std/str/AbstractCharSequence.java
...rc/main/java/io/questdb/std/str/AbstractCharSequence.java
+1
-1
core/src/main/java/io/questdb/std/str/Path.java
core/src/main/java/io/questdb/std/str/Path.java
+7
-1
core/src/main/java/io/questdb/std/time/DateFormatCompiler.java
...src/main/java/io/questdb/std/time/DateFormatCompiler.java
+1
-1
core/src/main/java/io/questdb/std/time/Dates.java
core/src/main/java/io/questdb/std/time/Dates.java
+2
-1
core/src/test/java/io/questdb/cairo/TableModel.java
core/src/test/java/io/questdb/cairo/TableModel.java
+1
-1
core/src/test/java/io/questdb/cairo/pool/ReaderPoolTest.java
core/src/test/java/io/questdb/cairo/pool/ReaderPoolTest.java
+1
-1
未找到文件。
core/src/main/java/io/questdb/cairo/DefaultCairoConfiguration.java
浏览文件 @
13ece895
...
...
@@ -41,7 +41,7 @@ public class DefaultCairoConfiguration implements CairoConfiguration {
private
final
TextConfiguration
textConfiguration
=
new
DefaultTextConfiguration
();
public
DefaultCairoConfiguration
(
CharSequence
root
)
{
this
.
root
=
Chars
.
stringOf
(
root
);
this
.
root
=
Chars
.
toString
(
root
);
}
@Override
...
...
core/src/main/java/io/questdb/cairo/TableReader.java
浏览文件 @
13ece895
...
...
@@ -89,7 +89,7 @@ public class TableReader implements Closeable {
LOG
.
info
().
$
(
"open '"
).
utf8
(
tableName
).
$
(
'\''
).
$
();
this
.
configuration
=
configuration
;
this
.
ff
=
configuration
.
getFilesFacade
();
this
.
tableName
=
Chars
.
stringOf
(
tableName
);
this
.
tableName
=
Chars
.
toString
(
tableName
);
this
.
path
=
new
Path
().
of
(
configuration
.
getRoot
()).
concat
(
tableName
);
this
.
rootLen
=
path
.
length
();
try
{
...
...
core/src/main/java/io/questdb/cairo/TableWriter.java
浏览文件 @
13ece895
...
...
@@ -142,7 +142,7 @@ public class TableWriter implements Closeable {
this
.
fileOperationRetryCount
=
configuration
.
getFileOperationRetryCount
();
this
.
path
=
new
Path
().
of
(
configuration
.
getRoot
()).
concat
(
name
);
this
.
other
=
new
Path
().
of
(
configuration
.
getRoot
()).
concat
(
name
);
this
.
name
=
Chars
.
stringOf
(
name
);
this
.
name
=
Chars
.
toString
(
name
);
this
.
rootLen
=
path
.
length
();
try
{
if
(
lock
)
{
...
...
core/src/main/java/io/questdb/cutlass/line/CairoLineProtoParser.java
浏览文件 @
13ece895
...
...
@@ -489,7 +489,7 @@ public class CairoLineProtoParser implements LineProtoParser, Closeable {
entry
=
writerCache
.
valueAt
(
entryIndex
);
}
else
{
entry
=
new
CacheEntry
();
writerCache
.
putAt
(
entryIndex
,
Chars
.
stringOf
(
tableName
),
entry
);
writerCache
.
putAt
(
entryIndex
,
Chars
.
toString
(
tableName
),
entry
);
// adjust writer map index to negative, which indicates that entry exists
entryIndex
=
-
entryIndex
-
1
;
}
...
...
core/src/main/java/io/questdb/cutlass/text/TextMetadataParser.java
浏览文件 @
13ece895
...
...
@@ -55,6 +55,15 @@ public class TextMetadataParser implements JsonParser, Mutable, Closeable {
private
static
final
int
P_LOCALE
=
4
;
private
static
final
int
P_UTF8
=
5
;
private
static
final
CharSequenceIntHashMap
propertyNameMap
=
new
CharSequenceIntHashMap
();
static
{
propertyNameMap
.
put
(
"name"
,
P_NAME
);
propertyNameMap
.
put
(
"type"
,
P_TYPE
);
propertyNameMap
.
put
(
"pattern"
,
P_PATTERN
);
propertyNameMap
.
put
(
"locale"
,
P_LOCALE
);
propertyNameMap
.
put
(
"utf8"
,
P_UTF8
);
}
private
final
DateLocaleFactory
dateLocaleFactory
;
private
final
TimestampLocaleFactory
timestampLocaleFactory
;
private
final
ObjectPool
<
FloatingCharSequence
>
csPool
;
...
...
@@ -87,6 +96,22 @@ public class TextMetadataParser implements JsonParser, Mutable, Closeable {
this
.
typeManager
=
typeManager
;
}
private
static
void
strcpyw
(
final
CharSequence
value
,
final
int
len
,
final
long
address
)
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
Unsafe
.
getUnsafe
().
putChar
(
address
+
(
i
<<
1
),
value
.
charAt
(
i
));
}
}
private
static
void
checkInputs
(
int
position
,
CharSequence
name
,
int
type
)
throws
JsonException
{
if
(
name
==
null
)
{
throw
JsonException
.
$
(
position
,
"Missing 'name' property"
);
}
if
(
type
==
-
1
)
{
throw
JsonException
.
$
(
position
,
"Missing 'type' property"
);
}
}
@Override
public
void
clear
()
{
bufSize
=
0
;
...
...
@@ -172,16 +197,6 @@ public class TextMetadataParser implements JsonParser, Mutable, Closeable {
}
}
private
static
void
checkInputs
(
int
position
,
CharSequence
name
,
int
type
)
throws
JsonException
{
if
(
name
==
null
)
{
throw
JsonException
.
$
(
position
,
"Missing 'name' property"
);
}
if
(
type
==
-
1
)
{
throw
JsonException
.
$
(
position
,
"Missing 'type' property"
);
}
}
private
void
clearStage
()
{
name
=
null
;
type
=
-
1
;
...
...
@@ -204,7 +219,7 @@ public class TextMetadataParser implements JsonParser, Mutable, Closeable {
bufCapacity
=
n
*
2
;
}
Chars
.
strcpyw
(
tag
,
l
/
2
,
buf
+
bufSize
);
strcpyw
(
tag
,
l
/
2
,
buf
+
bufSize
);
CharSequence
cs
=
csPool
.
next
().
of
(
bufSize
,
l
/
2
);
bufSize
+=
l
;
return
cs
;
...
...
@@ -283,12 +298,4 @@ public class TextMetadataParser implements JsonParser, Mutable, Closeable {
return
this
;
}
}
static
{
propertyNameMap
.
put
(
"name"
,
P_NAME
);
propertyNameMap
.
put
(
"type"
,
P_TYPE
);
propertyNameMap
.
put
(
"pattern"
,
P_PATTERN
);
propertyNameMap
.
put
(
"locale"
,
P_LOCALE
);
propertyNameMap
.
put
(
"utf8"
,
P_UTF8
);
}
}
core/src/main/java/io/questdb/griffin/engine/join/JoinRecordMetadata.java
浏览文件 @
13ece895
...
...
@@ -87,7 +87,7 @@ public class JoinRecordMetadata extends BaseRecordMetadata implements Closeable
if
(
dot
==
-
1
)
{
cm
=
new
TableColumnMetadata
(
b
.
put
(
tableAlias
).
put
(
'.'
).
put
(
columnName
).
toString
(),
columnType
);
}
else
{
cm
=
new
TableColumnMetadata
(
Chars
.
stringOf
(
columnName
),
columnType
);
cm
=
new
TableColumnMetadata
(
Chars
.
toString
(
columnName
),
columnType
);
}
this
.
columnMetadata
.
add
(
cm
);
...
...
core/src/main/java/io/questdb/griffin/model/CreateTableModel.java
浏览文件 @
13ece895
...
...
@@ -48,7 +48,7 @@ public class CreateTableModel implements Mutable, ExecutionModel, Sinkable, Tabl
public
boolean
addColumn
(
CharSequence
name
,
int
type
,
int
symbolCapacity
)
{
if
(
columnNameIndexMap
.
put
(
name
,
columnNames
.
size
()))
{
columnNames
.
add
(
Chars
.
stringOf
(
name
));
columnNames
.
add
(
Chars
.
toString
(
name
));
columnBits
.
add
(
Numbers
.
encodeLowHighInts
(
type
,
symbolCapacity
));
columnBits
.
add
(
Numbers
.
encodeLowHighInts
(
COLUMN_FLAG_CACHED
,
0
));
return
true
;
...
...
core/src/main/java/io/questdb/std/CharSequenceIntHashMap.java
浏览文件 @
13ece895
...
...
@@ -60,7 +60,7 @@ public class CharSequenceIntHashMap extends AbstractCharSequenceHashSet {
if
(
index
<
0
)
{
values
[-
index
-
1
]
=
values
[-
index
-
1
]
+
1
;
}
else
{
putAt0
(
index
,
key
.
toString
(
),
0
);
putAt0
(
index
,
Chars
.
toString
(
key
),
0
);
}
}
...
...
@@ -117,7 +117,7 @@ public class CharSequenceIntHashMap extends AbstractCharSequenceHashSet {
values
[-
index
-
1
]
=
value
;
return
false
;
}
String
keyString
=
key
.
toString
(
);
final
String
keyString
=
Chars
.
toString
(
key
);
putAt0
(
index
,
keyString
,
value
);
list
.
add
(
keyString
);
return
true
;
...
...
@@ -130,7 +130,7 @@ public class CharSequenceIntHashMap extends AbstractCharSequenceHashSet {
public
void
putIfAbsent
(
CharSequence
key
,
int
value
)
{
int
index
=
keyIndex
(
key
);
if
(
index
>
-
1
)
{
putAt0
(
index
,
key
.
toString
(
),
value
);
putAt0
(
index
,
Chars
.
toString
(
key
),
value
);
}
}
...
...
core/src/main/java/io/questdb/std/Chars.java
浏览文件 @
13ece895
...
...
@@ -35,31 +35,6 @@ public final class Chars {
private
Chars
()
{
}
public
static
int
compare
(
CharSequence
l
,
CharSequence
r
)
{
if
(
l
==
r
)
{
return
0
;
}
if
(
l
==
null
)
{
return
-
1
;
}
if
(
r
==
null
)
{
return
1
;
}
int
ll
=
l
.
length
();
int
rl
=
r
.
length
();
for
(
int
i
=
0
,
n
=
Math
.
min
(
ll
,
rl
);
i
<
n
;
i
++)
{
int
k
=
l
.
charAt
(
i
)
-
r
.
charAt
(
i
);
if
(
k
!=
0
)
{
return
k
;
}
}
return
Integer
.
compare
(
ll
,
rl
);
}
public
static
boolean
contains
(
CharSequence
sequence
,
CharSequence
term
)
{
int
m
=
term
.
length
();
if
(
m
==
0
)
{
...
...
@@ -120,7 +95,11 @@ public final class Chars {
return
false
;
}
for
(
int
i
=
0
;
i
<
ll
;
i
++)
{
return
equalsChars
(
l
,
r
,
ll
);
}
private
static
boolean
equalsChars
(
CharSequence
l
,
CharSequence
r
,
int
len
)
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
if
(
l
.
charAt
(
i
)
!=
r
.
charAt
(
i
))
{
return
false
;
}
...
...
@@ -217,6 +196,24 @@ public final class Chars {
return
true
;
}
public
static
String
toLowerCaseAscii
(
@Nullable
CharSequence
value
)
{
if
(
value
==
null
)
{
return
null
;
}
final
int
len
=
value
.
length
();
if
(
len
==
0
)
{
return
""
;
}
final
CharSink
b
=
Misc
.
getThreadLocalBuilder
();
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
b
.
put
(
toLowerCaseAscii
(
value
.
charAt
(
i
)));
}
return
b
.
toString
();
}
public
static
boolean
equalsLowerCaseAscii
(
@NotNull
CharSequence
l
,
CharSequence
r
)
{
int
ll
;
if
((
ll
=
l
.
length
())
!=
r
.
length
())
{
...
...
@@ -408,17 +405,8 @@ public final class Chars {
}
public
static
boolean
startsWith
(
CharSequence
_this
,
CharSequence
that
)
{
int
len
=
that
.
length
();
if
(
_this
.
length
()
<
len
)
{
return
false
;
}
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
if
(
_this
.
charAt
(
i
)
!=
that
.
charAt
(
i
))
{
return
false
;
}
}
return
true
;
final
int
len
=
that
.
length
();
return
_this
.
length
()
>=
len
&&
equalsChars
(
_this
,
that
,
len
);
}
public
static
boolean
startsWith
(
CharSequence
_this
,
int
thisLo
,
int
thisHi
,
CharSequence
that
)
{
...
...
@@ -446,29 +434,6 @@ public final class Chars {
}
}
public
static
void
strcpy
(
final
CharSequence
value
,
final
int
lo
,
final
int
hi
,
final
long
address
)
{
for
(
int
i
=
lo
;
i
<
hi
;
i
++)
{
Unsafe
.
getUnsafe
().
putByte
(
address
+
i
-
lo
,
(
byte
)
value
.
charAt
(
i
));
}
}
public
static
void
strcpyw
(
final
CharSequence
value
,
final
int
len
,
final
long
address
)
{
for
(
int
i
=
0
;
i
<
len
;
i
++)
{
Unsafe
.
getUnsafe
().
putChar
(
address
+
(
i
<<
1
),
value
.
charAt
(
i
));
}
}
public
static
String
stringOf
(
CharSequence
charSequence
)
{
if
(
charSequence
instanceof
String
)
{
return
(
String
)
charSequence
;
}
if
(
charSequence
==
null
)
{
return
null
;
}
return
charSequence
.
toString
();
}
public
static
char
toLowerCaseAscii
(
char
character
)
{
return
character
>
64
&&
character
<
91
?
(
char
)
(
character
+
32
)
:
character
;
}
...
...
@@ -721,4 +686,30 @@ public final class Chars {
sink
.
put
((
char
)
(
b1
<<
6
^
b2
^
3968
));
return
2
;
}
public
static
int
compare
(
CharSequence
l
,
CharSequence
r
)
{
if
(
l
==
r
)
{
return
0
;
}
if
(
l
==
null
)
{
return
-
1
;
}
if
(
r
==
null
)
{
return
1
;
}
final
int
ll
=
l
.
length
();
final
int
rl
=
r
.
length
();
final
int
min
=
Math
.
min
(
ll
,
rl
);
for
(
int
i
=
0
;
i
<
min
;
i
++)
{
final
int
k
=
l
.
charAt
(
i
)
-
r
.
charAt
(
i
);
if
(
k
!=
0
)
{
return
k
;
}
}
return
Integer
.
compare
(
ll
,
rl
);
}
}
core/src/main/java/io/questdb/std/GenericLexer.java
浏览文件 @
13ece895
...
...
@@ -56,7 +56,7 @@ public class GenericLexer implements ImmutableIterator<CharSequence> {
public
GenericLexer
(
int
poolCapacity
)
{
this
.
csPool
=
new
ObjectPool
<>(
FloatingSequence:
:
new
,
poolCapacity
);
for
(
int
i
=
0
,
n
=
WHITESPACE
.
size
();
i
<
n
;
i
++)
{
defineSymbol
(
WHITESPACE
.
get
(
i
).
toString
(
));
defineSymbol
(
Chars
.
toString
(
WHITESPACE
.
get
(
i
)
));
}
}
...
...
core/src/main/java/io/questdb/std/LongList.java
浏览文件 @
13ece895
...
...
@@ -224,17 +224,17 @@ public class LongList implements Mutable {
*/
@Override
public
String
toString
()
{
CharSink
toStringBuilder
=
Misc
.
getThreadLocalBuilder
();
final
CharSink
sb
=
Misc
.
getThreadLocalBuilder
();
toStringBuilder
.
put
(
'['
);
sb
.
put
(
'['
);
for
(
int
i
=
0
,
k
=
size
();
i
<
k
;
i
++)
{
if
(
i
>
0
)
{
toStringBuilder
.
put
(
','
);
sb
.
put
(
','
);
}
toStringBuilder
.
put
(
get
(
i
));
sb
.
put
(
get
(
i
));
}
toStringBuilder
.
put
(
']'
);
return
toStringBuilder
.
toString
();
sb
.
put
(
']'
);
return
sb
.
toString
();
}
public
void
increment
(
int
index
)
{
...
...
core/src/main/java/io/questdb/std/LowerCaseAsciiCharSequenceHashSet.java
浏览文件 @
13ece895
...
...
@@ -58,8 +58,7 @@ public class LowerCaseAsciiCharSequenceHashSet extends AbstractLowerCaseAsciiCha
}
public
void
addAt
(
int
index
,
CharSequence
key
)
{
String
s
=
Chars
.
toString
(
key
).
toLowerCase
();
keys
[
index
]
=
s
;
keys
[
index
]
=
Chars
.
toLowerCaseAscii
(
key
);
if
(--
free
<
1
)
{
rehash
();
}
...
...
core/src/main/java/io/questdb/std/LowerCaseAsciiCharSequenceIntHashMap.java
浏览文件 @
13ece895
...
...
@@ -79,14 +79,14 @@ public class LowerCaseAsciiCharSequenceIntHashMap extends AbstractLowerCaseAscii
values
[-
index
-
1
]
=
value
;
return
false
;
}
putAt0
(
index
,
key
.
toString
().
toLowerCase
(
),
value
);
putAt0
(
index
,
Chars
.
toLowerCaseAscii
(
key
),
value
);
return
true
;
}
public
void
putIfAbsent
(
CharSequence
key
,
int
value
)
{
int
index
=
keyIndex
(
key
);
if
(
index
>
-
1
)
{
putAt0
(
index
,
key
.
toString
(
),
value
);
putAt0
(
index
,
Chars
.
toLowerCaseAscii
(
key
),
value
);
}
}
...
...
core/src/main/java/io/questdb/std/LowerCaseAsciiCharSequenceObjHashMap.java
浏览文件 @
13ece895
...
...
@@ -82,7 +82,7 @@ public class LowerCaseAsciiCharSequenceObjHashMap<T> extends AbstractLowerCaseAs
return
false
;
}
final
String
lcKey
=
key
.
toString
().
toLowerCase
(
);
final
String
lcKey
=
Chars
.
toLowerCaseAscii
(
key
);
putAt0
(
index
,
lcKey
,
value
);
list
.
add
(
lcKey
);
return
true
;
...
...
@@ -91,7 +91,7 @@ public class LowerCaseAsciiCharSequenceObjHashMap<T> extends AbstractLowerCaseAs
public
void
putIfAbsent
(
CharSequence
key
,
T
value
)
{
int
index
=
keyIndex
(
key
);
if
(
index
>
-
1
)
{
putAt0
(
index
,
key
.
toString
(
),
value
);
putAt0
(
index
,
Chars
.
toLowerCaseAscii
(
key
),
value
);
}
}
...
...
core/src/main/java/io/questdb/std/microtime/DateFormatCompiler.java
浏览文件 @
13ece895
...
...
@@ -204,7 +204,7 @@ public class DateFormatCompiler {
int
op
=
opMap
.
get
(
cs
);
if
(
op
==
-
1
)
{
makeLastOpGreedy
(
ops
);
delimiters
.
add
(
cs
.
toString
(
));
delimiters
.
add
(
Chars
.
toString
(
cs
));
ops
.
add
(-(
delimiters
.
size
()));
}
else
{
if
(
op
==
OP_AM_PM
)
{
...
...
core/src/main/java/io/questdb/std/microtime/Timestamps.java
浏览文件 @
13ece895
...
...
@@ -25,9 +25,10 @@
package
io.questdb.std.microtime
;
import
io.questdb.std.Chars
;
import
io.questdb.std.Misc
;
import
io.questdb.std.Numbers
;
import
io.questdb.std.NumericException
;
import
io.questdb.std.str.
String
Sink
;
import
io.questdb.std.str.
Char
Sink
;
final
public
class
Timestamps
{
...
...
@@ -585,7 +586,7 @@ final public class Timestamps {
}
public
static
String
toString
(
long
micros
)
{
StringSink
sink
=
new
StringSink
();
CharSink
sink
=
Misc
.
getThreadLocalBuilder
();
DateFormatUtils
.
appendDateTime
(
sink
,
micros
);
return
sink
.
toString
();
}
...
...
core/src/main/java/io/questdb/std/str/AbstractCharSequence.java
浏览文件 @
13ece895
...
...
@@ -39,7 +39,7 @@ public abstract class AbstractCharSequence implements CharSequence, CloneableMut
@Override
@SuppressWarnings
(
"unchecked"
)
public
<
T
>
T
copy
()
{
return
(
T
)
this
.
toString
(
);
return
(
T
)
AbstractCharSequence
.
getString
(
this
);
}
@Override
...
...
core/src/main/java/io/questdb/std/str/Path.java
浏览文件 @
13ece895
...
...
@@ -57,6 +57,12 @@ public class Path extends AbstractCharSink implements Closeable, LPSZ {
this
.
ptr
=
this
.
wptr
=
Unsafe
.
malloc
(
capacity
+
1
);
}
private
static
void
strcpy
(
final
CharSequence
value
,
final
int
lo
,
final
int
hi
,
final
long
address
)
{
for
(
int
i
=
lo
;
i
<
hi
;
i
++)
{
Unsafe
.
getUnsafe
().
putByte
(
address
+
i
-
lo
,
(
byte
)
value
.
charAt
(
i
));
}
}
public
Path
$
()
{
if
(
1
+
(
wptr
-
ptr
)
>=
capacity
)
{
extend
((
int
)
(
16
+
(
wptr
-
ptr
)));
...
...
@@ -145,7 +151,7 @@ public class Path extends AbstractCharSink implements Closeable, LPSZ {
if
(
l
+
len
>=
capacity
)
{
extend
(
l
+
len
);
}
Chars
.
strcpy
(
cs
,
start
,
end
,
wptr
);
strcpy
(
cs
,
start
,
end
,
wptr
);
wptr
+=
l
;
len
+=
l
;
return
this
;
...
...
core/src/main/java/io/questdb/std/time/DateFormatCompiler.java
浏览文件 @
13ece895
...
...
@@ -197,7 +197,7 @@ public class DateFormatCompiler {
int
op
=
opMap
.
get
(
cs
);
if
(
op
==
-
1
)
{
makeLastOpGreedy
(
ops
);
delimiters
.
add
(
cs
.
toString
(
));
delimiters
.
add
(
Chars
.
toString
(
cs
));
ops
.
add
(-(
delimiters
.
size
()));
}
else
{
if
(
op
==
OP_AM_PM
)
{
...
...
core/src/main/java/io/questdb/std/time/Dates.java
浏览文件 @
13ece895
...
...
@@ -25,6 +25,7 @@
package
io.questdb.std.time
;
import
io.questdb.std.Chars
;
import
io.questdb.std.Misc
;
import
io.questdb.std.Numbers
;
import
io.questdb.std.NumericException
;
import
io.questdb.std.str.StringSink
;
...
...
@@ -556,7 +557,7 @@ final public class Dates {
}
public
static
String
toString
(
long
millis
)
{
StringSink
sink
=
new
StringSink
();
StringSink
sink
=
Misc
.
getThreadLocalBuilder
();
DateFormatUtils
.
appendDateTime
(
sink
,
millis
);
return
sink
.
toString
();
}
...
...
core/src/test/java/io/questdb/cairo/TableModel.java
浏览文件 @
13ece895
...
...
@@ -67,7 +67,7 @@ public class TableModel implements TableStructure, Closeable {
}
public
TableModel
col
(
CharSequence
name
,
int
type
)
{
columnNames
.
add
(
Chars
.
stringOf
(
name
));
columnNames
.
add
(
Chars
.
toString
(
name
));
// set default symbol capacity
columnBits
.
add
((
128L
<<
32
)
|
type
);
columnBits
.
add
(
COLUMN_FLAG_CACHED
);
...
...
core/src/test/java/io/questdb/cairo/pool/ReaderPoolTest.java
浏览文件 @
13ece895
...
...
@@ -836,7 +836,7 @@ public class ReaderPoolTest extends AbstractCairoTest {
@Override
public
void
onEvent
(
byte
factoryType
,
long
thread
,
CharSequence
name
,
short
event
,
short
segment
,
short
position
)
{
names
.
add
(
name
==
null
?
""
:
Chars
.
stringOf
(
name
));
names
.
add
(
name
==
null
?
""
:
Chars
.
toString
(
name
));
events
.
add
(
event
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录