folders) {
30 | super.init(folders);
31 |
32 | currentIndex = 0;
33 | }
34 |
35 | @Override
36 | public int nextFolderIndex() {
37 | int index = currentIndex;
38 | updateIndex();
39 |
40 | return index;
41 | }
42 |
43 | private void updateIndex() {
44 | currentIndex++;
45 | if (currentIndex >= folders.size()) {
46 | currentIndex = 0;
47 | }
48 | }
49 | }
50 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/engine/bufferwrite/Action.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.engine.bufferwrite;
21 |
22 | /**
23 | * Action interface.
24 | */
25 |
26 | @FunctionalInterface
27 | public interface Action {
28 |
29 | void act() throws Exception;
30 | }
31 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/FileNodeProcessorStatus.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.engine.filenode;
21 |
22 | public enum FileNodeProcessorStatus {
23 | NONE, MERGING_WRITE, WAITING
24 | }
25 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/Main.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.engine.filenode;
21 |
22 | /**
23 | * Created by liukun on 2019/1/9.
24 | */
25 | public class Main {
26 |
27 | }
28 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/engine/filenode/OverflowChangeType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.engine.filenode;
21 |
22 | /**
23 | * if a file is not changed by overflow, it's in NO_CHANGE;
24 | * if it's changed and in NO_CHANGE previously, NO_CHANGE-->CHANGED, update file
25 | * If it's changed and in CHANGED previously, and in merging, CHANGED-->MERGING_CHANGE, update file
26 | * If it's changed and in CHANGED previously, and not in merging, do nothing
27 | * After merging, if it's MERGING_CHANGE, MERGING_CHANGE-->CHANGED, otherwise in NO_CHANGE, MERGING_CHANGE-->NO_CHANGE
28 | *
29 | * @author kangrong
30 | *
31 | */
32 | public enum OverflowChangeType {
33 | NO_CHANGE, CHANGED, MERGING_CHANGE,
34 | }
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/engine/memcontrol/Policy.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.engine.memcontrol;
21 |
22 | /**
23 | * This class defines what act will be taken if memory reaches a certain threshold.
24 | */
25 | public interface Policy {
26 |
27 | void execute();
28 | }
29 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/engine/memtable/IWritableMemChunk.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.engine.memtable;
21 |
22 | import org.apache.iotdb.tsfile.utils.Binary;
23 |
24 | public interface IWritableMemChunk extends TimeValuePairSorter {
25 |
26 | void putLong(long t, long v);
27 |
28 | void putInt(long t, int v);
29 |
30 | void putFloat(long t, float v);
31 |
32 | void putDouble(long t, double v);
33 |
34 | void putBinary(long t, Binary v);
35 |
36 | void putBoolean(long t, boolean v);
37 |
38 | void write(long insertTime, String insertValue);
39 |
40 | void reset();
41 |
42 | int count();
43 | }
44 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/engine/memtable/PrimitiveMemTable.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.engine.memtable;
21 |
22 | import org.apache.iotdb.tsfile.file.metadata.enums.TSDataType;
23 |
24 | public class PrimitiveMemTable extends AbstractMemTable {
25 |
26 | @Override
27 | protected IWritableMemChunk genMemSeries(TSDataType dataType) {
28 | return new WritableMemChunk(dataType);
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/utils/MergeStatus.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.engine.overflow.utils;
21 |
22 | /**
23 | * Used for IntervalTreeOperation.queryMemory() and IntervalTreeOperation.queryFileBlock().
24 | *
25 | * DONE means that a time pair is not used or this time pair has been merged into a new
26 | * DynamicOneColumn MERGING means that a time pair is merging into a new DynamicOneColumn
27 | */
28 | public enum MergeStatus {
29 | DONE, MERGING
30 | }
31 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/engine/overflow/utils/OverflowOpType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.engine.overflow.utils;
21 |
22 | /**
23 | * Include three types: INSERT,UPDATE,DELETE; INSERT is an operation which inserts a time point.
24 | * UPDATE is an operation which updates a time range.
DELETE is an operation which deletes a
25 | * time range. Note that DELETE operation could only delete a time which is less than given time T.
26 | *
27 | */
28 | public enum OverflowOpType {
29 | INSERT, UPDATE, DELETE
30 | }
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/engine/querycontext/MergeSeriesDataSource.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.engine.querycontext;
21 |
22 | public class MergeSeriesDataSource {
23 |
24 | private OverflowInsertFile insertFile;
25 |
26 | public MergeSeriesDataSource(OverflowInsertFile insertFile) {
27 | this.insertFile = insertFile;
28 | }
29 |
30 | public OverflowInsertFile getInsertFile() {
31 | return insertFile;
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/ArgsErrorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | public class ArgsErrorException extends Exception {
23 |
24 | private static final long serialVersionUID = -3614543017182165265L;
25 |
26 | public ArgsErrorException(String msg) {
27 | super(msg);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/BufferWriteProcessorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | public class BufferWriteProcessorException extends ProcessorException {
23 |
24 | private static final long serialVersionUID = 6817880163296469038L;
25 |
26 | public BufferWriteProcessorException() {
27 | super();
28 | }
29 |
30 | public BufferWriteProcessorException(Exception pathExcp) {
31 | super(pathExcp.getMessage());
32 | }
33 |
34 | public BufferWriteProcessorException(String msg) {
35 | super(msg);
36 | }
37 |
38 | public BufferWriteProcessorException(Throwable throwable) {
39 | super(throwable.getMessage());
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/ErrorDebugException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | /**
23 | * ErrorDebugException.
24 | *
25 | * @author kangrong
26 | */
27 | public class ErrorDebugException extends RuntimeException {
28 |
29 | private static final long serialVersionUID = -1123099620556170447L;
30 |
31 | public ErrorDebugException(String msg) {
32 | super(msg);
33 | }
34 |
35 | public ErrorDebugException(Exception e) {
36 | super(e);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/FileNodeManagerException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | public class FileNodeManagerException extends Exception {
23 |
24 | private static final long serialVersionUID = 9001649171768311032L;
25 |
26 | public FileNodeManagerException() {
27 | super();
28 | }
29 |
30 | public FileNodeManagerException(String message) {
31 | super(message);
32 | }
33 |
34 | public FileNodeManagerException(Throwable cause) {
35 | super(cause);
36 | }
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/FileNodeNotExistException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | /**
23 | * Throw this exception when the file node processor is not exists.
24 | *
25 | * @author kangrong
26 | */
27 | public class FileNodeNotExistException extends RuntimeException {
28 |
29 | private static final long serialVersionUID = -4334041411884083545L;
30 |
31 | public FileNodeNotExistException(String msg) {
32 | super(msg);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/FileNodeProcessorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | public class FileNodeProcessorException extends ProcessorException {
23 |
24 | private static final long serialVersionUID = 7373978140952977661L;
25 |
26 | public FileNodeProcessorException() {
27 | super();
28 | }
29 |
30 | public FileNodeProcessorException(PathErrorException pathExcp) {
31 | super(pathExcp.getMessage());
32 | }
33 |
34 | public FileNodeProcessorException(String msg) {
35 | super(msg);
36 | }
37 |
38 | public FileNodeProcessorException(Throwable throwable) {
39 | super(throwable.getMessage());
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/MetadataArgsErrorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | /**
23 | * If query metadata constructs schema but passes illegal parameters to EncodingConvertor or
24 | * DataTypeConvertor,this exception will be threw.
25 | *
26 | * @author kangrong
27 | */
28 | public class MetadataArgsErrorException extends ArgsErrorException {
29 |
30 | private static final long serialVersionUID = 3415275599091623570L;
31 |
32 | public MetadataArgsErrorException(String msg) {
33 | super(msg);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/NotConsistentException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | public class NotConsistentException extends Exception {
23 |
24 | private static final long serialVersionUID = 5176858298038267828L;
25 |
26 | public NotConsistentException(String msg) {
27 | super(msg);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/OverflowProcessorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | public class OverflowProcessorException extends ProcessorException {
23 |
24 | private static final long serialVersionUID = -2784502746101925819L;
25 |
26 | public OverflowProcessorException() {
27 | super();
28 | }
29 |
30 | public OverflowProcessorException(PathErrorException pathExcp) {
31 |
32 | }
33 |
34 | public OverflowProcessorException(String msg) {
35 | super(msg);
36 | }
37 |
38 | public OverflowProcessorException(Throwable throwable) {
39 | super(throwable.getMessage());
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/PathErrorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | import org.apache.iotdb.db.exception.qp.QueryProcessorException;
23 |
24 | public class PathErrorException extends QueryProcessorException {
25 |
26 | private static final long serialVersionUID = 2141197032898163234L;
27 |
28 | public PathErrorException(String msg) {
29 | super(msg);
30 | }
31 |
32 | public PathErrorException(Throwable e) {
33 | super(e);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/ProcessorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | /**
23 | * Processor Exception, the top-level exception in IoTDB.
24 | */
25 | public class ProcessorException extends Exception {
26 |
27 | private static final long serialVersionUID = 4137638418544201605L;
28 |
29 | public ProcessorException(String msg) {
30 | super(msg);
31 | }
32 |
33 | public ProcessorException(Throwable e) {
34 | super(e);
35 | }
36 |
37 | public ProcessorException(Exception e) {
38 | super(e);
39 | }
40 |
41 | public ProcessorException() {
42 | super();
43 | }
44 | }
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/ProcessorRuntimException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | /**
23 | * @author liukun
24 | *
25 | */
26 | public class ProcessorRuntimException extends RuntimeException {
27 |
28 | private static final long serialVersionUID = -5543549255867713835L;
29 |
30 | public ProcessorRuntimException() {
31 | super();
32 | }
33 |
34 | public ProcessorRuntimException(String message) {
35 | super(message);
36 | }
37 |
38 | public ProcessorRuntimException(Throwable cause) {
39 | super(cause);
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/RecoverException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | public class RecoverException extends Exception {
23 |
24 | private static final long serialVersionUID = 3591716406230730147L;
25 |
26 | public RecoverException(String message) {
27 | super(message);
28 | }
29 |
30 | public RecoverException(String message, Throwable cause) {
31 | super(message, cause);
32 | }
33 |
34 | public RecoverException(Throwable e) {
35 | super(e);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/StartupException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | public class StartupException extends Exception {
23 |
24 | private static final long serialVersionUID = -8591716406230730147L;
25 |
26 | public StartupException(String msg) {
27 | super(msg);
28 | }
29 |
30 | public StartupException(String msg, Throwable cause) {
31 | super(msg, cause);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/UnSupportedFillTypeException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | public class UnSupportedFillTypeException extends DeltaEngineRunningException {
23 |
24 | public UnSupportedFillTypeException(String message, Throwable cause) {
25 | super(message, cause);
26 | }
27 |
28 | public UnSupportedFillTypeException(String message) {
29 | super(message);
30 | }
31 |
32 | public UnSupportedFillTypeException(Throwable cause) {
33 | super(cause);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/WALOverSizedException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception;
21 |
22 | import java.io.IOException;
23 |
24 | public class WALOverSizedException extends IOException {
25 |
26 | private static final long serialVersionUID = -3145068900134508628L;
27 |
28 | public WALOverSizedException() {
29 | super();
30 | }
31 |
32 | public WALOverSizedException(String message) {
33 | super(message);
34 | }
35 |
36 | public WALOverSizedException(Throwable cause) {
37 | super(cause);
38 | }
39 | }
40 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/codebased/AuthPluginException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.codebased;
21 |
22 | import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
23 |
24 | public class AuthPluginException extends IoTDBException {
25 |
26 | public AuthPluginException() {
27 | super(ExceptionBuilder.AUTH_PLUGIN_ERR);
28 | }
29 |
30 | public AuthPluginException(String userName, String additionalInfo) {
31 | super(ExceptionBuilder.AUTH_PLUGIN_ERR, additionalInfo);
32 | defaultInfo = String.format(defaultInfo, userName);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/codebased/ConnectionFailedException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.codebased;
21 |
22 | import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
23 |
24 | public class ConnectionFailedException extends IoTDBException {
25 |
26 | public ConnectionFailedException() {
27 | super(ExceptionBuilder.CON_FAIL_ERR);
28 | }
29 |
30 | public ConnectionFailedException(String additionalInfo) {
31 | super(ExceptionBuilder.CON_FAIL_ERR, additionalInfo);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/codebased/ConnectionHostException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.codebased;
21 |
22 | import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
23 |
24 | public class ConnectionHostException extends IoTDBException {
25 |
26 | public ConnectionHostException() {
27 | super(ExceptionBuilder.CONN_HOST_ERROR);
28 | }
29 |
30 | public ConnectionHostException(String ip, String port, String additionalInfo) {
31 | super(ExceptionBuilder.CONN_HOST_ERROR, additionalInfo);
32 | defaultInfo = String.format(defaultInfo, ip, port);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/codebased/InsecureAPIException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.codebased;
21 |
22 | import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
23 |
24 | public class InsecureAPIException extends IoTDBException {
25 |
26 | public InsecureAPIException() {
27 | super(ExceptionBuilder.INSECURE_API_ERR);
28 | }
29 |
30 | public InsecureAPIException(String functionName, String additionalInfo) {
31 | super(ExceptionBuilder.INSECURE_API_ERR, additionalInfo);
32 | defaultInfo = String.format(defaultInfo, functionName);
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/codebased/InvalidParameterException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.codebased;
21 |
22 | import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
23 |
24 | public class InvalidParameterException extends IoTDBException {
25 |
26 | public InvalidParameterException() {
27 | super(ExceptionBuilder.INVALID_PARAMETER_NO);
28 | }
29 |
30 | public InvalidParameterException(String additionalInfo) {
31 | super(ExceptionBuilder.INVALID_PARAMETER_NO, additionalInfo);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/codebased/NoParameterException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.codebased;
21 |
22 | import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
23 |
24 | public class NoParameterException extends IoTDBException {
25 |
26 | public NoParameterException() {
27 | super(ExceptionBuilder.NO_PARAMETERS_EXISTS);
28 | }
29 |
30 | public NoParameterException(String additionalInfo) {
31 | super(ExceptionBuilder.NO_PARAMETERS_EXISTS, additionalInfo);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/codebased/NoPreparedStatementException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.codebased;
21 |
22 | import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
23 |
24 | public class NoPreparedStatementException extends IoTDBException {
25 |
26 | public NoPreparedStatementException() {
27 | super(ExceptionBuilder.NO_PREPARE_STMT);
28 | }
29 |
30 | public NoPreparedStatementException(String additionalInfo) {
31 | super(ExceptionBuilder.NO_PREPARE_STMT, additionalInfo);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/codebased/OutOfMemoryException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.codebased;
21 |
22 | import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
23 |
24 | public class OutOfMemoryException extends IoTDBException {
25 |
26 | public OutOfMemoryException() {
27 | super(ExceptionBuilder.OUT_OF_MEMORY);
28 | }
29 |
30 | public OutOfMemoryException(String additionalInfo) {
31 | super(ExceptionBuilder.OUT_OF_MEMORY, additionalInfo);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/codebased/UnknownException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.codebased;
21 |
22 | import org.apache.iotdb.db.exception.builder.ExceptionBuilder;
23 |
24 | public class UnknownException extends IoTDBException {
25 |
26 | public UnknownException() {
27 | super(ExceptionBuilder.UNKNOWN_ERROR);
28 | }
29 |
30 | public UnknownException(String additionalInfo) {
31 | super(ExceptionBuilder.UNKNOWN_ERROR, additionalInfo);
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/qp/GeneratePhysicalPlanException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.qp;
21 |
22 | import org.apache.iotdb.db.qp.logical.crud.UpdateOperator;
23 |
24 | /**
25 | * This exception is threw when meeting error in {@linkplain UpdateOperator UpdateOperator}.
26 | */
27 | public class GeneratePhysicalPlanException extends QueryProcessorException {
28 |
29 | private static final long serialVersionUID = -797390809639488007L;
30 |
31 | public GeneratePhysicalPlanException(String msg) {
32 | super(msg);
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/qp/IllegalASTFormatException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.qp;
21 |
22 | /**
23 | * This exception is thrown while meeting error in parsing ast tree to generate logical operator.
24 | */
25 | public class IllegalASTFormatException extends QueryProcessorException {
26 |
27 | private static final long serialVersionUID = -8987915911329315588L;
28 |
29 | public IllegalASTFormatException(String msg) {
30 | super(msg);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/qp/LogicalOperatorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.qp;
21 |
22 | /**
23 | * This exception is thrown while meeting error in transforming logical operator to physical plan.
24 | */
25 | public class LogicalOperatorException extends QueryProcessorException {
26 |
27 | private static final long serialVersionUID = 7573857366601268706L;
28 |
29 | public LogicalOperatorException(String msg) {
30 | super(msg);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/qp/LogicalOptimizeException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.qp;
21 |
22 | /**
23 | * This exception is thrown while meeting error in optimizing logical operator.
24 | */
25 | public class LogicalOptimizeException extends LogicalOperatorException {
26 |
27 | private static final long serialVersionUID = -7098092782689670064L;
28 |
29 | public LogicalOptimizeException(String msg) {
30 | super(msg);
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/exception/qp/QueryProcessorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.exception.qp;
21 |
22 | /**
23 | * This exception is the basic exception of query process. It's thrown when meeting any error in
24 | * query process.
25 | */
26 | public class QueryProcessorException extends Exception {
27 |
28 | private static final long serialVersionUID = -8987915921329335088L;
29 |
30 | public QueryProcessorException(String msg) {
31 | super(msg);
32 | }
33 |
34 | public QueryProcessorException(Throwable e) {
35 | super(e);
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/metadata/MetadataConstant.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.metadata;
21 |
22 | public class MetadataConstant {
23 |
24 | public static String ROOT = "root";
25 | public static String METADATA_OBJ = "mdata.obj";
26 | public static String METADATA_LOG = "mlog.txt";
27 | public static String METADATA_TEMP = ".temp";
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/qp/exception/DateTimeFormatException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.qp.exception;
21 |
22 | import org.apache.iotdb.db.exception.qp.QueryProcessorException;
23 |
24 | public class DateTimeFormatException extends QueryProcessorException {
25 |
26 | private static final long serialVersionUID = 5901175084493972130L;
27 |
28 | public DateTimeFormatException(String msg) {
29 | super(msg);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/qp/logical/RootOperator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.qp.logical;
21 |
22 | /**
23 | * RootOperator indicates the operator that could be executed as a entire command. RootOperator
24 | * consists of SFWOperator, like INSERT/UPDATE/DELETE, and other Operators.
25 | */
26 | public abstract class RootOperator extends Operator {
27 |
28 | public RootOperator(int tokenIntType) {
29 | super(tokenIntType);
30 | }
31 |
32 | }
33 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/qp/logical/crud/DeleteOperator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.qp.logical.crud;
21 |
22 | import org.apache.iotdb.db.qp.logical.Operator;
23 |
24 | /**
25 | * this class extends {@code RootOperator} and process delete statement.
26 | */
27 | public class DeleteOperator extends SFWOperator {
28 |
29 | private long time;
30 |
31 | public DeleteOperator(int tokenIntType) {
32 | super(tokenIntType);
33 | operatorType = Operator.OperatorType.DELETE;
34 | }
35 |
36 | public long getTime() {
37 | return time;
38 | }
39 |
40 | public void setTime(long time) {
41 | this.time = time;
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/qp/logical/crud/UpdateOperator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.qp.logical.crud;
21 |
22 | /**
23 | * this class extends {@code RootOperator} and process update statement.
24 | */
25 | public final class UpdateOperator extends SFWOperator {
26 |
27 | private String value;
28 |
29 | public UpdateOperator(int tokenIntType) {
30 | super(tokenIntType);
31 | operatorType = OperatorType.UPDATE;
32 | }
33 |
34 | public String getValue() {
35 | return value;
36 | }
37 |
38 | public void setValue(String value) {
39 | this.value = value;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/qp/physical/crud/AggregationPlan.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.qp.physical.crud;
21 |
22 | import java.util.ArrayList;
23 | import java.util.List;
24 | import org.apache.iotdb.db.qp.logical.Operator;
25 |
26 | public class AggregationPlan extends QueryPlan {
27 |
28 | private List aggregations = new ArrayList<>();
29 |
30 | public AggregationPlan() {
31 | super();
32 | setOperatorType(Operator.OperatorType.AGGREGATION);
33 | }
34 |
35 | @Override
36 | public List getAggregations() {
37 | return aggregations;
38 | }
39 |
40 | public void setAggregations(List aggregations) {
41 | this.aggregations = aggregations;
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/IFilterOptimizer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.qp.strategy.optimizer;
21 |
22 | import org.apache.iotdb.db.exception.qp.QueryProcessorException;
23 | import org.apache.iotdb.db.qp.logical.crud.FilterOperator;
24 |
25 | /**
26 | * provide a filter operator, optimize it.
27 | */
28 | public interface IFilterOptimizer {
29 |
30 | FilterOperator optimize(FilterOperator filter) throws QueryProcessorException;
31 | }
32 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/qp/strategy/optimizer/ILogicalOptimizer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.qp.strategy.optimizer;
21 |
22 | import org.apache.iotdb.db.exception.qp.LogicalOptimizeException;
23 | import org.apache.iotdb.db.qp.logical.Operator;
24 |
25 | /**
26 | * provide a context, transform it for optimization.
27 | */
28 | public interface ILogicalOptimizer {
29 |
30 | Operator transform(Operator operator) throws LogicalOptimizeException;
31 | }
32 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobContext.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.query.component.job;
21 |
22 | public class QueryJobContext {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobDispatcher.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.query.component.job;
21 |
22 | import org.apache.iotdb.db.query.component.executor.QueryJobExecutor;
23 |
24 | public interface QueryJobDispatcher {
25 |
26 | QueryJobExecutor dispatch(QueryJob queryJob);
27 |
28 | }
29 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobExecutionMessage.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.query.component.job;
21 |
22 | public class QueryJobExecutionMessage {
23 |
24 | private String message;
25 |
26 | public QueryJobExecutionMessage(String message) {
27 | this.message = message;
28 | }
29 |
30 | public String getMessage() {
31 | return message;
32 | }
33 |
34 | public void setMessage(String message) {
35 | this.message = message;
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobStatus.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.query.component.job;
21 |
22 | public enum QueryJobStatus {
23 | PENDING, READY, RUNNING, FINISHED, WAITING_TO_BE_TERMINATED, TERMINATED
24 | }
25 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/query/component/job/QueryJobType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.query.component.job;
21 |
22 | public enum QueryJobType {
23 | SELECT, AGGREGATION, GROUP_BY
24 | }
25 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/query/component/resource/QueryResource.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.query.component.resource;
21 |
22 | public interface QueryResource {
23 |
24 | /**
25 | * Release represents the operations for current resource such as return, close, destroy.
26 | */
27 | void release();
28 | }
29 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/ExternalSortJobScheduler.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | // package org.apache.iotdb.db.query.externalsort;
21 | //
22 | //
23 | // public class ExternalSortJobScheduler {
24 | //
25 | // private long jobId = 0;
26 | //
27 | // private ExternalSortJobScheduler() {
28 | //
29 | // }
30 | //
31 | // public synchronized long genJobId() {
32 | // jobId++;
33 | // return jobId;
34 | // }
35 | //
36 | // private static class ExternalSortJobSchedulerHelper {
37 | // private static ExternalSortJobScheduler INSTANCE = new ExternalSortJobScheduler();
38 | // }
39 | //
40 | // public static ExternalSortJobScheduler getInstance() {
41 | // return ExternalSortJobSchedulerHelper.INSTANCE;
42 | // }
43 | // }
44 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/TimeValuePairDeserializer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.query.externalsort.serialize;
21 |
22 | import java.io.IOException;
23 | import org.apache.iotdb.db.utils.TimeValuePair;
24 |
25 | public interface TimeValuePairDeserializer {
26 |
27 | boolean hasNext() throws IOException;
28 |
29 | TimeValuePair next() throws IOException;
30 |
31 | /**
32 | * Close current deserializer.
33 | */
34 | void close() throws IOException;
35 | }
36 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/query/externalsort/serialize/TimeValuePairSerializer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.query.externalsort.serialize;
21 |
22 | import java.io.IOException;
23 | import org.apache.iotdb.db.utils.TimeValuePair;
24 |
25 | public interface TimeValuePairSerializer {
26 |
27 | void write(TimeValuePair timeValuePair) throws IOException;
28 |
29 | void close() throws IOException;
30 | }
31 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/query/reader/merge/EngineReaderByTimeStamp.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.query.reader.merge;
21 |
22 | import java.io.IOException;
23 | import org.apache.iotdb.db.query.reader.IReader;
24 | import org.apache.iotdb.db.utils.TsPrimitiveType;
25 |
26 | public interface EngineReaderByTimeStamp extends IReader {
27 |
28 | /**
29 | * Given a timestamp, the reader is supposed to return the corresponding value in the timestamp.
30 | * If no value in this timestamp, null will be returned.
31 | */
32 | TsPrimitiveType getValueInTimestamp(long timestamp) throws IOException;
33 | }
34 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/service/IService.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.service;
21 |
22 | import org.apache.iotdb.db.exception.StartupException;
23 |
24 | public interface IService {
25 |
26 | /**
27 | * Start current service.
28 | */
29 | void start() throws StartupException;
30 |
31 | /**
32 | * Stop current service. If current service uses thread or thread pool,
33 | * current service should guarantee to release thread or thread pool.
34 | */
35 | void stop();
36 |
37 | /**
38 | * Get the name of the the service.
39 | * @return current service name
40 | */
41 | ServiceType getID();
42 | }
43 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/service/IoTDBMBean.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.service;
21 |
22 | import java.io.IOException;
23 | import org.apache.iotdb.db.exception.FileNodeManagerException;
24 |
25 | public interface IoTDBMBean {
26 |
27 | void stop() throws FileNodeManagerException, IOException;
28 | }
29 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/service/JDBCServiceMBean.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.service;
21 |
22 | import org.apache.iotdb.db.exception.StartupException;
23 |
24 | public interface JDBCServiceMBean {
25 |
26 | String getJDBCServiceStatus();
27 |
28 | int getRPCPort();
29 |
30 | void startService() throws StartupException;
31 |
32 | void restartService() throws StartupException;
33 |
34 | void stopService();
35 | }
36 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/service/StartupCheck.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.service;
21 |
22 | import org.apache.iotdb.db.exception.StartupException;
23 |
24 | public interface StartupCheck {
25 |
26 | /**
27 | * Run some tests to check whether system is safe to be started.
28 | */
29 | void execute() throws StartupException;
30 | }
31 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/sql/ParseGenerator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.sql;
21 |
22 | import org.apache.iotdb.db.sql.parse.AstNode;
23 | import org.apache.iotdb.db.sql.parse.ParseDriver;
24 | import org.apache.iotdb.db.sql.parse.ParseException;
25 |
26 | /**
27 | * ParseContextGenerator is a class that offers methods to generate AstNode Tree
28 | *
29 | */
30 | public final class ParseGenerator {
31 |
32 | /**
33 | * Parse the input {@link String} command and generate an AstNode Tree.
34 | */
35 | public static AstNode generateAST(String command) throws ParseException {
36 | ParseDriver pd = new ParseDriver();
37 | return pd.parse(command);
38 | }
39 |
40 | }
41 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/sql/parse/Node.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.sql.parse;
21 |
22 | import java.util.List;
23 |
24 | /**
25 | * This interface defines the functions needed by the walkers and dispatchers. These are implemented by the node of the
26 | * graph that needs to be walked.
27 | */
28 | public interface Node {
29 |
30 | /**
31 | * Gets the vector of children nodes. This is used in the graph walker algorithms.
32 | *
33 | * @return List extends Node>
34 | */
35 | List extends Node> getChildren();
36 |
37 | /**
38 | * Gets the name of the node. This is used in the rule dispatchers.
39 | *
40 | * @return String
41 | */
42 | String getName();
43 | }
44 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/writelog/LogPosition.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.writelog;
21 |
22 | public class LogPosition {
23 |
24 | public String logPath;
25 | public long startPos;
26 | public long endPos;
27 | }
28 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogReader.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.writelog.io;
21 |
22 | import java.io.File;
23 | import java.io.FileNotFoundException;
24 | import java.util.Iterator;
25 | import org.apache.iotdb.db.qp.physical.PhysicalPlan;
26 |
27 | public interface ILogReader extends Iterator {
28 |
29 | void open(File file) throws FileNotFoundException;
30 |
31 | void close();
32 | }
33 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/writelog/io/ILogWriter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.writelog.io;
21 |
22 | import java.io.IOException;
23 | import java.util.List;
24 |
25 | public interface ILogWriter {
26 |
27 | void write(List logCache) throws IOException;
28 |
29 | void close() throws IOException;
30 | }
31 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/writelog/recover/RecoverPerformer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.writelog.recover;
21 |
22 | import org.apache.iotdb.db.exception.RecoverException;
23 |
24 | public interface RecoverPerformer {
25 |
26 | /**
27 | * Start the recovery process of the module to which this object belongs.
28 | *
29 | * @throws RecoverException -recover exception
30 | */
31 | void recover() throws RecoverException;
32 | }
33 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/writelog/replay/LogReplayer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.writelog.replay;
21 |
22 | import org.apache.iotdb.db.exception.ProcessorException;
23 | import org.apache.iotdb.db.qp.physical.PhysicalPlan;
24 |
25 | public interface LogReplayer {
26 |
27 | void replay(PhysicalPlan plan) throws ProcessorException;
28 | }
29 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/Codec.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.writelog.transfer;
21 |
22 | import java.io.IOException;
23 | import org.apache.iotdb.db.qp.physical.PhysicalPlan;
24 |
25 | interface Codec {
26 |
27 | byte[] encode(T t);
28 |
29 | T decode(byte[] bytes) throws IOException;
30 | }
31 |
--------------------------------------------------------------------------------
/iotdb/src/main/java/org/apache/iotdb/db/writelog/transfer/SystemLogOperator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.writelog.transfer;
21 |
22 | /**
23 | * To avoid conflict with org.apache.iotdb.tsfiledb.qp.constant.SQLConstant.Operator.
24 | */
25 | public class SystemLogOperator {
26 |
27 | public static final int INSERT = 0;
28 | public static final int UPDATE = 1;
29 | public static final int DELETE = 2;
30 | public static final int OVERFLOWFLUSHSTART = 3;
31 | public static final int OVERFLOWFLUSHEND = 4;
32 | public static final int BUFFERFLUSHSTART = 5;
33 | public static final int BUFFERFLUSHEND = 6;
34 | }
35 |
--------------------------------------------------------------------------------
/iotdb/src/test/java/org/apache/iotdb/db/query/control/OpenedFilePathsManagerTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.query.control;
21 |
22 | public class OpenedFilePathsManagerTest {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/iotdb/src/test/java/org/apache/iotdb/db/query/control/QueryTokenManagerTest.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.db.query.control;
21 |
22 | import org.junit.Test;
23 |
24 | public class QueryTokenManagerTest {
25 |
26 | @Test
27 | public void test() {
28 |
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/iotdb/src/test/resources/start-postBackTest.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | if [ -z "${IOTDB_HOME}" ]; then
4 | export IOTDB_HOME="$(cd "`dirname "$0"`"/..;cd ".."; cd ".."; cd "iotdb" ;pwd)"
5 | echo $IOTDB_HOME
6 | fi
7 |
8 | IOTDB_CONF=${IOTDB_HOME}/conf
9 | # IOTDB_LOGS=${IOTDB_HOME}/logs
10 |
11 | if [ -n "$JAVA_HOME" ]; then
12 | for java in "$JAVA_HOME"/bin/amd64/java "$JAVA_HOME"/bin/java; do
13 | if [ -x "$java" ]; then
14 | JAVA="$java"
15 | break
16 | fi
17 | done
18 | else
19 | JAVA=java
20 | fi
21 |
22 | if [ -z $JAVA ] ; then
23 | echo Unable to find java executable. Check JAVA_HOME and PATH environment variables. > /dev/stderr
24 | exit 1;
25 | fi
26 |
27 | CLASSPATH=""
28 | for f in ${IOTDB_HOME}/lib/*.jar; do
29 | CLASSPATH=${CLASSPATH}":"$f
30 | done
31 |
32 | MAIN_CLASS=org.apache.iotdb.db.postback.utils.CreateDataSender1
33 |
34 | "$JAVA" -DIOTDB_HOME=${IOTDB_HOME} -DTSFILE_HOME=${IOTDB_HOME} -DIOTDB_CONF=${IOTDB_CONF} -Dlogback.configurationFile=${IOTDB_CONF}/logback.xml $IOTDB_DERBY_OPTS $IOTDB_JMX_OPTS -Dname=postBackTest -cp "$CLASSPATH" "$MAIN_CLASS"
35 |
36 | exit $?
37 |
--------------------------------------------------------------------------------
/iotdb/src/test/resources/stop-postBackTest.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | PIDS=$(ps ax | grep -i 'postBackTest' | grep java | grep -v grep | awk '{print $1}')
4 |
5 | if [ -z "$PIDS" ]; then
6 | echo "No post back Client to stop"
7 | exit 1
8 | else
9 | kill -s TERM $PIDS
10 | echo "close PostBackTest"
11 | fi
12 |
--------------------------------------------------------------------------------
/jdbc/example/data/kafka_data.csv:
--------------------------------------------------------------------------------
1 | sensor1,2017/10/24 19:30:00,60 61 62
2 | sensor2,2017/10/24 19:30:00,160 161 162
3 | sensor3,2017/10/24 19:30:00,260 261 262
4 | sensor4,2017/10/24 19:30:00,360 361 362
5 | sensor1,2017/10/24 19:31:00,81 81 82
6 | sensor2,2017/10/24 19:31:00,180 181 182
7 | sensor3,2017/10/24 19:31:00,280 281 282
8 | sensor4,2017/10/24 19:31:00,380 381 382
9 | sensor1,2017/10/24 19:32:00,50 51 52
10 | sensor2,2017/10/24 19:32:00,150 151 152
11 | sensor3,2017/10/24 19:32:00,250 251 252
12 | sensor4,2017/10/24 19:32:00,350 351 352
13 | sensor1,2017/10/24 19:33:00,40 41 42
14 | sensor2,2017/10/24 19:33:00,140 141 142
15 | sensor3,2017/10/24 19:33:00,240 241 242
16 | sensor4,2017/10/24 19:33:00,340 341 342
17 | sensor1,2017/10/24 19:34:00,10 11 12
18 | sensor2,2017/10/24 19:34:00,110 111 112
19 | sensor3,2017/10/24 19:34:00,210 211 212
20 | sensor4,2017/10/24 19:34:00,310 311 312
--------------------------------------------------------------------------------
/jdbc/package.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
4 | #
5 | # Licensed to the Apache Software Foundation (ASF) under one
6 | # or more contributor license agreements. See the NOTICE file
7 | # distributed with this work for additional information
8 | # regarding copyright ownership. The ASF licenses this file
9 | # to you under the Apache License, Version 2.0 (the
10 | # "License"); you may not use this file except in compliance
11 | # with the License. You may obtain a copy of the License at
12 | #
13 | # http://www.apache.org/licenses/LICENSE-2.0
14 | #
15 | # Unless required by applicable law or agreed to in writing, software
16 | # distributed under the License is distributed on an "AS IS" BASIS,
17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | # See the License for the specific language governing permissions and
19 | # limitations under the License.
20 | #
21 |
22 | echo "Package iotdb-jdbc..."
23 | mvn clean package -Dmaven.test.skip=true
24 |
25 | if [ -d "./lib/" ]; then
26 | rm -r ./lib/
27 | fi
28 | mkdir ./lib/
29 |
30 | echo "Copy denpendency jars to ./lib"
31 | cp ./target/lib/*.jar ./lib/
32 |
33 | file_name=`find ./target -name "iotdb-jdbc-?.?.?.jar"`
34 | version=${file_name#*iotdb-jdbc-}
35 | version=${version%.jar}
36 | # copy to lib directory
37 | echo "Copy latest iotdb-jdbc-jar to ./lib. version is : $version"
38 | cp ./target/iotdb-jdbc-$version.jar ./lib/
39 |
40 | echo "Zip all jars..."
41 | # compress to a zip file
42 | cd ./lib
43 | zip iotdb-jdbc-$version.zip ./*
44 | echo "Done. see ./lib/iotdb-jdbc-$version.zip"
45 |
--------------------------------------------------------------------------------
/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBSQLException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.jdbc;
21 |
22 | import java.sql.SQLException;
23 |
24 | public class IoTDBSQLException extends SQLException {
25 |
26 | private static final long serialVersionUID = -3306001287342258977L;
27 | private String errorMessage;
28 |
29 | public IoTDBSQLException(String reason) {
30 | super(reason);
31 | }
32 |
33 | public String getErrorMessage() {
34 | return errorMessage;
35 | }
36 |
37 | public void setErrorMessage(String errorMessage) {
38 | this.errorMessage = errorMessage;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/jdbc/src/main/java/org/apache/iotdb/jdbc/IoTDBURLException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.jdbc;
21 |
22 | import java.sql.SQLException;
23 |
24 | public class IoTDBURLException extends SQLException {
25 |
26 | private static final long serialVersionUID = -5071922897222027267L;
27 |
28 | public IoTDBURLException(String reason) {
29 | super(reason);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/jdbc/src/test/java/org/apache/iotdb/jdbc/demo/MetadataDemo.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.jdbc.demo;
21 |
22 | import java.sql.SQLException;
23 |
24 | public class MetadataDemo {
25 |
26 | public static void main(String[] args) throws ClassNotFoundException, SQLException {
27 | // Class.forName(TsfileJDBCConfig.JDBC_DRIVER_NAME);
28 | // Connection connection = null;
29 | // try {
30 | // connection = DriverManager.getConnection("jdbc:iotdb://127.0.0.1:6667/", "root", "root");
31 | // DatabaseMetaData databaseMetaData = connection.getMetaData();
32 | // } finally {
33 | // connection.close();
34 | // }
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/licenses-binary/The 2-Clause BSD License:
--------------------------------------------------------------------------------
1 | The 2-Clause BSD License
2 | SPDX short identifier: BSD-2-Clause
3 |
4 | Note: This license has also been called the "Simplified BSD License" and the "FreeBSD License". See also the 3-clause BSD License.
5 |
6 | Copyright
7 |
8 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
9 |
10 | 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
11 |
12 | 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
13 |
14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
/licenses-binary/The JSON License:
--------------------------------------------------------------------------------
1 | The JSON License
2 |
3 | Copyright (c) 2002 JSON.org
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | The Software shall be used for Good, not Evil.
10 |
11 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/licenses-binary/The MIT License:
--------------------------------------------------------------------------------
1 | The MIT License
2 | SPDX short identifier: MIT
3 |
4 | Copyright
5 |
6 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
7 |
8 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 |
10 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/spark/src/main/java/org/apache/iotdb/tsfile/qp/common/Operator.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.qp.common;
21 |
22 | /**
23 | * This class is a superclass of all operator.
24 | *
25 | */
26 | public abstract class Operator {
27 |
28 | int tokenIntType;
29 | String tokenSymbol;
30 |
31 | Operator(int tokenIntType) {
32 | this.tokenIntType = tokenIntType;
33 | this.tokenSymbol = SQLConstant.tokenSymbol.get(tokenIntType);
34 | }
35 |
36 | public int getTokenIntType() {
37 | return tokenIntType;
38 | }
39 |
40 | public String getTokenSymbol() {
41 | return tokenSymbol;
42 | }
43 |
44 | @Override
45 | public String toString() {
46 | return tokenSymbol;
47 | }
48 | }
49 |
--------------------------------------------------------------------------------
/spark/src/main/java/org/apache/iotdb/tsfile/qp/exception/BasicOperatorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.qp.exception;
21 |
22 |
23 | /**
24 | * This exception is threw whiling meeting error in BasicOperator
25 | *
26 | */
27 | public class BasicOperatorException extends QueryProcessorException {
28 |
29 | private static final long serialVersionUID = -2163809754074237707L;
30 |
31 | public BasicOperatorException(String msg) {
32 | super(msg);
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/spark/src/main/java/org/apache/iotdb/tsfile/qp/exception/DNFOptimizeException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.qp.exception;
21 |
22 |
23 | /**
24 | * This exception is threw whiling meeting error in
25 | *
26 | */
27 | public class DNFOptimizeException extends LogicalOptimizeException {
28 |
29 | private static final long serialVersionUID = 807384397361662482L;
30 |
31 | public DNFOptimizeException(String msg) {
32 | super(msg);
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/spark/src/main/java/org/apache/iotdb/tsfile/qp/exception/LogicalOptimizeException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.qp.exception;
21 |
22 | /**
23 | * This exception is threw whiling meeting error in logical optimizer process
24 | *
25 | */
26 | public class LogicalOptimizeException extends QueryProcessorException {
27 |
28 | private static final long serialVersionUID = -7098092782689670064L;
29 |
30 | public LogicalOptimizeException(String msg) {
31 | super(msg);
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/spark/src/main/java/org/apache/iotdb/tsfile/qp/exception/MergeFilterException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.qp.exception;
21 |
22 |
23 | public class MergeFilterException extends LogicalOptimizeException {
24 |
25 | private static final long serialVersionUID = 8581594261924961899L;
26 |
27 | public MergeFilterException(String msg) {
28 | super(msg);
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/spark/src/main/java/org/apache/iotdb/tsfile/qp/exception/QueryOperatorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.qp.exception;
21 |
22 | public class QueryOperatorException extends LogicalOptimizeException {
23 |
24 | private static final long serialVersionUID = 8581594261924961899L;
25 |
26 | public QueryOperatorException(String msg) {
27 | super(msg);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/spark/src/main/java/org/apache/iotdb/tsfile/qp/exception/QueryProcessorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.qp.exception;
21 |
22 | /**
23 | * This exception is threw whiling meeting error in query processor
24 | *
25 | */
26 | public class QueryProcessorException extends Exception {
27 |
28 | private static final long serialVersionUID = -8987915921329335088L;
29 |
30 | private String errMsg;
31 |
32 | QueryProcessorException(String msg) {
33 | super(msg);
34 | this.errMsg = msg;
35 | }
36 |
37 | @Override
38 | public String getMessage() {
39 | return errMsg;
40 | }
41 |
42 | }
43 |
--------------------------------------------------------------------------------
/spark/src/main/java/org/apache/iotdb/tsfile/qp/exception/RemoveNotException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.qp.exception;
21 |
22 |
23 | /**
24 | * This exception is threw whiling meeting error in
25 | *
26 | */
27 | public class RemoveNotException extends LogicalOptimizeException {
28 |
29 | private static final long serialVersionUID = -772591029262375715L;
30 |
31 | public RemoveNotException(String msg) {
32 | super(msg);
33 | }
34 |
35 | }
36 |
--------------------------------------------------------------------------------
/spark/src/main/java/org/apache/iotdb/tsfile/qp/optimizer/IFilterOptimizer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.qp.optimizer;
21 |
22 | import org.apache.iotdb.tsfile.qp.common.FilterOperator;
23 | import org.apache.iotdb.tsfile.qp.exception.DNFOptimizeException;
24 | import org.apache.iotdb.tsfile.qp.exception.MergeFilterException;
25 | import org.apache.iotdb.tsfile.qp.exception.RemoveNotException;
26 |
27 | /**
28 | * provide a filter operator, optimize it.
29 | *
30 | */
31 | public interface IFilterOptimizer {
32 |
33 | FilterOperator optimize(FilterOperator filter)
34 | throws RemoveNotException, DNFOptimizeException, MergeFilterException;
35 | }
36 |
--------------------------------------------------------------------------------
/spark/src/test/resources/test.tsfile:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thulab/iotdb/93727d8e3478ae387ed8ffe60f78a1c2e4a67694/spark/src/test/resources/test.tsfile
--------------------------------------------------------------------------------
/tsfile/example/readme.md:
--------------------------------------------------------------------------------
1 | # Function
2 | ```
3 | The example is to show how to write and read a TsFile File.
4 | ```
5 | # Usage
6 | ## Dependencies with Maven
7 |
8 | ```
9 |
10 |
11 | org.apache.iotdb
12 | tsfile
13 | 0.7.0
14 |
15 |
16 | ```
17 |
18 | ## Run TsFileWrite1.java
19 |
20 | ```
21 | The class is to show how to write Tsfile by using json schema,it use the first interface:
22 | public TsFileWriter(File file) throws WriteProcessException, IOException
23 | ```
24 |
25 | ## Run TsFileWrite2.java
26 |
27 | ```
28 | The class is to show how to write Tsfile directly,it use the second interface:
29 | public void addMeasurement(MeasurementSchema measurementSchema) throws WriteProcessException
30 | ```
31 |
32 | ### Notice
33 | Class TsFileWrite1 and class TsFileWrite2 are two ways to construct a TsFile instance,they generate the same TsFile file.
34 |
35 | ## Run TsFileRead.java
36 |
37 | ```
38 | The class is to show how to read TsFile file named "test.tsfile".
39 | The TsFile file "test.tsfile" is generated from class TsFileWrite1 or class TsFileWrite2, they generate the same TsFile file by two different ways
40 | ```
41 |
42 | ### Notice
43 | For detail, please refer to https://github.com/thulab/tsfile/wiki/Get-Started.
44 |
--------------------------------------------------------------------------------
/tsfile/package.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 | #
3 | # Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
4 | #
5 | # Licensed to the Apache Software Foundation (ASF) under one
6 | # or more contributor license agreements. See the NOTICE file
7 | # distributed with this work for additional information
8 | # regarding copyright ownership. The ASF licenses this file
9 | # to you under the Apache License, Version 2.0 (the
10 | # "License"); you may not use this file except in compliance
11 | # with the License. You may obtain a copy of the License at
12 | #
13 | # http://www.apache.org/licenses/LICENSE-2.0
14 | #
15 | # Unless required by applicable law or agreed to in writing, software
16 | # distributed under the License is distributed on an "AS IS" BASIS,
17 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | # See the License for the specific language governing permissions and
19 | # limitations under the License.
20 | #
21 |
22 | echo "Package tsfile..."
23 | mvn clean package -Dmaven.test.skip=true
24 |
25 | if [ -d "./lib/" ]; then
26 | rm -r ./lib/
27 | fi
28 | mkdir ./lib/
29 |
30 | echo "Copy denpendency jars to ./lib"
31 | cp ./target/lib/*.jar ./lib/
32 |
33 | file_name=`find ./target -name "tsfile-?.?.?.jar"`
34 | version=${file_name#*tsfile-}
35 | version=${version%.jar}
36 | # copy to lib directory
37 | echo "Copy latest tsfile-jar to ./lib. version is : $version"
38 | cp ./target/tsfile-$version.jar ./lib/
39 |
40 | echo "Zip all jars..."
41 | # compress to a zip file
42 | cd ./lib
43 | zip tsfile-$version.zip ./*
44 | echo "Done. see ./lib/tsfile-$version.zip"
45 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/common/cache/Cache.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.common.cache;
21 |
22 | import java.io.IOException;
23 | import org.apache.iotdb.tsfile.exception.cache.CacheException;
24 |
25 | public interface Cache {
26 |
27 | T get(K key) throws CacheException, IOException;
28 |
29 | void clear();
30 | }
31 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/common/constant/QueryConstant.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.common.constant;
21 |
22 | public class QueryConstant {
23 |
24 | // The start offset for the partition
25 | public static final String PARTITION_START_OFFSET = "partition_start_offset";
26 | // The end offset for the partition
27 | public static final String PARTITION_END_OFFSET = "partition_end_offset";
28 | }
29 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/common/constant/SystemConstant.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.common.constant;
21 |
22 | public class SystemConstant {
23 |
24 | public static final String TSFILE_HOME = "TSFILE_HOME";
25 | public static final String TSFILE_CONF = "TSFILE_CONF";
26 | public static final String PATH_SEPARATOR = ".";
27 | public static final String PATH_SEPARATER_NO_REGEX = "\\.";
28 | public static final String DEFAULT_DELTA_TYPE = "default_delta_type";
29 | }
30 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/common/EncodingConfig.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.encoding.common;
21 |
22 | /**
23 | * This class defines several constants using in encoding algorithm.
24 | *
25 | * @author xuyi
26 | */
27 | public class EncodingConfig {
28 |
29 | /**
30 | * if number n repeats more than(>=) RLE_MAX_REPEATED_NUM times, use rle encoding, otherwise use
31 | * bit-packing.
32 | */
33 | public static final int RLE_MAX_REPEATED_NUM = 8;
34 |
35 | // when to start a new bit-pacing group
36 | public static final int RLE_MAX_BIT_PACKED_NUM = 63;
37 |
38 | // bit width for Bitmap Encoding
39 | public static final int BITMAP_BITWIDTH = 1;
40 | }
41 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/encoding/common/EndianType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.encoding.common;
21 |
22 | /**
23 | * In current verison, we only support LITTLE_ENDIAN mode.
24 | *
25 | * @author xuyi
26 | */
27 | public enum EndianType {
28 | BIG_ENDIAN, LITTLE_ENDIAN
29 | }
30 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/cache/CacheException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.exception.cache;
21 |
22 | public class CacheException extends Exception {
23 |
24 | public CacheException() {
25 | }
26 |
27 | public CacheException(String message) {
28 | super(message);
29 | }
30 |
31 | public CacheException(String message, Throwable cause) {
32 | super(message, cause);
33 | }
34 |
35 | public CacheException(Throwable cause) {
36 | super(cause);
37 | }
38 |
39 | public CacheException(String message, Throwable cause, boolean enableSuppression,
40 | boolean writableStackTrace) {
41 | super(message, cause, enableSuppression, writableStackTrace);
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/filter/QueryFilterOptimizationException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.exception.filter;
21 |
22 | public class QueryFilterOptimizationException extends Exception {
23 |
24 | public QueryFilterOptimizationException(String msg) {
25 | super(msg);
26 | }
27 |
28 | public QueryFilterOptimizationException(Throwable cause) {
29 | super(cause);
30 | }
31 |
32 | public QueryFilterOptimizationException(String message, Throwable cause) {
33 | super(message, cause);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/filter/UnSupportFilterDataTypeException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.exception.filter;
21 |
22 | /**
23 | * Some wrong filter parameters invoke.
24 | */
25 | public class UnSupportFilterDataTypeException extends RuntimeException {
26 |
27 | public UnSupportFilterDataTypeException(String message, Throwable cause) {
28 | super(message, cause);
29 | }
30 |
31 | public UnSupportFilterDataTypeException(String message) {
32 | super(message);
33 | }
34 |
35 | public UnSupportFilterDataTypeException(Throwable cause) {
36 | super(cause);
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/metadata/MetadataArgsErrorException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.exception.metadata;
21 |
22 | /**
23 | * If query metadata constructs schema but passes illegal parameters to EncodingConvertor or DataTypeConvertor,this
24 | * exception will be threw.
25 | *
26 | * @author kangrong
27 | */
28 | public class MetadataArgsErrorException extends Exception {
29 |
30 | private static final long serialVersionUID = 3415275599091623570L;
31 |
32 | public MetadataArgsErrorException(String msg) {
33 | super(msg);
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/write/InvalidJsonSchemaException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.exception.write;
21 |
22 | /**
23 | * This exception is thrown if the file schema in json format is invalid, for reasons like
24 | * missing necessary fields.
25 | *
26 | * @author kangrong
27 | */
28 | public class InvalidJsonSchemaException extends WriteProcessException {
29 |
30 | private static final long serialVersionUID = -4469810656988557000L;
31 |
32 | public InvalidJsonSchemaException(String msg) {
33 | super(msg);
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/write/NoMeasurementException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.exception.write;
21 |
22 | /**
23 | * This exception means it can not find the measurement while writing a TSRecord.
24 | */
25 | public class NoMeasurementException extends WriteProcessException {
26 |
27 | private static final long serialVersionUID = -5599767368831572747L;
28 |
29 | public NoMeasurementException(String msg) {
30 | super(msg);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/write/PageException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.exception.write;
21 |
22 | /**
23 | * Exception occurs when writing a page.
24 | */
25 | public class PageException extends WriteProcessException {
26 |
27 | private static final long serialVersionUID = 7385627296529388683L;
28 |
29 | public PageException(String msg) {
30 | super(msg);
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/write/UnSupportedDataTypeException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.exception.write;
21 |
22 | public class UnSupportedDataTypeException extends RuntimeException {
23 |
24 | private static final long serialVersionUID = 6399248887091915203L;
25 |
26 | public UnSupportedDataTypeException(String dataTypeName) {
27 | super("UnSupported dataType: " + dataTypeName);
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/exception/write/WriteProcessException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.exception.write;
21 |
22 | /**
23 | * This exception is threw while meeting error in writing procession.
24 | *
25 | * @author kangrong
26 | */
27 | public class WriteProcessException extends Exception {
28 |
29 | private static final long serialVersionUID = -2664638061585302767L;
30 | protected String errMsg;
31 |
32 | public WriteProcessException(String msg) {
33 | super(msg);
34 | this.errMsg = msg;
35 | }
36 |
37 | @Override
38 | public String getMessage() {
39 | return errMsg;
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/file/MetaMarker.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.file;
21 |
22 | import java.io.IOException;
23 |
24 | /**
25 | * MetaMarker denotes the type of headers and footers. Enum is not used for space saving.
26 | */
27 | public class MetaMarker {
28 |
29 | public static final byte ChunkGroupFooter = 0;
30 | public static final byte ChunkHeader = 1;
31 | public static final byte Separator = 2;
32 |
33 | public static void handleUnexpectedMarker(byte marker) throws IOException {
34 | throw new IOException("Unexpected marker " + marker);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/file/header/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.file.header;
21 |
22 | /**
23 | * ChunkGroupFooter and ChunkHeader are used for parsing file.
24 | *
25 | * ChunkGroupMetadata and ChunkMetadata are used for locating the positions of ChunkGroup (footer)
26 | * and chunk (header),filtering data quickly, and thereby they have digest information.
27 | *
28 | * However, because Page has only the header structure, therefore, PageHeader has the both two
29 | * functions.
30 | */
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/StatisticsClassException.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.file.metadata.statistics;
21 |
22 | import org.apache.iotdb.tsfile.exception.TsFileRuntimeException;
23 |
24 | public class StatisticsClassException extends TsFileRuntimeException {
25 |
26 | private static final long serialVersionUID = -5445795844780183770L;
27 |
28 | public StatisticsClassException(Class> className1, Class> className2) {
29 | super("tsfile-file Statistics classes mismatched: " + className1 + " vs. " + className2);
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/file/metadata/statistics/StatisticsDeserializer.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.file.metadata.statistics;
21 |
22 | public class StatisticsDeserializer {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/IDataReader.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read;
21 |
22 | import java.io.IOException;
23 | import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
24 | import org.apache.iotdb.tsfile.read.common.Chunk;
25 |
26 | public interface IDataReader {
27 |
28 | public Chunk readMemChunk(ChunkMetaData metaData) throws IOException;
29 | }
30 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/common/Chunk.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read.common;
21 |
22 | import java.nio.ByteBuffer;
23 | import org.apache.iotdb.tsfile.file.header.ChunkHeader;
24 |
25 | /**
26 | * used in query.
27 | */
28 | public class Chunk {
29 |
30 | private ChunkHeader chunkHeader;
31 | private ByteBuffer chunkData;
32 |
33 | public Chunk(ChunkHeader header, ByteBuffer buffer) {
34 | this.chunkHeader = header;
35 | this.chunkData = buffer;
36 | }
37 |
38 | public ChunkHeader getHeader() {
39 | return chunkHeader;
40 | }
41 |
42 | public ByteBuffer getData() {
43 | return chunkData;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/controller/ChunkLoader.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read.controller;
21 |
22 | import java.io.IOException;
23 | import org.apache.iotdb.tsfile.file.metadata.ChunkMetaData;
24 | import org.apache.iotdb.tsfile.read.common.Chunk;
25 |
26 | public interface ChunkLoader {
27 |
28 | /**
29 | * read all content of any chunk.
30 | */
31 | Chunk getChunk(ChunkMetaData chunkMetaData) throws IOException;
32 |
33 | /**
34 | * close the file reader.
35 | */
36 | void close() throws IOException;
37 |
38 | }
39 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/expression/ExpressionType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read.expression;
21 |
22 | public enum ExpressionType {
23 | AND, OR, SERIES, GLOBAL_TIME
24 | }
25 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/expression/IBinaryExpression.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read.expression;
21 |
22 | /**
23 | * @author Jinrui Zhang
24 | */
25 | public interface IBinaryExpression extends IExpression {
26 |
27 | IExpression getLeft();
28 |
29 | IExpression getRight();
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/expression/IExpression.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read.expression;
21 |
22 | public interface IExpression {
23 |
24 | ExpressionType getType();
25 | }
26 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/expression/IUnaryExpression.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read.expression;
21 |
22 | import org.apache.iotdb.tsfile.read.filter.basic.Filter;
23 |
24 | public interface IUnaryExpression extends IExpression {
25 |
26 | Filter getFilter();
27 |
28 | void setFilter(Filter filter);
29 | }
30 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/filter/factory/FilterType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read.filter.factory;
21 |
22 | public enum FilterType {
23 | VALUE_FILTER("value"), TIME_FILTER("time");
24 |
25 | private String name;
26 |
27 | FilterType(String name) {
28 | this.name = name;
29 | }
30 |
31 | @Override
32 | public String toString() {
33 | return name;
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/query/executor/QueryExecutor.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read.query.executor;
21 |
22 | import java.io.IOException;
23 | import org.apache.iotdb.tsfile.read.expression.QueryExpression;
24 | import org.apache.iotdb.tsfile.read.query.dataset.QueryDataSet;
25 |
26 | public interface QueryExecutor {
27 |
28 | QueryDataSet execute(QueryExpression queryExpression) throws IOException;
29 | }
30 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/query/timegenerator/node/Node.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read.query.timegenerator.node;
21 |
22 | import java.io.IOException;
23 |
24 | public interface Node {
25 |
26 | boolean hasNext() throws IOException;
27 |
28 | long next() throws IOException;
29 |
30 | NodeType getType();
31 | }
32 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/query/timegenerator/node/NodeType.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read.query.timegenerator.node;
21 |
22 | /**
23 | * Type of the node.
24 | *
25 | * @author Jinrui Zhang
26 | */
27 | public enum NodeType {
28 | AND, OR, LEAF
29 | }
30 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/read/reader/chunk/ChunkReaderWithoutFilter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.read.reader.chunk;
21 |
22 | import org.apache.iotdb.tsfile.file.header.PageHeader;
23 | import org.apache.iotdb.tsfile.read.common.Chunk;
24 |
25 | public class ChunkReaderWithoutFilter extends ChunkReader {
26 |
27 | public ChunkReaderWithoutFilter(Chunk chunk) {
28 | super(chunk);
29 | }
30 |
31 | @Override
32 | public boolean pageSatisfied(PageHeader pageHeader) {
33 | return pageHeader.getMax_timestamp() > getMaxTombstoneTime();
34 | }
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/tsfile/src/main/java/org/apache/iotdb/tsfile/write/writer/IDataWriter.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.write.writer;
21 |
22 | public interface IDataWriter {
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/tsfile/src/main/resources/tsfile-format.properties.template:
--------------------------------------------------------------------------------
1 | # Memory size threshold for flushing to disk or HDFS, default value is 128MB
2 | group_size_in_byte=134217728
3 |
4 | # The memory size for each series writer to pack page, default value is 1MB
5 | page_size_in_byte=1048576
6 |
7 | # The maximum number of data points in a page, defalut 1024*1024
8 | max_number_of_points_in_page=1048576
9 |
10 | # Data type configuration
11 |
12 | # Data type for input timestamp, TsFile supports INT32 or INT64
13 | time_series_data_type=INT64
14 |
15 | # Max length limitation of input string
16 | max_string_length=128
17 |
18 | # Floating-point precision
19 | float_precision=2
20 |
21 | # Encoder configuration
22 |
23 | # Encoder of time series, TsFile supports TS_2DIFF, PLAIN and RLE(run-length encoding) and default value is TS_2DIFF
24 | time_series_encoder=TS_2DIFF
25 |
26 | # Encoder of value series. default value is PLAIN.
27 | # For int, long data type, TsFile also supports TS_2DIFF and RLE(run-length encoding).
28 | # For float, double data type, TsFile also supports TS_2DIFF, RLE(run-length encoding) and GORILLA.
29 | # For text data type, TsFile only supports PLAIN.
30 | value_encoder=PLAIN
31 |
32 | # Compression configuration
33 |
34 | # Data compression method, TsFile supports UNCOMPRESSED or SNAPPY. Default value is UNCOMPRESSED which means no compression
35 | compressor=UNCOMPRESSED
--------------------------------------------------------------------------------
/tsfile/src/test/java/org/apache/iotdb/tsfile/constant/TimeseriesTestConstant.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.constant;
21 |
22 | import java.util.Random;
23 |
24 | /**
25 | * This class is used for Junit test to get some unified constant.
26 | *
27 | * @author kangrong
28 | *
29 | */
30 | public class TimeseriesTestConstant {
31 |
32 | public static final float float_min_delta = 0.00001f;
33 | public static final double double_min_delta = 0.00001d;
34 | public static final Random random = new Random(System.currentTimeMillis());
35 | }
36 |
--------------------------------------------------------------------------------
/tsfile/src/test/java/org/apache/iotdb/tsfile/utils/CommonTestConstant.java:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org)
3 | *
4 | * Licensed to the Apache Software Foundation (ASF) under one
5 | * or more contributor license agreements. See the NOTICE file
6 | * distributed with this work for additional information
7 | * regarding copyright ownership. The ASF licenses this file
8 | * to you under the Apache License, Version 2.0 (the
9 | * "License"); you may not use this file except in compliance
10 | * with the License. You may obtain a copy of the License at
11 | *
12 | * http://www.apache.org/licenses/LICENSE-2.0
13 | *
14 | * Unless required by applicable law or agreed to in writing, software
15 | * distributed under the License is distributed on an "AS IS" BASIS,
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 | * See the License for the specific language governing permissions and
18 | * limitations under the License.
19 | */
20 | package org.apache.iotdb.tsfile.utils;
21 |
22 | import java.util.Random;
23 |
24 | /**
25 | * This class is used for Junit test to get some unified constant.
26 | *
27 | * @author kangrong
28 | *
29 | */
30 | public class CommonTestConstant {
31 |
32 | public static final float float_min_delta = 0.00001f;
33 | public static final double double_min_delta = 0.00001d;
34 | public static final Random random = new Random(System.currentTimeMillis());
35 | }
36 |
--------------------------------------------------------------------------------
/tsfile/src/test/resources/test_schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "schema": [
3 | {
4 | "measurement_id": "s1",
5 | "data_type": "INT32",
6 | "encoding": "RLE"
7 | },
8 | {
9 | "measurement_id": "s2",
10 | "data_type": "INT64",
11 | "encoding": "TS_2DIFF"
12 | },
13 | {
14 | "measurement_id": "s4",
15 | "data_type": "DOUBLE",
16 | "encoding": "RLE",
17 | "max_error": 12
18 | },
19 | {
20 | "measurement_id": "s5",
21 | "data_type": "INT32",
22 | "encoding": "TS_2DIFF"
23 | }
24 | ]
25 | }
--------------------------------------------------------------------------------
/tsfile/src/test/resources/test_write_schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "schema": [
3 | {
4 | "measurement_id": "s0",
5 | "data_type": "INT32",
6 | "encoding": "RLE"
7 | },
8 | {
9 | "measurement_id": "s1",
10 | "data_type": "INT64",
11 | "encoding": "TS_2DIFF"
12 | },
13 | {
14 | "measurement_id": "s2",
15 | "data_type": "FLOAT",
16 | "encoding": "RLE",
17 | "max_point_number": 2
18 | },
19 | {
20 | "measurement_id": "s3",
21 | "data_type": "DOUBLE",
22 | "encoding": "TS_2DIFF",
23 | "max_point_number": 3
24 | },
25 | {
26 | "measurement_id": "s4",
27 | "data_type": "BOOLEAN",
28 | "encoding": "PLAIN"
29 | }
30 | ]
31 | }
--------------------------------------------------------------------------------