├── .checkstyle ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── custom.md │ └── feature_request.md ├── .gitignore ├── .mvn └── wrapper │ ├── MavenWrapperDownloader.java │ └── maven-wrapper.properties ├── .travis.yml ├── LICENSE-binary ├── License ├── NOTICE ├── NOTICE-binary ├── Readme.md ├── asf.header ├── checkstyle.xml ├── codecov.yml ├── grafana ├── conf │ └── application.properties ├── img │ ├── add_data_source.png │ ├── add_graph.png │ └── edit_data_source.png ├── pom.xml ├── readme.md ├── readme_zh.md └── src │ └── main │ └── java │ └── org │ └── apache │ └── iotdb │ └── web │ └── grafana │ ├── TsfileWebDemoApplication.java │ ├── bean │ └── TimeValues.java │ ├── conf │ └── MyConfiguration.java │ ├── controller │ └── DatabaseConnectController.java │ ├── dao │ ├── BasicDao.java │ └── impl │ │ └── BasicDaoImpl.java │ └── service │ ├── DatabaseConnectService.java │ └── impl │ └── DatabaseConnectServiceImpl.java ├── hadoop ├── README.md ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── iotdb │ │ └── tsfile │ │ └── hadoop │ │ ├── TSFHadoopException.java │ │ ├── TSFInputFormat.java │ │ ├── TSFInputSplit.java │ │ ├── TSFOutputFormat.java │ │ ├── TSFRecordReader.java │ │ ├── TSFRecordWriter.java │ │ ├── TSRow.java │ │ ├── example │ │ ├── TSFMRReadExample.java │ │ └── TsFileHelper.java │ │ └── io │ │ ├── HDFSInputStream.java │ │ └── HDFSOutputStream.java │ └── test │ └── java │ └── cn │ └── edu │ └── thu │ └── tsfile │ └── hadoop │ ├── InputOutputStreamTest.java │ ├── TSFHadoopTest.java │ ├── TSFInputSplitTest.java │ └── TsFileTestHelper.java ├── iotdb-cli ├── cli │ └── bin │ │ ├── export-csv.bat │ │ ├── export-csv.sh │ │ ├── import-csv.bat │ │ ├── import-csv.sh │ │ ├── run-client.bat │ │ ├── start-client.bat │ │ └── start-client.sh ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── iotdb │ │ └── cli │ │ ├── client │ │ ├── AbstractClient.java │ │ ├── Client.java │ │ └── WinClient.java │ │ ├── exception │ │ └── ArgsErrorException.java │ │ └── tool │ │ ├── AbstractCsvTool.java │ │ ├── CsvTestDataGen.java │ │ ├── ExportCsv.java │ │ └── ImportCsv.java │ └── test │ ├── java │ └── org │ │ └── apache │ │ └── iotdb │ │ └── cli │ │ └── client │ │ ├── AbstractClientTest.java │ │ └── StartClientScriptTest.java │ └── resources │ └── logback.xml ├── iotdb ├── iotdb │ ├── bin │ │ ├── start-postBackClient.bat │ │ ├── start-postBackClient.sh │ │ ├── start-server.bat │ │ ├── start-server.sh │ │ ├── stop-postBackClient.bat │ │ ├── stop-postBackClient.sh │ │ ├── stop-server.bat │ │ └── stop-server.sh │ └── conf │ │ ├── error_info_cn.properties │ │ ├── error_info_en.properties │ │ ├── iotdb-engine.properties │ │ ├── iotdb-env.bat │ │ ├── iotdb-env.sh │ │ ├── iotdb-postbackClient.properties │ │ ├── logback.xml │ │ └── tsfile-format.properties ├── pom.xml └── src │ ├── main │ ├── antlr3 │ │ └── org │ │ │ └── apache │ │ │ └── iotdb │ │ │ └── db │ │ │ └── sql │ │ │ └── parse │ │ │ ├── TSLexer.g │ │ │ └── TSParser.g │ └── java │ │ └── org │ │ └── apache │ │ └── iotdb │ │ └── db │ │ ├── auth │ │ ├── AuthException.java │ │ ├── AuthorityChecker.java │ │ ├── authorizer │ │ │ ├── BasicAuthorizer.java │ │ │ ├── IAuthorizer.java │ │ │ └── LocalFileAuthorizer.java │ │ ├── entity │ │ │ ├── PathPrivilege.java │ │ │ ├── PrivilegeType.java │ │ │ ├── Role.java │ │ │ └── User.java │ │ ├── role │ │ │ ├── BasicRoleManager.java │ │ │ ├── IRoleAccessor.java │ │ │ ├── IRoleManager.java │ │ │ ├── LocalFileRoleAccessor.java │ │ │ └── LocalFileRoleManager.java │ │ └── user │ │ │ ├── BasicUserManager.java │ │ │ ├── IUserAccessor.java │ │ │ ├── IUserManager.java │ │ │ ├── LocalFileUserAccessor.java │ │ │ └── LocalFileUserManager.java │ │ ├── concurrent │ │ ├── HashLock.java │ │ ├── IoTDBDefaultThreadExceptionHandler.java │ │ ├── IoTDBThreadPoolFactory.java │ │ ├── IoTThreadFactory.java │ │ └── ThreadName.java │ │ ├── conf │ │ ├── IoTDBConfig.java │ │ ├── IoTDBConstant.java │ │ ├── IoTDBDescriptor.java │ │ └── directories │ │ │ ├── Directories.java │ │ │ └── strategy │ │ │ ├── DirectoryStrategy.java │ │ │ ├── MaxDiskUsableSpaceFirstStrategy.java │ │ │ ├── MinDirOccupiedSpaceFirstStrategy.java │ │ │ ├── MinFolderOccupiedSpaceFirstStrategy.java │ │ │ └── SequenceStrategy.java │ │ ├── engine │ │ ├── Processor.java │ │ ├── bufferwrite │ │ │ ├── Action.java │ │ │ ├── BufferWriteProcessor.java │ │ │ ├── FileNodeConstants.java │ │ │ └── RestorableTsFileIOWriter.java │ │ ├── cache │ │ │ ├── RowGroupBlockMetaDataCache.java │ │ │ ├── TsFileMetaDataCache.java │ │ │ └── TsFileMetadataUtils.java │ │ ├── filenode │ │ │ ├── FileNodeManager.java │ │ │ ├── FileNodeProcessor.java │ │ │ ├── FileNodeProcessorStatus.java │ │ │ ├── FileNodeProcessorStore.java │ │ │ ├── IntervalFileNode.java │ │ │ ├── Main.java │ │ │ ├── OverflowChangeType.java │ │ │ └── SerializeUtil.java │ │ ├── filenodev2 │ │ │ └── TimeIntervalTsFile.java │ │ ├── memcontrol │ │ │ ├── BasicMemController.java │ │ │ ├── FlushPartialPolicy.java │ │ │ ├── ForceFLushAllPolicy.java │ │ │ ├── JVMMemController.java │ │ │ ├── MemMonitorThread.java │ │ │ ├── MemStatisticThread.java │ │ │ ├── NoActPolicy.java │ │ │ ├── Policy.java │ │ │ └── RecordMemController.java │ │ ├── memtable │ │ │ ├── AbstractMemTable.java │ │ │ ├── IMemTable.java │ │ │ ├── IWritableMemChunk.java │ │ │ ├── MemSeriesLazyMerger.java │ │ │ ├── MemTableFlushUtil.java │ │ │ ├── PrimitiveMemTable.java │ │ │ ├── TimeValuePairInMemTable.java │ │ │ ├── TimeValuePairSorter.java │ │ │ └── WritableMemChunk.java │ │ ├── overflow │ │ │ ├── ioV2 │ │ │ │ ├── OverflowIO.java │ │ │ │ ├── OverflowProcessor.java │ │ │ │ ├── OverflowResource.java │ │ │ │ ├── OverflowSeriesImpl.java │ │ │ │ └── OverflowSupport.java │ │ │ ├── metadata │ │ │ │ ├── OFFileMetadata.java │ │ │ │ ├── OFRowGroupListMetadata.java │ │ │ │ └── OFSeriesListMetadata.java │ │ │ └── utils │ │ │ │ ├── MergeStatus.java │ │ │ │ ├── OverflowOpType.java │ │ │ │ ├── OverflowReadWriteThriftFormatUtils.java │ │ │ │ └── TimePair.java │ │ ├── pool │ │ │ ├── FlushManager.java │ │ │ └── MergeManager.java │ │ ├── querycontext │ │ │ ├── GlobalSortedSeriesDataSource.java │ │ │ ├── MergeSeriesDataSource.java │ │ │ ├── OverflowInsertFile.java │ │ │ ├── OverflowSeriesDataSource.java │ │ │ ├── OverflowUpdateDeleteFile.java │ │ │ ├── QueryDataSource.java │ │ │ ├── ReadOnlyMemChunk.java │ │ │ └── UnsealedTsFile.java │ │ └── utils │ │ │ └── FlushStatus.java │ │ ├── exception │ │ ├── ArgsErrorException.java │ │ ├── BufferWriteProcessorException.java │ │ ├── DeltaEngineRunningException.java │ │ ├── ErrorDebugException.java │ │ ├── FileNodeManagerException.java │ │ ├── FileNodeNotExistException.java │ │ ├── FileNodeProcessorException.java │ │ ├── MetadataArgsErrorException.java │ │ ├── NotConsistentException.java │ │ ├── OverflowProcessorException.java │ │ ├── OverflowWrongParameterException.java │ │ ├── PathErrorException.java │ │ ├── ProcessorException.java │ │ ├── ProcessorRuntimException.java │ │ ├── RecoverException.java │ │ ├── StartupException.java │ │ ├── UnSupportedFillTypeException.java │ │ ├── UnSupportedOverflowOpTypeException.java │ │ ├── WALOverSizedException.java │ │ ├── builder │ │ │ └── ExceptionBuilder.java │ │ ├── codebased │ │ │ ├── AuthPluginException.java │ │ │ ├── ConnectionFailedException.java │ │ │ ├── ConnectionHostException.java │ │ │ ├── InsecureAPIException.java │ │ │ ├── InvalidParameterException.java │ │ │ ├── IoTDBException.java │ │ │ ├── NoParameterException.java │ │ │ ├── NoPreparedStatementException.java │ │ │ ├── OutOfMemoryException.java │ │ │ └── UnknownException.java │ │ └── qp │ │ │ ├── GeneratePhysicalPlanException.java │ │ │ ├── IllegalASTFormatException.java │ │ │ ├── LogicalOperatorException.java │ │ │ ├── LogicalOptimizeException.java │ │ │ └── QueryProcessorException.java │ │ ├── metadata │ │ ├── ColumnSchema.java │ │ ├── MGraph.java │ │ ├── MManager.java │ │ ├── MNode.java │ │ ├── MTree.java │ │ ├── Metadata.java │ │ ├── MetadataConstant.java │ │ ├── MetadataOperationType.java │ │ ├── PNode.java │ │ └── PTree.java │ │ ├── monitor │ │ ├── IStatistic.java │ │ ├── MonitorConstants.java │ │ └── StatMonitor.java │ │ ├── postback │ │ ├── conf │ │ │ ├── PostBackSenderConfig.java │ │ │ └── PostBackSenderDescriptor.java │ │ ├── receiver │ │ │ ├── ServerManager.java │ │ │ ├── ServerService.java │ │ │ └── ServerServiceImpl.java │ │ ├── sender │ │ │ ├── FileManager.java │ │ │ ├── FileSender.java │ │ │ └── FileSenderImpl.java │ │ └── utils │ │ │ ├── CreateDataSender1.java │ │ │ ├── CreateDataSender2.java │ │ │ ├── CreateDataSender3.java │ │ │ ├── RandomNum.java │ │ │ └── Utils.java │ │ ├── qp │ │ ├── QueryProcessor.java │ │ ├── constant │ │ │ ├── DatetimeUtils.java │ │ │ ├── SQLConstant.java │ │ │ └── TSParserConstant.java │ │ ├── exception │ │ │ └── DateTimeFormatException.java │ │ ├── executor │ │ │ ├── OverflowQPExecutor.java │ │ │ └── QueryProcessExecutor.java │ │ ├── logical │ │ │ ├── Operator.java │ │ │ ├── RootOperator.java │ │ │ ├── crud │ │ │ │ ├── BasicFunctionOperator.java │ │ │ │ ├── BasicOperatorType.java │ │ │ │ ├── DeleteOperator.java │ │ │ │ ├── FilterOperator.java │ │ │ │ ├── FromOperator.java │ │ │ │ ├── FunctionOperator.java │ │ │ │ ├── InsertOperator.java │ │ │ │ ├── QueryOperator.java │ │ │ │ ├── SFWOperator.java │ │ │ │ ├── SelectOperator.java │ │ │ │ └── UpdateOperator.java │ │ │ └── sys │ │ │ │ ├── AuthorOperator.java │ │ │ │ ├── LoadDataOperator.java │ │ │ │ ├── MetadataOperator.java │ │ │ │ └── PropertyOperator.java │ │ ├── physical │ │ │ ├── PhysicalPlan.java │ │ │ ├── crud │ │ │ │ ├── AggregationPlan.java │ │ │ │ ├── DeletePlan.java │ │ │ │ ├── FillQueryPlan.java │ │ │ │ ├── GroupByPlan.java │ │ │ │ ├── InsertPlan.java │ │ │ │ ├── QueryPlan.java │ │ │ │ └── UpdatePlan.java │ │ │ └── sys │ │ │ │ ├── AuthorPlan.java │ │ │ │ ├── LoadDataPlan.java │ │ │ │ ├── MetadataPlan.java │ │ │ │ └── PropertyPlan.java │ │ └── strategy │ │ │ ├── LogicalGenerator.java │ │ │ ├── PhysicalGenerator.java │ │ │ └── optimizer │ │ │ ├── ConcatPathOptimizer.java │ │ │ ├── DnfFilterOptimizer.java │ │ │ ├── IFilterOptimizer.java │ │ │ ├── ILogicalOptimizer.java │ │ │ ├── MergeSingleFilterOptimizer.java │ │ │ └── RemoveNotOptimizer.java │ │ ├── query │ │ ├── component │ │ │ ├── executor │ │ │ │ └── QueryJobExecutor.java │ │ │ ├── job │ │ │ │ ├── QueryEngine.java │ │ │ │ ├── QueryEngineImpl.java │ │ │ │ ├── QueryJob.java │ │ │ │ ├── QueryJobContext.java │ │ │ │ ├── QueryJobDispatcher.java │ │ │ │ ├── QueryJobExecutionMessage.java │ │ │ │ ├── QueryJobFuture.java │ │ │ │ ├── QueryJobFutureImpl.java │ │ │ │ ├── QueryJobStatus.java │ │ │ │ └── QueryJobType.java │ │ │ └── resource │ │ │ │ └── QueryResource.java │ │ ├── control │ │ │ ├── FileReaderManager.java │ │ │ ├── OpenedFilePathsManager.java │ │ │ ├── QueryDataSourceManager.java │ │ │ └── QueryTokenManager.java │ │ ├── dataset │ │ │ ├── EngineDataSetWithTimeGenerator.java │ │ │ └── EngineDataSetWithoutTimeGenerator.java │ │ ├── executor │ │ │ ├── EngineExecutorWithTimeGenerator.java │ │ │ ├── EngineExecutorWithoutTimeGenerator.java │ │ │ └── EngineQueryRouter.java │ │ ├── externalsort │ │ │ ├── ExternalSortJob.java │ │ │ ├── ExternalSortJobEngine.java │ │ │ ├── ExternalSortJobPart.java │ │ │ ├── ExternalSortJobScheduler.java │ │ │ ├── LineMerger.java │ │ │ ├── MultiSourceExternalSortJobPart.java │ │ │ ├── SimpleExternalSortEngine.java │ │ │ ├── SingleSourceExternalSortJobPart.java │ │ │ └── serialize │ │ │ │ ├── TimeValuePairDeserializer.java │ │ │ │ ├── TimeValuePairSerializer.java │ │ │ │ └── impl │ │ │ │ ├── FixLengthTimeValuePairDeserializer.java │ │ │ │ ├── FixLengthTimeValuePairSerializer.java │ │ │ │ ├── SimpleTimeValuePairDeserializer.java │ │ │ │ └── SimpleTimeValuePairSerializer.java │ │ ├── factory │ │ │ └── SeriesReaderFactory.java │ │ ├── fill │ │ │ ├── IFill.java │ │ │ ├── LinearFill.java │ │ │ └── PreviousFill.java │ │ ├── reader │ │ │ ├── IReader.java │ │ │ ├── mem │ │ │ │ ├── MemChunkReaderByTimestamp.java │ │ │ │ ├── MemChunkReaderWithFilter.java │ │ │ │ └── MemChunkReaderWithoutFilter.java │ │ │ ├── merge │ │ │ │ ├── EngineReaderByTimeStamp.java │ │ │ │ ├── PriorityMergeReader.java │ │ │ │ └── PriorityMergeReaderByTimestamp.java │ │ │ ├── sequence │ │ │ │ ├── SealedTsFilesReader.java │ │ │ │ ├── SequenceDataReader.java │ │ │ │ ├── SequenceInsertDataByTimeStampReader.java │ │ │ │ └── UnSealedTsFileReader.java │ │ │ └── unsequence │ │ │ │ └── EngineChunkReader.java │ │ └── timegenerator │ │ │ ├── EngineLeafNode.java │ │ │ ├── EngineNodeConstructor.java │ │ │ └── EngineTimeGenerator.java │ │ ├── service │ │ ├── CloseMergeService.java │ │ ├── IService.java │ │ ├── IoTDB.java │ │ ├── IoTDBMBean.java │ │ ├── JDBCService.java │ │ ├── JDBCServiceEventHandler.java │ │ ├── JDBCServiceMBean.java │ │ ├── JMXService.java │ │ ├── Monitor.java │ │ ├── MonitorMBean.java │ │ ├── RegisterManager.java │ │ ├── ServiceType.java │ │ ├── StartupCheck.java │ │ ├── StartupChecks.java │ │ ├── TSServiceImpl.java │ │ └── Utils.java │ │ ├── sql │ │ ├── ParseGenerator.java │ │ └── parse │ │ │ ├── AstErrorNode.java │ │ │ ├── AstNode.java │ │ │ ├── AstNodeOrigin.java │ │ │ ├── Node.java │ │ │ ├── ParseDriver.java │ │ │ ├── ParseError.java │ │ │ ├── ParseException.java │ │ │ └── ParseUtils.java │ │ ├── utils │ │ ├── AuthUtils.java │ │ ├── CommonUtils.java │ │ ├── FileSchemaUtils.java │ │ ├── FileUtils.java │ │ ├── IOUtils.java │ │ ├── LoadDataUtils.java │ │ ├── MemUtils.java │ │ ├── OpenFileNumUtil.java │ │ ├── PostbackUtils.java │ │ ├── PrimitiveArrayList.java │ │ ├── PrimitiveArrayListFactory.java │ │ ├── RandomDeleteCache.java │ │ ├── RecordUtils.java │ │ ├── TimeValuePair.java │ │ ├── TimeValuePairUtils.java │ │ └── TsPrimitiveType.java │ │ └── writelog │ │ ├── LogPosition.java │ │ ├── RecoverStage.java │ │ ├── io │ │ ├── ILogReader.java │ │ ├── ILogWriter.java │ │ ├── LogWriter.java │ │ └── RAFLogReader.java │ │ ├── manager │ │ ├── MultiFileLogNodeManager.java │ │ └── WriteLogNodeManager.java │ │ ├── node │ │ ├── ExclusiveWriteLogNode.java │ │ └── WriteLogNode.java │ │ ├── recover │ │ ├── ExclusiveLogRecoverPerformer.java │ │ ├── FileNodeRecoverPerformer.java │ │ └── RecoverPerformer.java │ │ ├── replay │ │ ├── ConcreteLogReplayer.java │ │ └── LogReplayer.java │ │ └── transfer │ │ ├── Codec.java │ │ ├── PhysicalPlanCodec.java │ │ ├── PhysicalPlanLogTransfer.java │ │ └── SystemLogOperator.java │ └── test │ ├── java │ ├── PerformanceTest.java │ └── org │ │ └── apache │ │ └── iotdb │ │ └── db │ │ ├── auth │ │ ├── LocalFIleRoleAccessorTest.java │ │ ├── LocalFileAuthorizerTest.java │ │ ├── LocalFileRoleManagerTest.java │ │ ├── LocalFileUserAccessorTest.java │ │ └── LocalFileUserManagerTest.java │ │ ├── concurrent │ │ ├── IoTDBDefaultThreadExceptionHandlerTest.java │ │ └── IoTDBThreadPoolFactoryTest.java │ │ ├── engine │ │ ├── MetadataManagerHelper.java │ │ ├── PathUtils.java │ │ ├── ProcessorTest.java │ │ ├── bufferwrite │ │ │ ├── BufferWriteBenchmark.java │ │ │ ├── BufferWriteProcessorNewTest.java │ │ │ ├── BufferWriteProcessorTest.java │ │ │ └── RestorableTsFileIOWriterTest.java │ │ ├── filenode │ │ │ └── SerializeUtilTest.java │ │ ├── filenodev2 │ │ │ └── FileNodeManagerBenchmark.java │ │ ├── memcontrol │ │ │ ├── BufferwriteFileSizeControlTest.java │ │ │ ├── BufferwriteMetaSizeControlTest.java │ │ │ ├── IoTDBMemControlTest.java │ │ │ ├── MemControllerTest.java │ │ │ ├── OverflowFileSizeControlTest.java │ │ │ └── OverflowMetaSizeControlTest.java │ │ ├── memtable │ │ │ ├── MemTableTestUtils.java │ │ │ ├── MemtableBenchmark.java │ │ │ └── PrimitiveMemTableTest.java │ │ └── overflow │ │ │ ├── ioV2 │ │ │ ├── OverflowIOTest.java │ │ │ ├── OverflowProcessorBenchmark.java │ │ │ ├── OverflowProcessorTest.java │ │ │ ├── OverflowResourceTest.java │ │ │ ├── OverflowSupportTest.java │ │ │ └── OverflowTestUtils.java │ │ │ └── metadata │ │ │ ├── OFFileMetadataTest.java │ │ │ ├── OFRowGroupListMetadataTest.java │ │ │ ├── OFSeriesListMetadataTest.java │ │ │ ├── OverflowTestHelper.java │ │ │ └── OverflowUtils.java │ │ ├── exception │ │ └── ExceptionBuilderTest.java │ │ ├── integration │ │ ├── Constant.java │ │ ├── IoTDBAuthorizationTest.java │ │ ├── IoTDBCompleteTest.java │ │ ├── IoTDBDaemonTest.java │ │ ├── IoTDBEngineTimeGeneratorTest.java │ │ ├── IoTDBLargeDataTest.java │ │ ├── IoTDBLimitSlimitTest.java │ │ ├── IoTDBMetadataFetchTest.java │ │ ├── IoTDBMultiSeriesTest.java │ │ ├── IoTDBSequenceDataQueryTest.java │ │ ├── IoTDBSeriesReaderTest.java │ │ └── IoTDBTimeZoneTest.java │ │ ├── metadata │ │ ├── MManagerAdvancedTest.java │ │ ├── MManagerBasicTest.java │ │ ├── MManagerEfficiencyTest.java │ │ ├── MManagerImproveTest.java │ │ └── MTreeTest.java │ │ ├── monitor │ │ └── MonitorTest.java │ │ ├── postback │ │ └── sender │ │ │ ├── FileManagerTest.java │ │ │ ├── IoTDBSingleClientPostBackTest.java │ │ │ └── MultipleClientPostBackTest.java │ │ ├── qp │ │ ├── bench │ │ │ └── QueryParseBenchmark.java │ │ ├── other │ │ │ ├── TSPlanContextAuthorTest.java │ │ │ └── TSPlanContextPropertyTest.java │ │ ├── plan │ │ │ ├── LogicalPlanSmallTest.java │ │ │ ├── PhysicalPlanTest.java │ │ │ ├── QPUpdateTest.java │ │ │ └── TestConcatOptimizer.java │ │ ├── strategy │ │ │ └── LogicalGeneratorTest.java │ │ └── utils │ │ │ └── MemIntQpExecutor.java │ │ ├── query │ │ ├── component │ │ │ └── SimpleFileWriter.java │ │ ├── control │ │ │ ├── FileReaderManagerTest.java │ │ │ ├── OpenedFilePathsManagerTest.java │ │ │ └── QueryTokenManagerTest.java │ │ └── reader │ │ │ └── merge │ │ │ ├── PriorityMergeReaderByTimestampTest.java │ │ │ ├── PriorityMergeReaderTest.java │ │ │ └── SeriesMergeSortReaderTest.java │ │ ├── script │ │ └── IoTDBStartServerScriptTest.java │ │ ├── sql │ │ ├── DatetimeUtilsTest.java │ │ └── SQLParserTest.java │ │ ├── utils │ │ ├── EnvironmentUtils.java │ │ ├── OpenFileNumUtilTest.java │ │ └── PrimitiveArrayListTest.java │ │ └── writelog │ │ ├── IoTDBLogFileSizeTest.java │ │ ├── PerformanceTest.java │ │ ├── RecoverTest.java │ │ ├── WriteLogNodeManagerTest.java │ │ ├── WriteLogNodeTest.java │ │ └── io │ │ └── LogWriterReaderTest.java │ └── resources │ ├── start-postBackTest.sh │ └── stop-postBackTest.sh ├── java-google-style.xml ├── jdbc ├── LICENSE ├── README.md ├── example │ ├── data │ │ └── kafka_data.csv │ ├── readme.md │ └── src │ │ └── main │ │ └── java │ │ └── org │ │ └── apache │ │ └── iotdb │ │ └── jdbc │ │ ├── jdbcDemo │ │ └── SendDataToIotdb.java │ │ └── kafka_iotdbDemo │ │ ├── KafkaConsumer.java │ │ └── KafkaProducer.java ├── package.sh ├── pom.xml └── src │ ├── main │ └── java │ │ └── org │ │ └── apache │ │ └── iotdb │ │ └── jdbc │ │ ├── Config.java │ │ ├── Constant.java │ │ ├── IoTDBConnection.java │ │ ├── IoTDBConnectionParams.java │ │ ├── IoTDBDatabaseMetadata.java │ │ ├── IoTDBDriver.java │ │ ├── IoTDBMetadataResultMetadata.java │ │ ├── IoTDBMetadataResultSet.java │ │ ├── IoTDBPrepareStatement.java │ │ ├── IoTDBQueryResultSet.java │ │ ├── IoTDBResultMetadata.java │ │ ├── IoTDBSQLException.java │ │ ├── IoTDBStatement.java │ │ ├── IoTDBURLException.java │ │ └── Utils.java │ └── test │ └── java │ └── org │ └── apache │ └── iotdb │ └── jdbc │ ├── BatchTest.java │ ├── IoTDBConnectionTest.java │ ├── IoTDBDatabaseMetadataTest.java │ ├── IoTDBMetadataResultMetadataTest.java │ ├── IoTDBPrepareStatementTest.java │ ├── IoTDBQueryResultSetTest.java │ ├── IoTDBResultMetadataTest.java │ ├── IoTDBStatementTest.java │ ├── UtilsTest.java │ └── demo │ ├── MetadataDemo.java │ ├── PrepareStatementDemo.java │ └── StatementDemo.java ├── licenses-binary ├── Eclipse Public License 1.0 (EPL-1.0) ├── Eclipse Public License version 2.0 (EPL-2.0) ├── GNU Lesser General Public License version 2.1(LGPL-2.1) ├── The 2-Clause BSD License ├── The 3-Clause BSD License ├── The JSON License └── The MIT License ├── mvnw.cmd ├── mvnw.sh ├── pom.xml ├── service-rpc ├── pom.xml └── src │ └── main │ └── thrift │ └── rpc.thrift ├── spark ├── README.md ├── pom.xml └── src │ ├── main │ ├── java │ │ └── org │ │ │ └── apache │ │ │ └── iotdb │ │ │ └── tsfile │ │ │ ├── io │ │ │ ├── CreateTSFile.java │ │ │ ├── HDFSInputStream.java │ │ │ ├── HDFSOutputStream.java │ │ │ ├── TsFileOutputFormat.java │ │ │ └── TsFileRecordWriter.java │ │ │ └── qp │ │ │ ├── Executor.java │ │ │ ├── QueryProcessor.java │ │ │ ├── common │ │ │ ├── BasicOperator.java │ │ │ ├── FilterOperator.java │ │ │ ├── Operator.java │ │ │ ├── SQLConstant.java │ │ │ ├── SingleQuery.java │ │ │ └── TSQueryPlan.java │ │ │ ├── exception │ │ │ ├── BasicOperatorException.java │ │ │ ├── DNFOptimizeException.java │ │ │ ├── LogicalOptimizeException.java │ │ │ ├── MergeFilterException.java │ │ │ ├── QueryOperatorException.java │ │ │ ├── QueryProcessorException.java │ │ │ └── RemoveNotException.java │ │ │ └── optimizer │ │ │ ├── DNFFilterOptimizer.java │ │ │ ├── IFilterOptimizer.java │ │ │ ├── MergeSingleFilterOptimizer.java │ │ │ ├── PhysicalOptimizer.java │ │ │ └── RemoveNotOptimizer.java │ └── scala │ │ └── org │ │ └── apache │ │ └── iotdb │ │ └── tsfile │ │ ├── Converter.scala │ │ ├── DefaultSource.scala │ │ ├── TsFileOutputWriter.scala │ │ ├── TsFileWriterFactory.scala │ │ └── package.scala │ └── test │ ├── resources │ └── test.tsfile │ └── scala │ └── cn │ └── edu │ └── tsinghua │ └── tsfile │ ├── ConverterTest.scala │ └── TSFileSuit.scala └── tsfile ├── README.md ├── example ├── readme.md └── src │ └── main │ └── java │ └── cn │ └── edu │ └── tsinghua │ └── tsfile │ ├── TsFileRead.java │ ├── TsFileSequenceRead.java │ └── TsFileWrite.java ├── package.sh ├── pom.xml └── src ├── main ├── java │ └── org │ │ └── apache │ │ └── iotdb │ │ └── tsfile │ │ ├── common │ │ ├── cache │ │ │ ├── Cache.java │ │ │ └── LRUCache.java │ │ ├── conf │ │ │ ├── TSFileConfig.java │ │ │ └── TSFileDescriptor.java │ │ └── constant │ │ │ ├── JsonFormatConstant.java │ │ │ ├── QueryConstant.java │ │ │ ├── StatisticConstant.java │ │ │ └── SystemConstant.java │ │ ├── compress │ │ ├── Compressor.java │ │ └── UnCompressor.java │ │ ├── encoding │ │ ├── bitpacking │ │ │ ├── IntPacker.java │ │ │ └── LongPacker.java │ │ ├── common │ │ │ ├── EncodingConfig.java │ │ │ └── EndianType.java │ │ ├── decoder │ │ │ ├── BitmapDecoder.java │ │ │ ├── Decoder.java │ │ │ ├── DeltaBinaryDecoder.java │ │ │ ├── DoublePrecisionDecoder.java │ │ │ ├── FloatDecoder.java │ │ │ ├── GorillaDecoder.java │ │ │ ├── IntRleDecoder.java │ │ │ ├── LongRleDecoder.java │ │ │ ├── PlainDecoder.java │ │ │ ├── RleDecoder.java │ │ │ └── SinglePrecisionDecoder.java │ │ └── encoder │ │ │ ├── BitmapEncoder.java │ │ │ ├── DeltaBinaryEncoder.java │ │ │ ├── DoublePrecisionEncoder.java │ │ │ ├── Encoder.java │ │ │ ├── FloatEncoder.java │ │ │ ├── GorillaEncoder.java │ │ │ ├── IntRleEncoder.java │ │ │ ├── LongRleEncoder.java │ │ │ ├── PlainEncoder.java │ │ │ ├── RleEncoder.java │ │ │ ├── SinglePrecisionEncoder.java │ │ │ └── TSEncodingBuilder.java │ │ ├── exception │ │ ├── TsFileRuntimeException.java │ │ ├── cache │ │ │ └── CacheException.java │ │ ├── compress │ │ │ └── CompressionTypeNotSupportedException.java │ │ ├── encoding │ │ │ ├── TsFileDecodingException.java │ │ │ └── TsFileEncodingException.java │ │ ├── filter │ │ │ ├── FilterDataTypeException.java │ │ │ ├── FilterInvokeException.java │ │ │ ├── QueryFilterOptimizationException.java │ │ │ └── UnSupportFilterDataTypeException.java │ │ ├── metadata │ │ │ └── MetadataArgsErrorException.java │ │ └── write │ │ │ ├── InvalidJsonSchemaException.java │ │ │ ├── NoMeasurementException.java │ │ │ ├── PageException.java │ │ │ ├── UnSupportedDataTypeException.java │ │ │ ├── UnknownColumnTypeException.java │ │ │ └── WriteProcessException.java │ │ ├── file │ │ ├── MetaMarker.java │ │ ├── footer │ │ │ └── ChunkGroupFooter.java │ │ ├── header │ │ │ ├── ChunkHeader.java │ │ │ ├── PageHeader.java │ │ │ └── package-info.java │ │ └── metadata │ │ │ ├── ChunkGroupMetaData.java │ │ │ ├── ChunkMetaData.java │ │ │ ├── TsDeviceMetadata.java │ │ │ ├── TsDeviceMetadataIndex.java │ │ │ ├── TsDigest.java │ │ │ ├── TsFileMetaData.java │ │ │ ├── enums │ │ │ ├── CompressionType.java │ │ │ ├── TSDataType.java │ │ │ ├── TSEncoding.java │ │ │ └── TSFreqType.java │ │ │ └── statistics │ │ │ ├── BinaryStatistics.java │ │ │ ├── BooleanStatistics.java │ │ │ ├── DoubleStatistics.java │ │ │ ├── FloatStatistics.java │ │ │ ├── IntegerStatistics.java │ │ │ ├── LongStatistics.java │ │ │ ├── NoStatistics.java │ │ │ ├── Statistics.java │ │ │ ├── StatisticsClassException.java │ │ │ └── StatisticsDeserializer.java │ │ ├── read │ │ ├── IDataReader.java │ │ ├── ReadOnlyTsFile.java │ │ ├── TsFileSequenceReader.java │ │ ├── UnClosedTsFileReader.java │ │ ├── common │ │ │ ├── BatchData.java │ │ │ ├── Chunk.java │ │ │ ├── Field.java │ │ │ ├── Path.java │ │ │ └── RowRecord.java │ │ ├── controller │ │ │ ├── ChunkLoader.java │ │ │ ├── ChunkLoaderImpl.java │ │ │ ├── MetadataQuerier.java │ │ │ └── MetadataQuerierByFileImpl.java │ │ ├── expression │ │ │ ├── ExpressionType.java │ │ │ ├── IBinaryExpression.java │ │ │ ├── IExpression.java │ │ │ ├── IUnaryExpression.java │ │ │ ├── QueryExpression.java │ │ │ ├── impl │ │ │ │ ├── BinaryExpression.java │ │ │ │ ├── GlobalTimeExpression.java │ │ │ │ └── SingleSeriesExpression.java │ │ │ └── util │ │ │ │ ├── ExpressionOptimizer.java │ │ │ │ └── ExpressionPrinter.java │ │ ├── filter │ │ │ ├── DigestForFilter.java │ │ │ ├── TimeFilter.java │ │ │ ├── ValueFilter.java │ │ │ ├── basic │ │ │ │ ├── BinaryFilter.java │ │ │ │ ├── Filter.java │ │ │ │ └── UnaryFilter.java │ │ │ ├── factory │ │ │ │ ├── FilterFactory.java │ │ │ │ └── FilterType.java │ │ │ └── operator │ │ │ │ ├── AndFilter.java │ │ │ │ ├── Eq.java │ │ │ │ ├── Gt.java │ │ │ │ ├── GtEq.java │ │ │ │ ├── Lt.java │ │ │ │ ├── LtEq.java │ │ │ │ ├── NotEq.java │ │ │ │ ├── NotFilter.java │ │ │ │ └── OrFilter.java │ │ ├── query │ │ │ ├── dataset │ │ │ │ ├── DataSetWithTimeGenerator.java │ │ │ │ ├── DataSetWithoutTimeGenerator.java │ │ │ │ └── QueryDataSet.java │ │ │ ├── executor │ │ │ │ ├── ExecutorWithTimeGenerator.java │ │ │ │ ├── QueryExecutor.java │ │ │ │ └── TsFileExecutor.java │ │ │ └── timegenerator │ │ │ │ ├── TimeGenerator.java │ │ │ │ ├── TimeGeneratorImpl.java │ │ │ │ └── node │ │ │ │ ├── AndNode.java │ │ │ │ ├── LeafNode.java │ │ │ │ ├── Node.java │ │ │ │ ├── NodeType.java │ │ │ │ └── OrNode.java │ │ └── reader │ │ │ ├── DefaultTsFileInput.java │ │ │ ├── TsFileInput.java │ │ │ ├── chunk │ │ │ ├── ChunkReader.java │ │ │ ├── ChunkReaderByTimestamp.java │ │ │ ├── ChunkReaderWithFilter.java │ │ │ └── ChunkReaderWithoutFilter.java │ │ │ ├── page │ │ │ └── PageReader.java │ │ │ └── series │ │ │ ├── FileSeriesReader.java │ │ │ ├── FileSeriesReaderWithFilter.java │ │ │ ├── FileSeriesReaderWithoutFilter.java │ │ │ └── SeriesReaderByTimestamp.java │ │ ├── utils │ │ ├── Binary.java │ │ ├── BytesUtils.java │ │ ├── Loader.java │ │ ├── Pair.java │ │ ├── PublicBAOS.java │ │ ├── ReadWriteForEncodingUtils.java │ │ ├── ReadWriteIOUtils.java │ │ └── StringContainer.java │ │ └── write │ │ ├── TsFileWriter.java │ │ ├── chunk │ │ ├── ChunkBuffer.java │ │ ├── ChunkGroupWriterImpl.java │ │ ├── ChunkWriterImpl.java │ │ ├── IChunkGroupWriter.java │ │ └── IChunkWriter.java │ │ ├── page │ │ └── PageWriter.java │ │ ├── record │ │ ├── TSRecord.java │ │ └── datapoint │ │ │ ├── BooleanDataPoint.java │ │ │ ├── DataPoint.java │ │ │ ├── DoubleDataPoint.java │ │ │ ├── FloatDataPoint.java │ │ │ ├── IntDataPoint.java │ │ │ ├── LongDataPoint.java │ │ │ └── StringDataPoint.java │ │ ├── schema │ │ ├── FileSchema.java │ │ ├── JsonConverter.java │ │ ├── MeasurementSchema.java │ │ └── SchemaBuilder.java │ │ └── writer │ │ ├── DefaultTsFileOutput.java │ │ ├── IDataWriter.java │ │ ├── TsFileIOWriter.java │ │ └── TsFileOutput.java └── resources │ └── tsfile-format.properties.template └── test ├── java └── org │ └── apache │ └── iotdb │ └── tsfile │ ├── common │ └── LRUCacheTest.java │ ├── compress │ ├── CompressTest.java │ └── SnappyTest.java │ ├── constant │ └── TimeseriesTestConstant.java │ ├── encoding │ ├── bitpacking │ │ ├── IntPackerTest.java │ │ └── LongPackerTest.java │ └── decoder │ │ ├── BitmapDecoderTest.java │ │ ├── FloatDecoderTest.java │ │ ├── GorillaDecoderTest.java │ │ ├── IntRleDecoderTest.java │ │ ├── LongRleDecoderTest.java │ │ └── delta │ │ ├── DeltaBinaryEncoderIntegerTest.java │ │ └── DeltaBinaryEncoderLongTest.java │ ├── file │ └── metadata │ │ ├── ChunkGroupMetaDataTest.java │ │ ├── ChunkMetaDataTest.java │ │ ├── TimeSeriesMetadataTest.java │ │ ├── TsDeviceMetadataIndexTest.java │ │ ├── TsDeviceMetadataTest.java │ │ ├── TsFileMetaDataTest.java │ │ ├── statistics │ │ ├── BooleanStatisticsTest.java │ │ ├── DoubleStatisticsTest.java │ │ ├── FloatStatisticsTest.java │ │ ├── IntegerStatisticsTest.java │ │ ├── LongStatisticsTest.java │ │ └── StringStatisticsTest.java │ │ └── utils │ │ ├── TestHelper.java │ │ └── Utils.java │ ├── read │ ├── ReadOnlyTsFileTest.java │ ├── ReadTest.java │ ├── TimePlainEncodeReadTest.java │ ├── common │ │ └── PathTest.java │ ├── controller │ │ ├── ChunkLoaderTest.java │ │ └── MetadataQuerierByFileImplTest.java │ ├── filter │ │ ├── DigestFilterTest.java │ │ ├── IExpressionOptimizerTest.java │ │ ├── MinTimeMaxTimeFilterTest.java │ │ └── OperatorTest.java │ ├── query │ │ ├── executor │ │ │ └── QueryExecutorTest.java │ │ └── timegenerator │ │ │ ├── NodeTest.java │ │ │ ├── ReaderByTimestampTest.java │ │ │ ├── TimeGeneratorTest.java │ │ │ └── TsFileGeneratorForSeriesReaderByTimestamp.java │ └── reader │ │ ├── PageReaderTest.java │ │ └── ReaderTest.java │ ├── utils │ ├── BytesUtilsTest.java │ ├── CommonTestConstant.java │ ├── FileGenerator.java │ ├── FileUtils.java │ ├── FileUtilsTest.java │ ├── PairTest.java │ ├── ReadWriteStreamUtilsTest.java │ ├── ReadWriteToBytesUtilsTest.java │ ├── RecordUtils.java │ ├── RecordUtilsTest.java │ ├── StringContainerTest.java │ └── TsFileGeneratorForTest.java │ └── write │ ├── PerfTest.java │ ├── ReadPageInMemTest.java │ ├── TsFileIOWriterTest.java │ ├── TsFileReadWriteTest.java │ ├── WriteTest.java │ ├── schema │ └── converter │ │ ├── JsonConverterTest.java │ │ └── SchemaBuilderTest.java │ └── series │ └── PageWriterTest.java └── resources ├── logback.xml ├── test_schema.json └── test_write_schema.json /.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | Steps to reproduce the behavior: 12 | 1. Go to '...' 13 | 2. Click on '....' 14 | 3. Scroll down to '....' 15 | 4. See error 16 | 17 | **Expected behavior** 18 | A clear and concise description of what you expected to happen. 19 | 20 | **Screenshots** 21 | If applicable, add screenshots to help explain your problem. 22 | 23 | **Desktop (please complete the following information):** 24 | - OS: [e.g. iOS] 25 | - Browser [e.g. chrome, safari] 26 | - Version [e.g. 22] 27 | 28 | 29 | 30 | **Additional context** 31 | Add any other context about the problem here. 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | 5 | --- 6 | 7 | 8 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 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 | 21 | distributionUrl=https://repo1.maven.org/maven2/org/apache/maven/apache-maven/3.5.0/apache-maven-3.5.0-bin.zip 22 | #wrapperUrl=https://repo1.maven.org/maven2/io/takari/maven-wrapper/0.2.1/maven-wrapper-0.2.1.jar 23 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org) 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # Since we don't have osx test environment, we use travis-ci to test on osx. 18 | # Free-plan of travis-ci offers limited resources, we only test whether iotdb can be packaged on jdk8 and jdk11. 19 | 20 | dist: trusty 21 | #sudo: required 22 | 23 | language: java 24 | 25 | matrix: 26 | include: 27 | - os: osx 28 | osx_image: xcode10.1 # with JDK11.0.1+13 installed 29 | - os: osx 30 | osx_image: xcode9.3 # with JDK1.8.0_112-b16 installed 31 | 32 | # skip `before_install` stage 33 | before_install: true 34 | 35 | # skip `install` stage 36 | install: true 37 | 38 | script: 39 | - mvn clean package -Dmaven.test.skip=true 40 | # For each test, travis-ci limits its output log. So we cannot test some sub-modules like tsfile, iotdb. 41 | # We only test jdbc to ensure maven commands work correctly on travis-ci. 42 | - mvn clean test -pl jdbc -am -Dtsfile.test.skip=true 43 | 44 | after_success: 45 | 46 | -------------------------------------------------------------------------------- /asf.header: -------------------------------------------------------------------------------- 1 | Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org) 2 | 3 | Licensed to the Apache Software Foundation (ASF) under one 4 | or more contributor license agreements. See the NOTICE file 5 | distributed with this work for additional information 6 | regarding copyright ownership. The ASF licenses this file 7 | to you under the Apache License, Version 2.0 (the 8 | "License"); you may not use this file except in compliance 9 | with the License. You may obtain a copy of the License at 10 | 11 | http://www.apache.org/licenses/LICENSE-2.0 12 | 13 | Unless required by applicable law or agreed to in writing, software 14 | distributed under the License is distributed on an "AS IS" BASIS, 15 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | See the License for the specific language governing permissions and 17 | limitations under the License. -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 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 | 21 | coverage: 22 | precision: 2 23 | round: down 24 | range: "70...100" 25 | 26 | status: 27 | project: yes 28 | patch: no 29 | changes: no 30 | 31 | ignore: 32 | # - "*/interface/thrift/**/*.java" # ignore thrift-gen folders and all its contents 33 | - "**/generated-classes/**/*.java" 34 | - "**/generated-sources/**/*.java" 35 | - "grafana/**/*.java" 36 | - "spark/**/*.java" 37 | - "hadoop/**/*.java" 38 | - "**/pom.xml" 39 | - "**/*.md" 40 | - "**/*.sh" 41 | - "**/*.cmd" 42 | - "**/*.bat" 43 | - "**/*.yml" 44 | - ".mvn" 45 | - "mvnw" 46 | - "NOTICE" 47 | - "NOTICE-binary" 48 | - "License" 49 | - "LICENSE-binary" 50 | -------------------------------------------------------------------------------- /grafana/conf/application.properties: -------------------------------------------------------------------------------- 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 | 21 | spring.datasource.url=jdbc:iotdb://127.0.0.1:6667/ 22 | spring.datasource.username=root 23 | spring.datasource.password=root 24 | spring.datasource.driver-class-name=org.apache.iotdb.jdbc.IoTDBDriver 25 | server.port=8888 -------------------------------------------------------------------------------- /grafana/img/add_data_source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thulab/iotdb/93727d8e3478ae387ed8ffe60f78a1c2e4a67694/grafana/img/add_data_source.png -------------------------------------------------------------------------------- /grafana/img/add_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thulab/iotdb/93727d8e3478ae387ed8ffe60f78a1c2e4a67694/grafana/img/add_graph.png -------------------------------------------------------------------------------- /grafana/img/edit_data_source.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thulab/iotdb/93727d8e3478ae387ed8ffe60f78a1c2e4a67694/grafana/img/edit_data_source.png -------------------------------------------------------------------------------- /grafana/src/main/java/org/apache/iotdb/web/grafana/TsfileWebDemoApplication.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.web.grafana; 21 | 22 | import org.springframework.boot.SpringApplication; 23 | import org.springframework.boot.autoconfigure.SpringBootApplication; 24 | 25 | @SpringBootApplication 26 | public class TsfileWebDemoApplication { 27 | 28 | public static void main(String[] args) 29 | throws ClassNotFoundException, IllegalAccessException, InstantiationException { 30 | SpringApplication.run(TsfileWebDemoApplication.class, args); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /grafana/src/main/java/org/apache/iotdb/web/grafana/bean/TimeValues.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.web.grafana.bean; 21 | 22 | /** 23 | * Created by dell on 2017/7/18. 24 | */ 25 | public class TimeValues { 26 | 27 | private long time; 28 | private float value; 29 | 30 | @Override 31 | public String toString() { 32 | return "TimeValues{" + "time=" + time + ", values=" + value + '}'; 33 | } 34 | 35 | public long getTime() { 36 | return time; 37 | } 38 | 39 | public void setTime(long time) { 40 | this.time = time; 41 | } 42 | 43 | public float getValue() { 44 | return value; 45 | } 46 | 47 | public void setValue(float value) { 48 | this.value = value; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /grafana/src/main/java/org/apache/iotdb/web/grafana/dao/BasicDao.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.web.grafana.dao; 21 | 22 | import java.time.ZonedDateTime; 23 | import java.util.List; 24 | import org.apache.iotdb.tsfile.utils.Pair; 25 | import org.apache.iotdb.web.grafana.bean.TimeValues; 26 | 27 | /** 28 | * Created by dell on 2017/7/17. 29 | */ 30 | public interface BasicDao { 31 | 32 | List querySeries(String s, Pair timeRange); 33 | 34 | List getMetaData(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /grafana/src/main/java/org/apache/iotdb/web/grafana/service/DatabaseConnectService.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.web.grafana.service; 21 | 22 | import java.time.ZonedDateTime; 23 | import java.util.List; 24 | import org.apache.iotdb.tsfile.utils.Pair; 25 | import org.apache.iotdb.web.grafana.bean.TimeValues; 26 | 27 | public interface DatabaseConnectService { 28 | 29 | int testConnection(); 30 | 31 | List querySeries(String s, Pair timeRange); 32 | 33 | List getMetaData(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /hadoop/README.md: -------------------------------------------------------------------------------- 1 | # tsfile-hadoop-connector 2 | -------------------------------------------------------------------------------- /iotdb-cli/cli/bin/run-client.bat: -------------------------------------------------------------------------------- 1 | @REM 2 | @REM Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org) 3 | @REM 4 | @REM Licensed to the Apache Software Foundation (ASF) under one 5 | @REM or more contributor license agreements. See the NOTICE file 6 | @REM distributed with this work for additional information 7 | @REM regarding copyright ownership. The ASF licenses this file 8 | @REM to you under the Apache License, Version 2.0 (the 9 | @REM "License"); you may not use this file except in compliance 10 | @REM with the License. You may obtain a copy of the License at 11 | @REM 12 | @REM http://www.apache.org/licenses/LICENSE-2.0 13 | @REM 14 | @REM Unless required by applicable law or agreed to in writing, software 15 | @REM distributed under the License is distributed on an "AS IS" BASIS, 16 | @REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | @REM See the License for the specific language governing permissions and 18 | @REM limitations under the License. 19 | @REM 20 | 21 | .\start-client.bat -h localhost -p 6667 -u root -pw root -------------------------------------------------------------------------------- /iotdb-cli/src/main/java/org/apache/iotdb/cli/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.cli.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/iotdb/bin/stop-postBackClient.bat: -------------------------------------------------------------------------------- 1 | @REM 2 | @REM Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org) 3 | @REM 4 | @REM Licensed to the Apache Software Foundation (ASF) under one 5 | @REM or more contributor license agreements. See the NOTICE file 6 | @REM distributed with this work for additional information 7 | @REM regarding copyright ownership. The ASF licenses this file 8 | @REM to you under the Apache License, Version 2.0 (the 9 | @REM "License"); you may not use this file except in compliance 10 | @REM with the License. You may obtain a copy of the License at 11 | @REM 12 | @REM http://www.apache.org/licenses/LICENSE-2.0 13 | @REM 14 | @REM Unless required by applicable law or agreed to in writing, software 15 | @REM distributed under the License is distributed on an "AS IS" BASIS, 16 | @REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | @REM See the License for the specific language governing permissions and 18 | @REM limitations under the License. 19 | @REM 20 | 21 | @echo off 22 | 23 | wmic process where (commandline like "%%postBackClient%%" and not name="wmic.exe") delete 24 | rem ps ax | grep -i 'postBackClient' | grep -v grep | awk '{print $1}' | xargs kill -SIGTERM -------------------------------------------------------------------------------- /iotdb/iotdb/bin/stop-postBackClient.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 | 23 | PIDS=$(ps ax | grep -i 'postBackClient' | grep java | grep -v grep | awk '{print $1}') 24 | 25 | if [ -z "$PIDS" ]; then 26 | echo "No post back Client to stop" 27 | exit 1 28 | else 29 | kill -s TERM $PIDS 30 | echo "close PostBackClient" 31 | fi 32 | -------------------------------------------------------------------------------- /iotdb/iotdb/bin/stop-server.bat: -------------------------------------------------------------------------------- 1 | @REM 2 | @REM Copyright © 2019 Apache IoTDB(incubating) (dev@iotdb.apache.org) 3 | @REM 4 | @REM Licensed to the Apache Software Foundation (ASF) under one 5 | @REM or more contributor license agreements. See the NOTICE file 6 | @REM distributed with this work for additional information 7 | @REM regarding copyright ownership. The ASF licenses this file 8 | @REM to you under the Apache License, Version 2.0 (the 9 | @REM "License"); you may not use this file except in compliance 10 | @REM with the License. You may obtain a copy of the License at 11 | @REM 12 | @REM http://www.apache.org/licenses/LICENSE-2.0 13 | @REM 14 | @REM Unless required by applicable law or agreed to in writing, software 15 | @REM distributed under the License is distributed on an "AS IS" BASIS, 16 | @REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | @REM See the License for the specific language governing permissions and 18 | @REM limitations under the License. 19 | @REM 20 | 21 | @echo off 22 | 23 | wmic process where (commandline like "%%iotdb.IoTDB%%" and not name="wmic.exe") delete 24 | rem ps ax | grep -i 'iotdb.IoTDB' | grep -v grep | awk '{print $1}' | xargs kill -SIGTERM 25 | -------------------------------------------------------------------------------- /iotdb/iotdb/bin/stop-server.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 | 23 | PIDS=$(ps ax | grep -i 'IoTDB' | grep java | grep -v grep | awk '{print $1}') 24 | 25 | if [ -z "$PIDS" ]; then 26 | echo "No IoTDB server to stop" 27 | exit 1 28 | else 29 | kill -s TERM $PIDS 30 | echo "close IoTDB" 31 | fi 32 | -------------------------------------------------------------------------------- /iotdb/iotdb/conf/error_info_cn.properties: -------------------------------------------------------------------------------- 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 | 21 | 20000=未知错误 22 | 20001=语句中无变量 23 | 20002=无效的变量 24 | 20003=无法连接到服务器:%s (%s) 25 | 20061=验证失败:%S 26 | 20062=不安全的函数调用:%s 27 | 20064=M客户端内存溢出 28 | 20130=语句未就绪 29 | 20220=连接失败 -------------------------------------------------------------------------------- /iotdb/iotdb/conf/error_info_en.properties: -------------------------------------------------------------------------------- 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 | 21 | 20000=Unknown error 22 | 20001=No parameters exist in the statement 23 | 20002=Invalid parameter number 24 | 20003=Can't connect to server on %s(%s) 25 | 20061=Authentication failed: %s 26 | 20062=Insecure API function call: %s 27 | 20064=Client ran out of memory 28 | 20130=Statement not prepared 29 | 20220=Fail to connect. -------------------------------------------------------------------------------- /iotdb/iotdb/conf/iotdb-postbackClient.properties: -------------------------------------------------------------------------------- 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 | 21 | server_ip=127.0.0.1 22 | # PostBack server port address 23 | server_port=5555 24 | # PostBack client port 25 | client_port=6666 26 | # The cycle time of post data back to receiver, the unit of time is second 27 | upload_cycle_in_seconds=600 28 | # Set bufferWrite data absolute path of IoTDB 29 | # It needs to be set with iotdb_schema_directory, they have to belong to the same IoTDB 30 | # iotdb_bufferWrite_directory = D:\\iotdb\\data\\data\\settled 31 | # Set schema file absolute path of IoTDB 32 | # It needs to be set with iotdb_bufferWrite_directory, they have to belong to the same IoTDB 33 | # iotdb_schema_directory = D:\\iotdb\\data\\system\\schema\\mlog.txt 34 | -------------------------------------------------------------------------------- /iotdb/src/main/java/org/apache/iotdb/db/auth/role/LocalFileRoleManager.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.auth.role; 21 | 22 | public class LocalFileRoleManager extends BasicRoleManager { 23 | 24 | public LocalFileRoleManager(String roleDirPath) { 25 | super(new LocalFileRoleAccessor(roleDirPath)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /iotdb/src/main/java/org/apache/iotdb/db/auth/user/LocalFileUserManager.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.auth.user; 21 | 22 | import org.apache.iotdb.db.auth.AuthException; 23 | 24 | public class LocalFileUserManager extends BasicUserManager { 25 | 26 | public LocalFileUserManager(String userDirPath) throws AuthException { 27 | super(new LocalFileUserAccessor(userDirPath)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /iotdb/src/main/java/org/apache/iotdb/db/concurrent/IoTDBDefaultThreadExceptionHandler.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.concurrent; 21 | 22 | import org.slf4j.Logger; 23 | import org.slf4j.LoggerFactory; 24 | 25 | public class IoTDBDefaultThreadExceptionHandler implements Thread.UncaughtExceptionHandler { 26 | 27 | private static final Logger LOGGER = LoggerFactory 28 | .getLogger(IoTDBDefaultThreadExceptionHandler.class); 29 | 30 | public IoTDBDefaultThreadExceptionHandler() { 31 | } 32 | 33 | @Override 34 | public void uncaughtException(Thread t, Throwable e) { 35 | LOGGER.error("Exception in thread {}-{}", t.getName(), t.getId(), e); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /iotdb/src/main/java/org/apache/iotdb/db/conf/directories/strategy/SequenceStrategy.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.conf.directories.strategy; 21 | 22 | import java.util.List; 23 | 24 | public class SequenceStrategy extends DirectoryStrategy { 25 | 26 | private int currentIndex; 27 | 28 | @Override 29 | public void init(List 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 34 | */ 35 | List 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 | } --------------------------------------------------------------------------------