├── .github ├── issue_template.md ├── pull_request_template.md └── workflows │ ├── pr-validation-test-core.yml │ ├── pr-validation-test-other.yml │ └── pr-validation.yml ├── .gitignore ├── Jenkinsfile ├── LICENSE ├── README.md ├── checkstyle.xml ├── docs ├── herddb.graphml └── herddb.png ├── excludeFindBugsFilter.xml ├── herddb-backward-compatibility ├── nb-configuration.xml ├── pom.xml └── src │ └── test │ ├── java │ └── herddb │ │ └── upgrade │ │ ├── RunHerdDB070Test.java │ │ ├── UpgradeFrom050WithBrinIndexesTest.java │ │ └── ZIPUtils.java │ └── resources │ └── herddb │ └── upgrade │ ├── dbdata_0.5.0_brin_indexes_after_checkpoint.zip │ ├── dbdata_0.5.0_brin_indexes_nevercheckpointed.zip │ └── herddb.070.joinerror.zip ├── herddb-bench ├── pom.xml └── src │ └── test │ └── java │ └── herddb │ └── benchs │ ├── BaseBench.java │ ├── BaseTableDefinition.java │ ├── InsertOperation.java │ ├── Operation.java │ ├── SelectByPKOperation.java │ ├── UpdateByPKOperation.java │ ├── backuprestore │ └── HugeTableRestoreTest.java │ └── simple │ ├── ConcurrentReadsUpdatesBookKeeperTest.java │ ├── ConcurrentReadsUpdatesTest.java │ ├── ConcurrentUpdatesBookKeeperTest.java │ ├── ConcurrentUpdatesTest.java │ ├── HugeTableBookKeeperTest.java │ └── HugeTableTest.java ├── herddb-cli ├── pom.xml └── src │ ├── main │ └── java │ │ └── herddb │ │ └── cli │ │ ├── CounterInputStream.java │ │ ├── HerdDBCLI.java │ │ ├── MySqlDumpInsertStatementRewriter.java │ │ ├── QueryWithParameters.java │ │ ├── SQLFileParser.java │ │ ├── TableSpaceMapper.java │ │ └── TextTableBuilder.java │ └── test │ ├── java │ └── herddb │ │ └── cli │ │ ├── MySqlDumpInsertStatementRewriterTest.java │ │ ├── SQLFileParserTest.java │ │ └── TableSpaceMapperTest.java │ └── resources │ └── test.sql ├── herddb-collections ├── nb-configuration.xml ├── nbactions.xml ├── pom.xml └── src │ ├── main │ └── java │ │ └── herddb │ │ └── collections │ │ ├── BiSink.java │ │ ├── CollectionsException.java │ │ ├── CollectionsManager.java │ │ ├── Sink.java │ │ ├── SinkException.java │ │ ├── TmpMap.java │ │ ├── TmpMapImpl.java │ │ └── ValueSerializer.java │ └── test │ └── java │ └── herddb │ └── collections │ ├── SwapOnDiskTest.java │ └── TmpMapTest.java ├── herddb-core ├── nb-configuration.xml ├── nbactions.xml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── herddb │ │ │ ├── backup │ │ │ ├── BackupFileConstants.java │ │ │ ├── BackupUtils.java │ │ │ ├── DumpedLogEntry.java │ │ │ ├── DumpedTableMetadata.java │ │ │ ├── ProgressListener.java │ │ │ ├── TableSpaceDumpFileWriter.java │ │ │ └── TableSpaceRestoreSourceFromFile.java │ │ │ ├── cdc │ │ │ └── ChangeDataCapture.java │ │ │ ├── client │ │ │ ├── ClientConfiguration.java │ │ │ ├── ClientSideConnectionPeer.java │ │ │ ├── ClientSideMetadataProvider.java │ │ │ ├── ClientSideMetadataProviderException.java │ │ │ ├── ClientSideQueryCache.java │ │ │ ├── DMLResult.java │ │ │ ├── GetResult.java │ │ │ ├── HDBClient.java │ │ │ ├── HDBConnection.java │ │ │ ├── HDBException.java │ │ │ ├── NonMarshallingClientSideConnectionPeer.java │ │ │ ├── RoutedClientSideConnection.java │ │ │ ├── ScanResultSet.java │ │ │ ├── ScanResultSetMetadata.java │ │ │ ├── TableSpaceDumpReceiver.java │ │ │ ├── TableSpaceRestoreSource.java │ │ │ ├── ZookeeperClientSideMetadataProvider.java │ │ │ └── impl │ │ │ │ ├── EmptyScanResultSet.java │ │ │ │ ├── HDBOperationTimeoutException.java │ │ │ │ ├── LeaderChangedException.java │ │ │ │ ├── MapListScanResultSet.java │ │ │ │ ├── RetryRequestException.java │ │ │ │ ├── SingletonScanResultSet.java │ │ │ │ └── UnreachableServerException.java │ │ │ ├── cluster │ │ │ ├── BookKeeperDataStorageManager.java │ │ │ ├── BookkeeperCommitLog.java │ │ │ ├── BookkeeperCommitLogManager.java │ │ │ ├── EmbeddedBookie.java │ │ │ ├── LedgersInfo.java │ │ │ ├── PreferLocalBookiePlacementPolicy.java │ │ │ └── ZookeeperMetadataStorageManager.java │ │ │ ├── codec │ │ │ ├── DataAccessorForFullRecord.java │ │ │ └── RecordSerializer.java │ │ │ ├── core │ │ │ ├── AbstractIndexManager.java │ │ │ ├── AbstractTableManager.java │ │ │ ├── ActivatorRunRequest.java │ │ │ ├── DBManager.java │ │ │ ├── DataPage.java │ │ │ ├── InStreamTupleSorter.java │ │ │ ├── LocalScanPageCache.java │ │ │ ├── MaterializedRecordSet.java │ │ │ ├── MemoryManager.java │ │ │ ├── PageSet.java │ │ │ ├── PostCheckpointAction.java │ │ │ ├── RecordSetFactory.java │ │ │ ├── ReplicaFullTableDataDumpReceiver.java │ │ │ ├── RunningStatementInfo.java │ │ │ ├── RunningStatementsStats.java │ │ │ ├── SimpleDataScanner.java │ │ │ ├── SingleTableDumper.java │ │ │ ├── StreamDataScanner.java │ │ │ ├── TableManager.java │ │ │ ├── TableSpaceManager.java │ │ │ ├── join │ │ │ │ └── DataScannerJoinExecutor.java │ │ │ ├── stats │ │ │ │ ├── ConnectionsInfo.java │ │ │ │ ├── ConnectionsInfoProvider.java │ │ │ │ ├── TableManagerStats.java │ │ │ │ └── TableSpaceManagerStats.java │ │ │ └── system │ │ │ │ ├── AbstractSystemTableManager.java │ │ │ │ ├── SysclientsTableManager.java │ │ │ │ ├── SyscolumnsTableManager.java │ │ │ │ ├── SysconfigTableManager.java │ │ │ │ ├── SysdualTableManager.java │ │ │ │ ├── SysforeignkeysTableManager.java │ │ │ │ ├── SysindexcolumnsTableManager.java │ │ │ │ ├── SysindexesTableManager.java │ │ │ │ ├── SyslogstatusManager.java │ │ │ │ ├── SysnodesTableManager.java │ │ │ │ ├── SysstatementsTableManager.java │ │ │ │ ├── SystablesTableManager.java │ │ │ │ ├── SystablespacereplicastateTableManager.java │ │ │ │ ├── SystablespacesTableManager.java │ │ │ │ ├── SystablestatsTableManager.java │ │ │ │ └── SystransactionsTableManager.java │ │ │ ├── data │ │ │ └── consistency │ │ │ │ ├── DigestNotAvailableException.java │ │ │ │ ├── TableChecksum.java │ │ │ │ └── TableDataChecksum.java │ │ │ ├── file │ │ │ ├── FileBasedUserManager.java │ │ │ ├── FileCommitLog.java │ │ │ ├── FileCommitLogManager.java │ │ │ ├── FileDataStorageManager.java │ │ │ ├── FileMetadataStorageManager.java │ │ │ ├── FileRecordSet.java │ │ │ └── FileRecordSetFactory.java │ │ │ ├── index │ │ │ ├── ConcurrentMapKeyToPageIndex.java │ │ │ ├── IndexOperation.java │ │ │ ├── KeyToPageIndex.java │ │ │ ├── MemoryHashIndexManager.java │ │ │ ├── PrimaryIndexPrefixScan.java │ │ │ ├── PrimaryIndexRangeScan.java │ │ │ ├── PrimaryIndexSeek.java │ │ │ ├── SecondaryIndexPrefixScan.java │ │ │ ├── SecondaryIndexRangeScan.java │ │ │ ├── SecondaryIndexSeek.java │ │ │ ├── blink │ │ │ │ └── BLinkKeyToPageIndex.java │ │ │ └── brin │ │ │ │ ├── BRINIndexManager.java │ │ │ │ ├── BlockRangeIndex.java │ │ │ │ ├── BlockRangeIndexMetadata.java │ │ │ │ ├── IndexDataStorage.java │ │ │ │ └── MemoryIndexDataStorage.java │ │ │ ├── jmx │ │ │ ├── DBManagerStatsMXBean.java │ │ │ ├── JMXUtils.java │ │ │ ├── TableManagerStatsMXBean.java │ │ │ └── TableSpaceManagerStatsMXBean.java │ │ │ ├── log │ │ │ ├── CommitLog.java │ │ │ ├── CommitLogListener.java │ │ │ ├── CommitLogManager.java │ │ │ ├── CommitLogResult.java │ │ │ ├── FullRecoveryNeededException.java │ │ │ ├── LogEntry.java │ │ │ ├── LogEntryFactory.java │ │ │ ├── LogEntryType.java │ │ │ ├── LogNotAvailableException.java │ │ │ └── LogSequenceNumber.java │ │ │ ├── mem │ │ │ ├── MemoryCommitLogManager.java │ │ │ ├── MemoryDataStorageManager.java │ │ │ ├── MemoryLocalNodeIdManager.java │ │ │ ├── MemoryMetadataStorageManager.java │ │ │ ├── MemoryRecordSet.java │ │ │ └── MemoryRecordSetFactory.java │ │ │ ├── metadata │ │ │ ├── MetadataChangeListener.java │ │ │ ├── MetadataStorageManager.java │ │ │ ├── MetadataStorageManagerException.java │ │ │ └── NodeIdGenerator.java │ │ │ ├── model │ │ │ ├── Aggregator.java │ │ │ ├── AlterFailedException.java │ │ │ ├── AutoIncrementPrimaryKeyRecordFunction.java │ │ │ ├── Column.java │ │ │ ├── ColumnTypes.java │ │ │ ├── ColumnsList.java │ │ │ ├── ConstValueRecordFunction.java │ │ │ ├── DDLException.java │ │ │ ├── DDLStatement.java │ │ │ ├── DDLStatementExecutionResult.java │ │ │ ├── DMLStatement.java │ │ │ ├── DMLStatementExecutionResult.java │ │ │ ├── DataConsistencyStatementResult.java │ │ │ ├── DataScanner.java │ │ │ ├── DataScannerException.java │ │ │ ├── DuplicatePrimaryKeyException.java │ │ │ ├── ExecutionPlan.java │ │ │ ├── ForeignKeyDef.java │ │ │ ├── ForeignKeyViolationException.java │ │ │ ├── FullTableScanPredicate.java │ │ │ ├── GetResult.java │ │ │ ├── Index.java │ │ │ ├── IndexAlreadyExistsException.java │ │ │ ├── IndexDoesNotExistException.java │ │ │ ├── InvalidNullValueForKeyException.java │ │ │ ├── InvalidTableException.java │ │ │ ├── InvalidTableSpaceException.java │ │ │ ├── LimitedDataScanner.java │ │ │ ├── MissingJDBCParameterException.java │ │ │ ├── NodeMetadata.java │ │ │ ├── NotLeaderException.java │ │ │ ├── Predicate.java │ │ │ ├── Projection.java │ │ │ ├── Record.java │ │ │ ├── RecordFunction.java │ │ │ ├── RecordTooBigException.java │ │ │ ├── ScanLimits.java │ │ │ ├── ScanLimitsImpl.java │ │ │ ├── ScanResult.java │ │ │ ├── Statement.java │ │ │ ├── StatementEvaluationContext.java │ │ │ ├── StatementExecutionException.java │ │ │ ├── StatementExecutionResult.java │ │ │ ├── Table.java │ │ │ ├── TableAlreadyExistsException.java │ │ │ ├── TableAwareStatement.java │ │ │ ├── TableContext.java │ │ │ ├── TableDoesNotExistException.java │ │ │ ├── TableSpace.java │ │ │ ├── TableSpaceAlreadyExistsException.java │ │ │ ├── TableSpaceDoesNotExistException.java │ │ │ ├── TableSpaceReplicaState.java │ │ │ ├── Transaction.java │ │ │ ├── TransactionContext.java │ │ │ ├── TransactionResult.java │ │ │ ├── Tuple.java │ │ │ ├── TupleComparator.java │ │ │ ├── UniqueIndexContraintViolationException.java │ │ │ ├── commands │ │ │ │ ├── AlterTableSpaceStatement.java │ │ │ │ ├── AlterTableStatement.java │ │ │ │ ├── BeginTransactionStatement.java │ │ │ │ ├── CommitTransactionStatement.java │ │ │ │ ├── CreateIndexStatement.java │ │ │ │ ├── CreateTableSpaceStatement.java │ │ │ │ ├── CreateTableStatement.java │ │ │ │ ├── DeleteStatement.java │ │ │ │ ├── DropIndexStatement.java │ │ │ │ ├── DropTableSpaceStatement.java │ │ │ │ ├── DropTableStatement.java │ │ │ │ ├── GetStatement.java │ │ │ │ ├── InsertStatement.java │ │ │ │ ├── RollbackTransactionStatement.java │ │ │ │ ├── SQLPlannedOperationStatement.java │ │ │ │ ├── ScanStatement.java │ │ │ │ ├── TableConsistencyCheckStatement.java │ │ │ │ ├── TableSpaceConsistencyCheckStatement.java │ │ │ │ ├── TruncateTableStatement.java │ │ │ │ └── UpdateStatement.java │ │ │ ├── planner │ │ │ │ ├── AggregateOp.java │ │ │ │ ├── BindableTableScanOp.java │ │ │ │ ├── ConcatenatedDataAccessor.java │ │ │ │ ├── DeleteOp.java │ │ │ │ ├── EnumerableDataScanner.java │ │ │ │ ├── FilterOp.java │ │ │ │ ├── FilteredTableScanOp.java │ │ │ │ ├── InsertOp.java │ │ │ │ ├── JoinKey.java │ │ │ │ ├── JoinOp.java │ │ │ │ ├── LimitOp.java │ │ │ │ ├── LimitedBindableTableScanOp.java │ │ │ │ ├── LimitedSortedBindableTableScanOp.java │ │ │ │ ├── NestedLoopJoinOp.java │ │ │ │ ├── PlannerOp.java │ │ │ │ ├── ProjectOp.java │ │ │ │ ├── ProjectedTableScanOp.java │ │ │ │ ├── ReplaceOp.java │ │ │ │ ├── SemiJoinOp.java │ │ │ │ ├── SimpleDeleteOp.java │ │ │ │ ├── SimpleInsertOp.java │ │ │ │ ├── SimpleScanOp.java │ │ │ │ ├── SimpleUpdateOp.java │ │ │ │ ├── SortOp.java │ │ │ │ ├── SortedBindableTableScanOp.java │ │ │ │ ├── SortedTableScanOp.java │ │ │ │ ├── TableScanOp.java │ │ │ │ ├── UnionAllOp.java │ │ │ │ ├── UpdateOp.java │ │ │ │ └── ValuesOp.java │ │ │ └── predicates │ │ │ │ ├── RawKeyEquals.java │ │ │ │ └── RawValueEquals.java │ │ │ ├── security │ │ │ ├── SimpleSingleUserManager.java │ │ │ ├── UserManager.java │ │ │ └── sasl │ │ │ │ ├── DigestLoginModule.java │ │ │ │ ├── PlainSaslServerProvider.java │ │ │ │ ├── SaslNettyClient.java │ │ │ │ ├── SaslNettyServer.java │ │ │ │ └── SaslUtils.java │ │ │ ├── server │ │ │ ├── LocalClientScanResultSetImpl.java │ │ │ ├── LocalNodeIdManager.java │ │ │ ├── Server.java │ │ │ ├── ServerConfiguration.java │ │ │ ├── ServerSideConnectionPeer.java │ │ │ ├── ServerSidePreparedStatementCache.java │ │ │ ├── ServerSideScannerPeer.java │ │ │ └── StaticClientSideMetadataProvider.java │ │ │ ├── sql │ │ │ ├── AbstractSQLPlanner.java │ │ │ ├── AggregatedColumnCalculator.java │ │ │ ├── CalciteEnumUtils.java │ │ │ ├── CalcitePlanner.java │ │ │ ├── CompatibilityUtils.java │ │ │ ├── ImmutableExpressionsCache.java │ │ │ ├── IndexUtils.java │ │ │ ├── JSQLParserPlanner.java │ │ │ ├── NullSQLPlanner.java │ │ │ ├── PlansCache.java │ │ │ ├── SQLRecordFunction.java │ │ │ ├── SQLRecordKeyFunction.java │ │ │ ├── SQLRecordPredicate.java │ │ │ ├── SQLStatementEvaluationContext.java │ │ │ ├── TableRef.java │ │ │ ├── TranslatedQuery.java │ │ │ ├── expressions │ │ │ │ ├── AccessCorrelVariableExpression.java │ │ │ │ ├── AccessCurrentRowExpression.java │ │ │ │ ├── AccessFieldExpression.java │ │ │ │ ├── BindableTableScanColumnNameResolver.java │ │ │ │ ├── CastExpression.java │ │ │ │ ├── ColumnExpression.java │ │ │ │ ├── ColumnRef.java │ │ │ │ ├── CompiledAddExpression.java │ │ │ │ ├── CompiledAndExpression.java │ │ │ │ ├── CompiledBinarySQLExpression.java │ │ │ │ ├── CompiledCaseExpression.java │ │ │ │ ├── CompiledDivideExpression.java │ │ │ │ ├── CompiledDivideIntExpression.java │ │ │ │ ├── CompiledEqualsExpression.java │ │ │ │ ├── CompiledFunction.java │ │ │ │ ├── CompiledGreaterThanEqualsExpression.java │ │ │ │ ├── CompiledGreaterThanExpression.java │ │ │ │ ├── CompiledInExpression.java │ │ │ │ ├── CompiledIsNotTrueExpression.java │ │ │ │ ├── CompiledIsNullExpression.java │ │ │ │ ├── CompiledLikeExpression.java │ │ │ │ ├── CompiledMinorThanEqualsExpression.java │ │ │ │ ├── CompiledMinorThanExpression.java │ │ │ │ ├── CompiledModuloExpression.java │ │ │ │ ├── CompiledMultiAndExpression.java │ │ │ │ ├── CompiledMultiOrExpression.java │ │ │ │ ├── CompiledMultiplyExpression.java │ │ │ │ ├── CompiledNotEqualsExpression.java │ │ │ │ ├── CompiledNotExpression.java │ │ │ │ ├── CompiledOrExpression.java │ │ │ │ ├── CompiledParenthesisExpression.java │ │ │ │ ├── CompiledSQLExpression.java │ │ │ │ ├── CompiledSQLExpressionUsingRightJdbcParameter.java │ │ │ │ ├── CompiledSignedExpression.java │ │ │ │ ├── CompiledSubtractExpression.java │ │ │ │ ├── ConstantExpression.java │ │ │ │ ├── JdbcParameterExpression.java │ │ │ │ ├── OpSchema.java │ │ │ │ ├── SQLExpressionCompiler.java │ │ │ │ ├── SQLParserExpressionCompiler.java │ │ │ │ └── TypedJdbcParameterExpression.java │ │ │ └── functions │ │ │ │ ├── AbstractSingleExpressionArgumentColumnCalculator.java │ │ │ │ ├── AvgColumnCalculator.java │ │ │ │ ├── BuiltinFunctions.java │ │ │ │ ├── ColumnValue.java │ │ │ │ ├── CountColumnCalculator.java │ │ │ │ ├── FloatingPointAvgColumnCalculator.java │ │ │ │ ├── MaxColumnCalculator.java │ │ │ │ ├── MinColumnCalculator.java │ │ │ │ ├── ShowCreateTableCalculator.java │ │ │ │ ├── SingleValueCalculator.java │ │ │ │ └── SumColumnCalculator.java │ │ │ ├── storage │ │ │ ├── DataPageDoesNotExistException.java │ │ │ ├── DataStorageManager.java │ │ │ ├── DataStorageManagerException.java │ │ │ ├── FullIndexScanConsumer.java │ │ │ ├── FullTableScanConsumer.java │ │ │ ├── IndexStatus.java │ │ │ └── TableStatus.java │ │ │ └── utils │ │ │ ├── ObjectSizeUtils.java │ │ │ ├── QueryParser.java │ │ │ └── QueryUtils.java │ └── resources │ │ ├── META-INF │ │ └── herddb.version.properties │ │ └── herddb │ │ └── metadata │ │ └── nodeidslist.txt │ └── test │ ├── java │ └── herddb │ │ ├── cdc │ │ └── SimpleCDCTest.java │ │ ├── client │ │ ├── SimpleClientServerTest.java │ │ ├── SimpleLocalModeTest.java │ │ └── ZookeeperClientSideMetadataProviderTest.java │ │ ├── cluster │ │ ├── BackupRestoreTest.java │ │ ├── ExpectedReplicaCountTest.java │ │ ├── MultiServerCreateTableSpaceWaitTest.java │ │ ├── PreferLocalBookiePlacementPolicyTest.java │ │ ├── RestartPendingTransactionBookKeeperTest.java │ │ ├── RetryOnLeaderChangedTest.java │ │ ├── ServerWithDynamicPortTest.java │ │ ├── TablespaceReplicasStateTest.java │ │ ├── WaitForBookiesTest.java │ │ ├── ZookeeperMetadataStorageManagerTest.java │ │ ├── bookkeeper │ │ │ ├── BookKeeperCommitLogTest.java │ │ │ ├── BookKeeperDataStorageManagerRestartTest.java │ │ │ ├── BookieNotAvailableTest.java │ │ │ ├── BookkeeperFailuresBase.java │ │ │ ├── FencingTest.java │ │ │ ├── LedgerClosedTest.java │ │ │ └── MultiBookieTest.java │ │ └── follower │ │ │ ├── BootAsNewLeaderTest.java │ │ │ ├── BootFollowerTest.java │ │ │ ├── ChangeRoleTest.java │ │ │ ├── EdgeCasesFollowerTest.java │ │ │ ├── MultiServerBase.java │ │ │ └── SimpleFollowerTest.java │ │ ├── codec │ │ └── RecordSerializerTest.java │ │ ├── core │ │ ├── AutoIncrementTest.java │ │ ├── AutoTransactionTest.java │ │ ├── AutocheckPointTest.java │ │ ├── BaseTestcase.java │ │ ├── BigTableScanTest.java │ │ ├── CheckpointTest.java │ │ ├── CreateTableNoDefinitionTest.java │ │ ├── CreateTableTest.java │ │ ├── DeleteTest.java │ │ ├── DropOldPagesTest.java │ │ ├── DropTableSQLTest.java │ │ ├── DropTablespaceTest.java │ │ ├── FileDataStorageManagerRestartTest.java │ │ ├── FileRecordSetTest.java │ │ ├── FlushFileTest.java │ │ ├── FlushMemTest.java │ │ ├── GetTest.java │ │ ├── HeapTest.java │ │ ├── LocalTableSnapshotRecoveryTest.java │ │ ├── MemoryCountersTest.java │ │ ├── MemoryRecordSetTest.java │ │ ├── MultipleColumnPrimaryKeyTest.java │ │ ├── NewPageTest.java │ │ ├── PrimaryIndexPrefixScanTest.java │ │ ├── PrimaryIndexScanRangeTest.java │ │ ├── ProfileEqualsAllocationsTest.java │ │ ├── RecordSetSuite.java │ │ ├── RecordTooBigTest.java │ │ ├── ReplicatedAlterTableTest.java │ │ ├── ReplicatedLogtestcase.java │ │ ├── RestartPendingTransactionBase.java │ │ ├── RestartPendingTransactionFileTest.java │ │ ├── RestartTestBase.java │ │ ├── SQLMultiRowMutationTest.java │ │ ├── ScanDuringCheckPointTest.java │ │ ├── ScanTest.java │ │ ├── SelectCountTest.java │ │ ├── SimpleBrinIndexRecoveryTest.java │ │ ├── SimpleClusterDisklessTest.java │ │ ├── SimpleClusterTest.java │ │ ├── SimpleDMLFileTest.java │ │ ├── SimpleDMLTest.java │ │ ├── SimpleIHashIndexRecoveryTest.java │ │ ├── SimpleIndexAccessTest.java │ │ ├── SimpleRecoveryTest.java │ │ ├── SimpleReplicationTest.java │ │ ├── SimpleTransactionTest.java │ │ ├── SysnodesTest.java │ │ ├── SystemTablesJoinTest.java │ │ ├── TestUtils.java │ │ ├── UnderreplicationTest.java │ │ ├── UnloadDirtyPageTest.java │ │ └── indexes │ │ │ ├── BrinNonUniqueIndexAccessTest.java │ │ │ ├── BrinUniqueIndexAccessTest.java │ │ │ ├── HashNonUniqueIndexAccessTest.java │ │ │ ├── HashUniqueIndexAccessTest.java │ │ │ ├── IndexCreationTest.java │ │ │ ├── IndexScanRangeTest.java │ │ │ ├── SecondaryNonUniqueIndexAccessSuite.java │ │ │ └── SecondaryUniqueIndexAccessSuite.java │ │ ├── data │ │ └── consistency │ │ │ ├── ConsistencyCheckDuringRecoveryTest.java │ │ │ ├── DataConsistencyCheckTest.java │ │ │ └── MultiNodeConsistencyCheckTest.java │ │ ├── file │ │ ├── CleanupOnCheckPointTest.java │ │ ├── FileCommitLogTest.java │ │ └── FileDataStorageManagerTest.java │ │ ├── index │ │ ├── BLinkKeyToPageIndexTest.java │ │ ├── ConcurrentMapKeyToPageIndexTest.java │ │ ├── KeyToPageIndexTest.java │ │ ├── blink │ │ │ ├── BlinkBench.java │ │ │ └── BlinkRandomBench.java │ │ └── brin │ │ │ ├── BlockRangeIndexBench.java │ │ │ ├── BlockRangeIndexConcurrentTest.java │ │ │ ├── BlockRangeIndexStorageTest.java │ │ │ └── BlockRangeIndexTest.java │ │ ├── log │ │ └── LogSequenceNumberTest.java │ │ ├── model │ │ ├── ColumnTypesTest.java │ │ └── TableTest.java │ │ ├── server │ │ ├── AtomicCounterTest.java │ │ ├── ClearAtBootTest.java │ │ ├── ClientMultiServerTest.java │ │ ├── DeleteCheckpointFilesTest.java │ │ ├── DisklessClusterBootReplicatedTest.java │ │ ├── DisklessClusterTest.java │ │ ├── DownloadTableSpaceTest.java │ │ ├── EmbeddedBookieTest.java │ │ ├── HistoryChangelogTest.java │ │ ├── HostNameAutoDiscoreryTest.java │ │ ├── JmxTest.java │ │ ├── LedgerManagementTest.java │ │ ├── MaxLeaderInactivityTest.java │ │ ├── PortAutoDiscoveryTest.java │ │ ├── RebootPersistNodeIdTest.java │ │ ├── ServerSidePreparedStatementCacheTest.java │ │ ├── SimpleClientScanDiscoverTableSpaceTest.java │ │ ├── SimpleClientScanTest.java │ │ ├── UseVirtualTableSpaceIdWithZookKeeperTest.java │ │ ├── hammer │ │ │ ├── DirectMultipleConcurrentUpdatesSuite.java │ │ │ ├── DirectMultipleConcurrentUpdatesSuiteNoIndexesTest.java │ │ │ ├── DirectMultipleConcurrentUpdatesSuiteWithNonUniqueIndexesTest.java │ │ │ ├── DirectMultipleConcurrentUpdatesSuiteWithUniqueIndexesTest.java │ │ │ ├── MultiDMLOnSameRecordTest.java │ │ │ └── MultipleConcurrentUpdatesTest.java │ │ └── security │ │ │ ├── JAASKerberosTest.java │ │ │ ├── JAASMD5Test.java │ │ │ └── JASSPLAINTest.java │ │ ├── sql │ │ ├── AlterTableSQLTest.java │ │ ├── AlterTablespaceSQLTest.java │ │ ├── BetterExecuteSyntaxTest.java │ │ ├── CalcitePlannerTest.java │ │ ├── ColumnTimestampTest.java │ │ ├── ForeignKeySQLTest.java │ │ ├── JSQLParserPlannerTest.java │ │ ├── RawSQLTest.java │ │ ├── SQLRecordPredicateTest.java │ │ ├── SimpleJoinTest.java │ │ ├── SimpleOperatorsTest.java │ │ ├── SimpleScanZeroCopyTest.java │ │ ├── SimpleSubqueryTest.java │ │ ├── SimplerPlannerTest.java │ │ ├── SystemTablesTest.java │ │ ├── TruncateTableSQLTest.java │ │ ├── UpdateTest.java │ │ └── functions │ │ │ └── ShowCreateTableCalculatorTest.java │ │ └── utils │ │ ├── BytesCompareJavaTest.java │ │ ├── ODirectFileInputStreamTest.java │ │ ├── ODirectFileOutputStreamTest.java │ │ ├── QueryUtilsTest.java │ │ ├── RawStringTest.java │ │ └── ZKTestEnv.java │ └── resources │ └── test_jaas_md5.conf ├── herddb-docker ├── README.txt ├── pom.xml └── src │ └── main │ └── resources │ └── log4j2.xml ├── herddb-jdbc ├── nb-configuration.xml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── herddb │ │ │ └── jdbc │ │ │ ├── BasicHerdDBDataSource.java │ │ │ ├── ConnectionsPoolRuntime.java │ │ │ ├── Driver.java │ │ │ ├── HerdDBConnection.java │ │ │ ├── HerdDBDataSource.java │ │ │ ├── HerdDBDatabaseMetadata.java │ │ │ ├── HerdDBEmbeddedDataSource.java │ │ │ ├── HerdDBPreparedStatement.java │ │ │ ├── HerdDBResultSet.java │ │ │ ├── HerdDBStatement.java │ │ │ ├── HerdDBWrappingDataSource.java │ │ │ ├── PreparedStatementAsync.java │ │ │ └── utils │ │ │ └── SQLExceptionUtils.java │ └── resources │ │ └── META-INF │ │ └── services │ │ └── java.sql.Driver │ └── test │ └── java │ └── herddb │ ├── jdbc │ ├── AdvancedInsertSyntaxTest.java │ ├── AuthTest.java │ ├── BatchTest.java │ ├── CheckBigIntConversionTest.java │ ├── CommonsDBCPTest.java │ ├── ConnectionPoolMaxActiveTest.java │ ├── CreateTableSpaceWithStaticMetadataProviderTest.java │ ├── EmbeddedDisklessClusterTest.java │ ├── GeneratedKeysTest.java │ ├── GenericClientDataSourceTest.java │ ├── GetConnectionTest.java │ ├── HerdDBResultSetTest.java │ ├── HerdDbSqlDataIntegrityTest.java │ ├── JDBCBoostrapTest.java │ ├── JdbcDriverDiskLessClusterTest.java │ ├── JdbcDriverLocalTest.java │ ├── JdbcDriverTest.java │ ├── JdbcDriverZookeeperTest.java │ ├── JdbcForeignKeyMetadataTest.java │ ├── JdbcJdbcDriverStartDiskLessTest.java │ ├── MaxRowsTest.java │ ├── MixedCaseIdentifiersTest.java │ ├── MultipleDataSourcesSameJVMJMXTest.java │ ├── MysqlCompatilityTest.java │ ├── PreparedStatemetParametersTest.java │ ├── PrettySQLExceptionTest.java │ ├── ScanHugeTableTest.java │ ├── SelectColumnTest.java │ ├── SimpleDataSourceTest.java │ ├── SimpleEmbeddedTest.java │ ├── SimpleExpressionsTest.java │ ├── SimpleJoinTest.java │ ├── SimpleScanTest.java │ ├── SimpleTableScanWithNullsTest.java │ ├── StreamBasedWritesTest.java │ ├── SwitchTableSpaceTest.java │ ├── SystemTablesTest.java │ ├── TestUtils.java │ ├── TransactionIsolationTest.java │ ├── TransactionsTest.java │ └── VectorSearchWithJDBCTest.java │ └── utils │ └── ZKTestEnv.java ├── herddb-mock ├── pom.xml └── src │ └── main │ └── java │ └── com │ ├── esri │ └── core │ │ └── geometry │ │ ├── Geometry.java │ │ └── Point.java │ └── jayway │ └── jsonpath │ └── spi │ ├── json │ └── JsonProvider.java │ └── mapper │ ├── JacksonMappingProvider.java │ └── MappingProvider.java ├── herddb-net ├── findbugs-exclude.xml ├── nb-configuration.xml ├── pom.xml └── src │ ├── main │ └── java │ │ └── herddb │ │ └── network │ │ ├── Channel.java │ │ ├── ChannelEventListener.java │ │ ├── ConnectionRequestInfo.java │ │ ├── SendResultCallback.java │ │ ├── ServerHostData.java │ │ ├── ServerLocator.java │ │ ├── ServerNotAvailableException.java │ │ ├── ServerRejectedConnectionException.java │ │ ├── ServerSideConnection.java │ │ ├── ServerSideConnectionAcceptor.java │ │ └── netty │ │ ├── AbstractChannel.java │ │ ├── ClientInboundMessageHandler.java │ │ ├── LocalServerRegistry.java │ │ ├── LocalVMChannel.java │ │ ├── LocalVMChannelAcceptor.java │ │ ├── NettyChannel.java │ │ ├── NettyChannelAcceptor.java │ │ ├── NettyConnector.java │ │ ├── NetworkUtils.java │ │ ├── ProtocolMessageDecoder.java │ │ └── ServerInboundMessageHandler.java │ └── test │ └── java │ └── herddb │ └── network │ └── netty │ ├── ChannelBenchTest.java │ ├── LocalChannelTest.java │ ├── NetworkChannelTest.java │ └── Utils.java ├── herddb-services ├── licenseheader.txt ├── nb-configuration.xml ├── nbactions.xml ├── pom.xml ├── server.example.properties ├── src │ ├── main │ │ ├── assemble │ │ │ └── zip-assembly.xml │ │ ├── java │ │ │ └── herddb │ │ │ │ ├── daemons │ │ │ │ └── PidFileLocker.java │ │ │ │ └── server │ │ │ │ ├── ServerMain.java │ │ │ │ └── ZooKeeperMainWrapper.java │ │ └── resources │ │ │ ├── bin │ │ │ ├── bookkeeper │ │ │ ├── herddb-cli.bat │ │ │ ├── herddb-cli.sh │ │ │ ├── herddb-server-dev.bat │ │ │ ├── java-utils.sh │ │ │ ├── service │ │ │ └── setenv.sh │ │ │ └── conf │ │ │ ├── logging.properties │ │ │ ├── server.properties │ │ │ ├── users │ │ │ └── zoo.cfg │ └── test │ │ ├── java │ │ └── herddb │ │ │ └── server │ │ │ ├── SimpleClusterTest.java │ │ │ ├── SimpleServerTest.java │ │ │ ├── UseSystemPropertiesFromCommandLineTest.java │ │ │ └── UseSystemPropertiesTest.java │ │ └── resources │ │ └── conf │ │ ├── test.server.properties │ │ └── test.server_cluster.properties └── test-start-cluster.sh ├── herddb-site-skin ├── pom.xml └── src │ └── main │ └── resources │ ├── META-INF │ └── maven │ │ └── site.vm │ ├── css │ └── site.css │ └── media │ ├── Sora-Bold.ttf │ ├── Sora-ExtraBold.ttf │ ├── Sora-ExtraLight.ttf │ ├── Sora-Light.ttf │ ├── Sora-Medium.ttf │ ├── Sora-Regular.ttf │ ├── Sora-SemiBold.ttf │ ├── Sora-Thin.ttf │ ├── diennea.png │ ├── engineering.jpg │ ├── favicon.ico │ ├── hero.jpg │ └── separator.png ├── herddb-thirdparty ├── openjpa-test │ ├── nb-configuration.xml │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── test │ │ │ │ └── entity │ │ │ │ ├── Address.java │ │ │ │ └── User.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── persistence.xml │ │ └── test │ │ └── java │ │ └── test │ │ ├── DataSourceTest.java │ │ └── JDBCDriverTest.java ├── openjpa │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── herddb │ │ │ └── openjpa │ │ │ └── DBDictionary.java │ │ └── resources │ │ └── META-INF │ │ └── persistence.xml └── pom.xml ├── herddb-ui ├── nb-configuration.xml ├── pom.xml └── src │ └── main │ ├── java │ └── org │ │ └── herddb │ │ └── ui │ │ ├── APIResource.java │ │ ├── ApplicationConfig.java │ │ ├── Initializer.java │ │ ├── SessionListener.java │ │ └── Utils.java │ └── webapp │ ├── META-INF │ └── context.xml │ ├── WEB-INF │ └── web.xml │ ├── css │ ├── animate.min.css │ ├── bootstrap.min.css │ ├── font-awesome.min.css │ ├── jquery.dataTables.min.css │ ├── stylesheet.css │ └── themify-icons.css │ ├── fonts │ ├── .DS_Store │ ├── themify.eot │ ├── themify.svg │ ├── themify.ttf │ └── themify.woff │ ├── html │ ├── login.html │ ├── main-decorator.html │ ├── main-footer.html │ ├── main-topbar.html │ ├── nodes.html │ └── tablespaces.html │ ├── images │ ├── sort_asc.png │ ├── sort_both.png │ └── sort_desc.png │ ├── index.html │ └── js │ ├── angular-route.js │ ├── angular.configuration.js │ ├── angular.min.js │ ├── bootstrap-notify.js │ ├── jquery.dataTables.min.js │ ├── jquery.js │ ├── login.controller.js │ ├── node.controller.js │ ├── refresh.controller.js │ └── tablespace.controller.js ├── herddb-utils ├── nb-configuration.xml ├── pom.xml └── src │ ├── main │ ├── java │ │ └── herddb │ │ │ ├── core │ │ │ ├── ClockAdaptiveReplacement.java │ │ │ ├── ClockProPolicy.java │ │ │ ├── HerdDBInternalException.java │ │ │ ├── Page.java │ │ │ ├── PageReplacementPolicy.java │ │ │ └── RandomPageReplacementPolicy.java │ │ │ ├── index │ │ │ └── blink │ │ │ │ ├── BLink.java │ │ │ │ ├── BLinkIndexDataStorage.java │ │ │ │ └── BLinkMetadata.java │ │ │ ├── network │ │ │ └── HashUtils.java │ │ │ ├── proto │ │ │ ├── Pdu.java │ │ │ └── PduCodec.java │ │ │ └── utils │ │ │ ├── AbstractDataAccessor.java │ │ │ ├── AllNullsDataAccessor.java │ │ │ ├── BatchOrderedExecutor.java │ │ │ ├── BooleanHolder.java │ │ │ ├── ByteArrayCursor.java │ │ │ ├── ByteBufUtils.java │ │ │ ├── Bytes.java │ │ │ ├── ChangeThreadName.java │ │ │ ├── CleanDirectoryFileVisitor.java │ │ │ ├── CompareBytesUtils.java │ │ │ ├── Constants.java │ │ │ ├── ContextClassLoaderAwareObjectInputStream.java │ │ │ ├── DataAccessor.java │ │ │ ├── DefaultJVMHalt.java │ │ │ ├── DeleteFileVisitor.java │ │ │ ├── DiskArrayList.java │ │ │ ├── EnsureIntegerIncrementAccumulator.java │ │ │ ├── EnsureLongIncrementAccumulator.java │ │ │ ├── ExtendedDataInputStream.java │ │ │ ├── ExtendedDataOutputStream.java │ │ │ ├── FileUtils.java │ │ │ ├── Futures.java │ │ │ ├── Holder.java │ │ │ ├── ILocalLockManager.java │ │ │ ├── IllegalDataAccessException.java │ │ │ ├── InstrumentationUtils.java │ │ │ ├── IntHolder.java │ │ │ ├── KeyValue.java │ │ │ ├── ListWithMap.java │ │ │ ├── LocalLockManager.java │ │ │ ├── LockAcquireTimeoutException.java │ │ │ ├── LockHandle.java │ │ │ ├── LongHolder.java │ │ │ ├── ManagedFile.java │ │ │ ├── MapDataAccessor.java │ │ │ ├── MapUtils.java │ │ │ ├── MinDeltaLongIncrementAccumulator.java │ │ │ ├── NonClosingInputStream.java │ │ │ ├── NonClosingOutputStream.java │ │ │ ├── NullLockManager.java │ │ │ ├── NullOutputStream.java │ │ │ ├── ODirectFileInputStream.java │ │ │ ├── ODirectFileOutputStream.java │ │ │ ├── OpenFileUtils.java │ │ │ ├── ProjectedDataAccessor.java │ │ │ ├── RandomString.java │ │ │ ├── RawString.java │ │ │ ├── RecordsBatch.java │ │ │ ├── SQLRecordPredicateFunctions.java │ │ │ ├── SQLUtils.java │ │ │ ├── SimpleBufferedOutputStream.java │ │ │ ├── SimpleByteArrayInputStream.java │ │ │ ├── SingleEntryMap.java │ │ │ ├── SizeAwareObject.java │ │ │ ├── Sized.java │ │ │ ├── SystemInstrumentation.java │ │ │ ├── SystemProperties.java │ │ │ ├── TestUtils.java │ │ │ ├── TuplesList.java │ │ │ ├── Version.java │ │ │ ├── VisibleByteArrayOutputStream.java │ │ │ ├── Wrapper.java │ │ │ └── XXHash64Utils.java │ └── java10 │ │ └── herddb │ │ └── utils │ │ ├── CompareBytesUtils.java │ │ └── OpenFileUtils.java │ └── test │ └── java │ └── herddb │ ├── core │ └── PageReplacementPolicyTest.java │ ├── index │ └── blink │ │ ├── BLinkConstantSizeTest.java │ │ ├── BLinkTest.java │ │ ├── ConcurrentCheckpointBLinkTest.java │ │ └── ConcurrentUpdatesBLinkTest.java │ ├── proto │ └── PduCodecTest.java │ └── utils │ ├── BytesTest.java │ ├── ConditionalLongIncrementAccumulatorTest.java │ ├── DiskArrayListTest.java │ ├── ExtendedDataInputStreamTest.java │ ├── ExtendedDataOutputStreamTest.java │ ├── InstrumentationUtilsTest.java │ ├── LocalLockManagerTest.java │ ├── SQLRecordPredicateFunctionsTest.java │ └── VisibleByteArrayOutputStreamTest.java ├── herddb-website ├── pom.xml └── src │ └── site │ ├── markdown │ └── index.md │ ├── resources │ └── images │ │ └── herddb.png │ └── site.xml ├── jmh ├── pom.xml └── src │ └── main │ └── java │ └── herddb │ └── core │ ├── CompareByteWithJava9.java │ ├── ScanPKString.java │ └── TestUtils.java ├── licences ├── bookkeeper.NOTICE.txt └── zookeeper.NOTICE.txt ├── licenseheader.txt ├── pom.xml ├── suppressions.xml └── ycsb-runner ├── README ├── cluster.properties ├── final_report.sh ├── full-ycsb-url.sh ├── full-ycsb.sh ├── full-ycsb_mysql.sh ├── herd.properties ├── metrics.sh ├── parse_report.sh ├── prepare.sh ├── run-ycsb-with-zk.sh ├── run-ycsb.sh ├── setsenv_bench_jdk10.sh ├── setsenv_bench_jdk11.sh ├── ycsb-report.sh ├── ycsb-report_cluster.sh └── ycsb-report_mysql.sh /.github/issue_template.md: -------------------------------------------------------------------------------- 1 | Is this a question, a feature request or a bug report? 2 | 3 | 4 | **QUESTION** 5 | 6 | Have you checked our documentation in the GitHub Wiki? 7 | If you could not find an answer there, please consider asking your question on our mailing list at herddb-users@lists.herddb.org. 8 | 9 | 10 | **FEATURE REQUEST** 11 | 12 | 1. Please describe the feature you are requesting. 13 | 14 | 2. Indicate the importance of this issue to you (blocker, must-have, should-have, nice-to-have). Are you currently using any workarounds to address this issue? 15 | 16 | 3. Provide any additional detail on your proposed use case for this feature. 17 | 18 | 4. If there are some sub-tasks using -[] for each subtask and create a corresponding issue to map to the sub task: 19 | - [ ] [sub-task1-issue-number](example_sub_issue1_link_here): sub-task1 discription here, 20 | - [ ] [sub-task2-issue-number](example_sub_issue2_link_here): sub-task2 discription here, 21 | - ... 22 | 23 | 24 | **BUG REPORT** 25 | 26 | 1. Please describe the issue you observed: 27 | 28 | - What did you do? 29 | 30 | - What did you expect to see? 31 | 32 | - What did you see instead? 33 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | Following this checklist to help us incorporate your 2 | contribution quickly and easily: 3 | 4 | - [ ] Each commit in the pull request should have a meaningful subject line and body. 5 | - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why. 6 | - [ ] Rember to add the correct license header to new files. 7 | - [ ] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will 8 | be performed on your pull request automatically. 9 | 10 | To make clear that you license your contribution under 11 | the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) 12 | you have to acknowledge this by using the following check-box. 13 | 14 | - [ ] I hereby declare this contribution to be licenced under the [Apache License Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0) 15 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Maven 2 | **/target/ 3 | 4 | # Surefire 5 | **/.surefire-* 6 | 7 | # Eclipse 8 | **/.classpath 9 | **/.project 10 | **/.settings 11 | 12 | # idea 13 | .idea 14 | **/*.iml 15 | *.iml 16 | **/.DS_Store 17 | 18 | # Release 19 | pom.xml.tag 20 | pom.xml.releaseBackup 21 | pom.xml.versionsBackup 22 | pom.xml.next 23 | release.properties 24 | buildNumber.properties 25 | 26 | dependency-reduced-pom.xml 27 | .mvn/timing.properties 28 | herddb-core/nbproject/ 29 | /herddb-cli/nbproject/ 30 | /herddb-utils/nbproject/ 31 | /herddb-net/nbproject/ 32 | 33 | # Mac 34 | **/.DS_Store 35 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | pipeline { 22 | agent any 23 | tools { 24 | maven 'Maven 3.3.9' 25 | jdk 'jdk8' 26 | } 27 | stages { 28 | stage ('Initialize') { 29 | steps { 30 | sh ''' 31 | echo "PATH = ${PATH}" 32 | echo "M2_HOME = ${M2_HOME}" 33 | ''' 34 | } 35 | } 36 | 37 | stage ('Build') { 38 | steps { 39 | sh 'mvn -Dmaven.test.failure.ignore=true -DskipTests install' 40 | } 41 | post { 42 | success { 43 | junit 'target/surefire-reports/**/*.xml' 44 | } 45 | } 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /docs/herddb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/docs/herddb.png -------------------------------------------------------------------------------- /excludeFindBugsFilter.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /herddb-backward-compatibility/nb-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | none 17 | 18 | 19 | -------------------------------------------------------------------------------- /herddb-backward-compatibility/src/test/resources/herddb/upgrade/dbdata_0.5.0_brin_indexes_after_checkpoint.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-backward-compatibility/src/test/resources/herddb/upgrade/dbdata_0.5.0_brin_indexes_after_checkpoint.zip -------------------------------------------------------------------------------- /herddb-backward-compatibility/src/test/resources/herddb/upgrade/dbdata_0.5.0_brin_indexes_nevercheckpointed.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-backward-compatibility/src/test/resources/herddb/upgrade/dbdata_0.5.0_brin_indexes_nevercheckpointed.zip -------------------------------------------------------------------------------- /herddb-backward-compatibility/src/test/resources/herddb/upgrade/herddb.070.joinerror.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-backward-compatibility/src/test/resources/herddb/upgrade/herddb.070.joinerror.zip -------------------------------------------------------------------------------- /herddb-bench/src/test/java/herddb/benchs/Operation.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.benchs; 22 | 23 | import java.util.concurrent.Callable; 24 | import javax.sql.DataSource; 25 | 26 | public abstract class Operation { 27 | public abstract Callable newInstance(int seed, int batchSize, DataSource dataSource) throws Exception; 28 | } 29 | -------------------------------------------------------------------------------- /herddb-cli/src/main/java/herddb/cli/QueryWithParameters.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.cli; 22 | 23 | import java.util.Collections; 24 | import java.util.List; 25 | 26 | /** 27 | * @author enrico.olivelli 28 | */ 29 | public final class QueryWithParameters { 30 | 31 | public final String query; 32 | public final List jdbcParameters; 33 | public final String schema; 34 | public final String tableName; 35 | 36 | public QueryWithParameters(String query, String tableName, List jdbcParameters, String schema) { 37 | this.query = query; 38 | this.tableName = tableName; 39 | this.jdbcParameters = Collections.unmodifiableList(jdbcParameters); 40 | this.schema = schema; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /herddb-cli/src/test/resources/test.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | drop table pippo 22 | go 23 | create table pippo (k1 string primary key) 24 | go 25 | insert into pippo(k1) values('a') 26 | go 27 | insert into pippo(k1) values('b') 28 | go 29 | select * from pippo 30 | go 31 | drop table pippo 32 | -------------------------------------------------------------------------------- /herddb-collections/nb-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | ${project.basedir}/../licenseheader.txt 17 | none 18 | 19 | 20 | -------------------------------------------------------------------------------- /herddb-collections/nbactions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CUSTOM-dependency:tree 5 | dependency:tree 6 | 7 | dependency:tree 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /herddb-collections/src/main/java/herddb/collections/BiSink.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.collections; 22 | 23 | /** 24 | * Receives data during a full scan of a collection. 25 | */ 26 | public interface BiSink { 27 | 28 | /** 29 | * Accepts a couple of values. 30 | * 31 | * @param key 32 | * @param value 33 | * @return false in case you want to stop scanning the collection 34 | */ 35 | boolean accept(K key, V value) throws Exception; 36 | 37 | } 38 | -------------------------------------------------------------------------------- /herddb-collections/src/main/java/herddb/collections/CollectionsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.collections; 22 | 23 | /** 24 | * Checked generic Exception 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public final class CollectionsException extends Exception { 29 | 30 | public CollectionsException(Throwable cause) { 31 | super(cause); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-collections/src/main/java/herddb/collections/Sink.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.collections; 22 | 23 | /** 24 | * Receives data during a full scan of a collection. 25 | */ 26 | public interface Sink { 27 | 28 | /** 29 | * Accepts a value. 30 | * 31 | * @param value 32 | * @return false in case you want to stop scanning the collection 33 | */ 34 | boolean accept(V value) throws Exception; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /herddb-collections/src/main/java/herddb/collections/SinkException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.collections; 22 | 23 | /** 24 | * This exception wraps the exception thrown by the {@link Sink} and {@link BiSink} callback. 25 | */ 26 | public class SinkException extends Exception { 27 | 28 | public SinkException(Throwable cause) { 29 | super(cause); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /herddb-collections/src/main/java/herddb/collections/ValueSerializer.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.collections; 22 | 23 | import herddb.utils.Bytes; 24 | 25 | /** 26 | * Generic serializer abstraction. 27 | * 28 | * @author eolivelli 29 | */ 30 | public interface ValueSerializer { 31 | 32 | byte[] serialize(K object) throws Exception; 33 | 34 | K deserialize(Bytes bytes) throws Exception; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /herddb-core/nb-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | ${project.basedir}/../licenseheader.txt 17 | none 18 | 19 | 20 | -------------------------------------------------------------------------------- /herddb-core/nbactions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CUSTOM-dependency:tree 5 | dependency:tree 6 | 7 | dependency:tree 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/backup/BackupFileConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.backup; 22 | 23 | /** 24 | * Shared constants for backup files 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class BackupFileConstants { 29 | 30 | public static final String ENTRY_TYPE_START = "start"; 31 | public static final String ENTRY_TYPE_TABLE = "table"; 32 | public static final String ENTRY_TYPE_TXLOGCHUNK = "txlogchunk"; 33 | public static final String ENTRY_TYPE_END = "end"; 34 | public static final String ENTRY_TYPE_TRANSACTIONS = "transactions"; 35 | } 36 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/backup/ProgressListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.backup; 22 | 23 | import java.util.Map; 24 | 25 | /** 26 | * Receives updates about backup/restore activity 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public interface ProgressListener { 31 | 32 | default void log(String msgType, String message, Map context) { 33 | System.out.println("PROGRESSLISTENER " + msgType + ":" + message + " " + context); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/client/ClientSideMetadataProviderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to Diennea S.r.l. under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. Diennea S.r.l. licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | * 19 | */ 20 | package herddb.client; 21 | 22 | /** 23 | * Error while retrieving metadata 24 | * 25 | * @author enrico.olivelli 26 | */ 27 | public class ClientSideMetadataProviderException extends Exception { 28 | 29 | public ClientSideMetadataProviderException(Throwable cause) { 30 | super(cause); 31 | } 32 | 33 | public ClientSideMetadataProviderException(String message) { 34 | super(message); 35 | } 36 | 37 | public ClientSideMetadataProviderException(String message, Throwable cause) { 38 | super(message, cause); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/client/DMLResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.client; 22 | 23 | import herddb.utils.RawString; 24 | import java.util.Map; 25 | 26 | /** 27 | * Result of a DMS statement 28 | * 29 | * @author enrico.olivelli 30 | */ 31 | public class DMLResult { 32 | 33 | public final long updateCount; 34 | public final long transactionId; 35 | public final Object key; 36 | public final Map newvalue; 37 | 38 | public DMLResult(long updateCount, Object key, Map newvalue, long transactionId) { 39 | this.updateCount = updateCount; 40 | this.key = key; 41 | this.newvalue = newvalue; 42 | this.transactionId = transactionId; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/client/impl/HDBOperationTimeoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | package herddb.client.impl; 21 | 22 | /** 23 | * A specific timeout exception 24 | * @author eolivelli 25 | */ 26 | public class HDBOperationTimeoutException extends RetryRequestException { 27 | 28 | public HDBOperationTimeoutException(Throwable cause) { 29 | super(cause); 30 | } 31 | 32 | @Override 33 | public boolean isRequireMetadataRefresh() { 34 | return true; 35 | } 36 | 37 | @Override 38 | public int getMaxRetry() { 39 | // One will be enough for refresh metadata 40 | return 1; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/client/impl/UnreachableServerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.client.impl; 22 | 23 | /** 24 | * a retry is needed. the server is down, maybe this is a simple restart 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class UnreachableServerException extends RetryRequestException { 29 | 30 | private final String nodeId; 31 | 32 | public UnreachableServerException(String message, Throwable cause, String nodeId) { 33 | super(message, cause); 34 | this.nodeId = nodeId; 35 | } 36 | 37 | @Override 38 | public boolean isRequireMetadataRefresh() { 39 | return true; 40 | } 41 | 42 | public String getNodeId() { 43 | return nodeId; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/core/LocalScanPageCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.core; 22 | 23 | /** 24 | * Local cache to temporary scan, used not to swapin/swap-out pages from core Table Buffer 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public final class LocalScanPageCache { 29 | 30 | public DataPage value; 31 | public long pageId; 32 | 33 | } 34 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/core/RecordSetFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.core; 22 | 23 | import herddb.model.Column; 24 | 25 | /** 26 | * Factory for RecordSets 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public abstract class RecordSetFactory { 31 | 32 | public abstract MaterializedRecordSet createRecordSet(String[] fieldNames, Column[] columns); 33 | 34 | public abstract MaterializedRecordSet createFixedSizeRecordSet(int size, String[] fieldNames, Column[] columns); 35 | } 36 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/core/stats/ConnectionsInfoProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.core.stats; 22 | 23 | /** 24 | * Provides informations about actual clients 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface ConnectionsInfoProvider { 29 | ConnectionsInfo getActualConnections(); 30 | } 31 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/core/stats/TableManagerStats.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.core.stats; 22 | 23 | import herddb.jmx.TableManagerStatsMXBean; 24 | 25 | /** 26 | * Runtime Statistics for a TableManager 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public interface TableManagerStats extends TableManagerStatsMXBean { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/core/stats/TableSpaceManagerStats.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.core.stats; 22 | 23 | import herddb.jmx.TableSpaceManagerStatsMXBean; 24 | 25 | /** 26 | * Runtime Statistics for a TableSpaceManager 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public interface TableSpaceManagerStats extends TableSpaceManagerStatsMXBean { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/data/consistency/DigestNotAvailableException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | package herddb.data.consistency; 21 | 22 | import herddb.core.HerdDBInternalException; 23 | 24 | /** 25 | * Digest is not available 26 | * @author hamado 27 | */ 28 | public final class DigestNotAvailableException extends HerdDBInternalException { 29 | 30 | public DigestNotAvailableException(String message){ 31 | super(message); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/index/IndexOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | package herddb.index; 21 | 22 | import herddb.utils.ObjectSizeUtils; 23 | 24 | /** 25 | * Models the usage of a index 26 | * 27 | * @author enrico.olivelli 28 | */ 29 | public interface IndexOperation { 30 | 31 | String getIndexName(); 32 | 33 | default int estimateObjectSizeForCache() { 34 | return ObjectSizeUtils.DEFAULT_OBJECT_SIZE_OVERHEAD + ObjectSizeUtils.DEFAULT_OBJECT_SIZE_OVERHEAD /*value*/; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/index/PrimaryIndexPrefixScan.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.index; 22 | 23 | import herddb.model.RecordFunction; 24 | 25 | /** 26 | * A prefix scan of the PrimaryKey is needed 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class PrimaryIndexPrefixScan implements IndexOperation { 31 | 32 | public final RecordFunction value; 33 | 34 | public PrimaryIndexPrefixScan(RecordFunction value) { 35 | this.value = value; 36 | } 37 | 38 | @Override 39 | public String getIndexName() { 40 | return "PRIMARY KEY"; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/index/PrimaryIndexSeek.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.index; 22 | 23 | import herddb.model.RecordFunction; 24 | 25 | /** 26 | * Lookup record by an exact match on primary key 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class PrimaryIndexSeek implements IndexOperation { 31 | 32 | public final RecordFunction value; 33 | 34 | public PrimaryIndexSeek(RecordFunction value) { 35 | this.value = value; 36 | } 37 | 38 | @Override 39 | public String getIndexName() { 40 | return "PRIMARY KEY"; 41 | } 42 | 43 | @Override 44 | public String toString() { 45 | return value.toString(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/index/brin/IndexDataStorage.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.index.brin; 22 | 23 | import java.io.IOException; 24 | import java.util.List; 25 | import java.util.Map; 26 | 27 | /** 28 | * Abstract on the storage engine 29 | * 30 | * @author enrico.olivelli 31 | */ 32 | public interface IndexDataStorage { 33 | 34 | long NEW_PAGE = -1; 35 | 36 | List> loadDataPage(long pageId) throws IOException; 37 | 38 | long createDataPage(List> values) throws IOException; 39 | 40 | } 41 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/jmx/DBManagerStatsMXBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.jmx; 22 | 23 | import javax.management.MXBean; 24 | 25 | /** 26 | * JMX Definition of the statistics exposed by global DBManager 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | @MXBean 31 | public interface DBManagerStatsMXBean { 32 | 33 | long getCachedPlans(); 34 | 35 | long getCachePlansHits(); 36 | 37 | long getCachePlansMisses(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/jmx/TableManagerStatsMXBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.jmx; 22 | 23 | import javax.management.MXBean; 24 | 25 | /** 26 | * JMX Definition of the statistics exposed by every TableManager 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | @MXBean 31 | public interface TableManagerStatsMXBean { 32 | 33 | int getLoadedpages(); 34 | 35 | long getLoadedPagesCount(); 36 | 37 | long getUnloadedPagesCount(); 38 | 39 | long getTablesize(); 40 | 41 | int getDirtypages(); 42 | 43 | int getDirtyrecords(); 44 | 45 | long getDirtyUsedMemory(); 46 | 47 | long getMaxLogicalPageSize(); 48 | 49 | long getBuffersUsedMemory(); 50 | 51 | long getKeysUsedMemory(); 52 | } 53 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/jmx/TableSpaceManagerStatsMXBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.jmx; 22 | 23 | /** 24 | * Runtime Statistics for a TableSpaceManager 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface TableSpaceManagerStatsMXBean { 29 | 30 | int getLoadedpages(); 31 | 32 | long getLoadedPagesCount(); 33 | 34 | long getUnloadedPagesCount(); 35 | 36 | long getTablesize(); 37 | 38 | int getDirtypages(); 39 | 40 | int getDirtyrecords(); 41 | 42 | long getDirtyUsedMemory(); 43 | 44 | long getMaxLogicalPageSize(); 45 | 46 | long getBuffersUsedMemory(); 47 | 48 | long getKeysUsedMemory(); 49 | 50 | } 51 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/log/CommitLogListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.log; 22 | 23 | /** 24 | * Listens for all entries written to the log 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface CommitLogListener { 29 | 30 | default void logEntry(LogSequenceNumber logPos, LogEntry data) { 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/log/CommitLogManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.log; 22 | 23 | /** 24 | * Manages the whole set of CommitLogs 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public abstract class CommitLogManager implements AutoCloseable { 29 | 30 | public abstract CommitLog createCommitLog(String tableSpaceUUID, String tablespaceName, String localNodeId) throws LogNotAvailableException; 31 | 32 | public void start() throws LogNotAvailableException { 33 | } 34 | 35 | @Override 36 | public void close() { 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/log/FullRecoveryNeededException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.log; 22 | 23 | /** 24 | * A Full recovery is needed in order to boot 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class FullRecoveryNeededException extends LogNotAvailableException { 29 | 30 | public FullRecoveryNeededException(String message) { 31 | super(message); 32 | } 33 | 34 | public FullRecoveryNeededException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public FullRecoveryNeededException(Throwable cause) { 39 | super(cause); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/log/LogNotAvailableException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.log; 22 | 23 | import herddb.core.HerdDBInternalException; 24 | 25 | /** 26 | * Log is not available 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class LogNotAvailableException extends HerdDBInternalException { 31 | 32 | public LogNotAvailableException(String message) { 33 | super(message); 34 | } 35 | 36 | public LogNotAvailableException(String message, Throwable cause) { 37 | super(message, cause); 38 | } 39 | 40 | public LogNotAvailableException(Throwable cause) { 41 | super(cause); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/metadata/MetadataChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.metadata; 22 | 23 | /** 24 | * Listens for changes on metadata, for instance changes on 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface MetadataChangeListener { 29 | 30 | void metadataChanged(String description); 31 | } 32 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/metadata/MetadataStorageManagerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.metadata; 22 | 23 | /** 24 | * Error on Metadata 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class MetadataStorageManagerException extends Exception { 29 | 30 | public MetadataStorageManagerException(Throwable cause) { 31 | super(cause); 32 | } 33 | 34 | public MetadataStorageManagerException(String message) { 35 | super(message); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/Aggregator.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Aggregates data 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface Aggregator { 29 | 30 | /** 31 | * Aggregates data coming from another DataScanner 32 | * 33 | * @param scanner 34 | * @return 35 | */ 36 | DataScanner aggregate(DataScanner scanner, StatementEvaluationContext context) throws StatementExecutionException; 37 | } 38 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/AlterFailedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Alter Table DDL error 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class AlterFailedException extends DDLException { 29 | 30 | public AlterFailedException(String message) { 31 | super(message); 32 | } 33 | 34 | public AlterFailedException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public AlterFailedException(Throwable cause) { 39 | super(cause); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/AutoIncrementPrimaryKeyRecordFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Calculates the new primary key value 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class AutoIncrementPrimaryKeyRecordFunction extends RecordFunction { 29 | 30 | public AutoIncrementPrimaryKeyRecordFunction() { 31 | 32 | } 33 | 34 | @Override 35 | public byte[] computeNewValue(Record previous, StatementEvaluationContext context, TableContext tableContext) { 36 | return tableContext.computeNewPrimaryKeyValue(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/ColumnsList.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Tables and Indexes define a list of Columns 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface ColumnsList { 29 | 30 | Column[] getColumns(); 31 | 32 | Column getColumn(String name); 33 | 34 | String[] getPrimaryKey(); 35 | 36 | boolean allowNullsForIndexedValues(); 37 | } 38 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/DDLException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Base class for all Data-definition-language exceptions 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public abstract class DDLException extends StatementExecutionException { 29 | 30 | public DDLException(String message) { 31 | super(message); 32 | } 33 | 34 | public DDLException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public DDLException(Throwable cause) { 39 | super(cause); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/DDLStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * A Data-definition-language command. That is a mutation on the schema, for 25 | * instance creation of a table 26 | * 27 | * @author enrico.olivelli 28 | */ 29 | public abstract class DDLStatement extends Statement { 30 | 31 | public DDLStatement(String tableSpace) { 32 | super(tableSpace); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/DDLStatementExecutionResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Result of statement which mutate data 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class DDLStatementExecutionResult extends StatementExecutionResult { 29 | 30 | public DDLStatementExecutionResult(long transactionId) { 31 | super(transactionId); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/DataScannerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Generic exception while running a DataScanner 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class DataScannerException extends Exception { 29 | 30 | public DataScannerException(Throwable cause) { 31 | super(cause); 32 | } 33 | 34 | public DataScannerException(String message) { 35 | super(message); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/DuplicatePrimaryKeyException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | import herddb.utils.Bytes; 24 | 25 | /** 26 | * Record already exists 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class DuplicatePrimaryKeyException extends StatementExecutionException { 31 | 32 | private final Bytes key; 33 | 34 | public DuplicatePrimaryKeyException(Bytes key, String message) { 35 | super(message); 36 | this.key = key; 37 | } 38 | 39 | public Bytes getKey() { 40 | return key; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/ForeignKeyViolationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Record already exists 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class ForeignKeyViolationException extends StatementExecutionException { 29 | 30 | private final String foreignKeyName; 31 | 32 | public ForeignKeyViolationException(String fkName, String message) { 33 | super(message); 34 | this.foreignKeyName = fkName; 35 | } 36 | 37 | public String getForeignKeyName() { 38 | return foreignKeyName; 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/FullTableScanPredicate.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Accept all records 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class FullTableScanPredicate extends Predicate { 29 | 30 | @Override 31 | public boolean evaluate(Record record, StatementEvaluationContext context) throws StatementExecutionException { 32 | return true; 33 | } 34 | 35 | @Override 36 | public String toString() { 37 | return "FullTableScan"; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/IndexAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * a Index already exists 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class IndexAlreadyExistsException extends DDLException { 29 | 30 | public IndexAlreadyExistsException(String message) { 31 | super(message); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/IndexDoesNotExistException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * An Index does not exist 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class IndexDoesNotExistException extends DDLException { 29 | 30 | public IndexDoesNotExistException(String message) { 31 | super(message); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/InvalidNullValueForKeyException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to Diennea S.r.l. under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. Diennea S.r.l. licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | * 19 | */ 20 | package herddb.model; 21 | 22 | /** 23 | * A value is not valid for a key, like a NULL value. 24 | * 25 | * @author enrico.olivelli 26 | */ 27 | public final class InvalidNullValueForKeyException extends StatementExecutionException { 28 | 29 | public InvalidNullValueForKeyException(String message) { 30 | super(message); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/InvalidTableException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Invalid Table DDL error 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class InvalidTableException extends DDLException { 29 | 30 | public InvalidTableException(String message) { 31 | super(message); 32 | } 33 | 34 | public InvalidTableException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/InvalidTableSpaceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Invalid Table Space DDL error 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class InvalidTableSpaceException extends DDLException { 29 | 30 | public InvalidTableSpaceException(String message) { 31 | super(message); 32 | } 33 | 34 | public InvalidTableSpaceException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/MissingJDBCParameterException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Client did not set a JDBC Parameter 25 | */ 26 | public class MissingJDBCParameterException extends StatementExecutionException { 27 | 28 | private final int index; 29 | 30 | public MissingJDBCParameterException(int index) { 31 | super("Missing JDBC parameter index " + index); 32 | this.index = index; 33 | } 34 | 35 | /** 36 | * Get the JDBC parameter index, starting from 1 as JDBC usal 37 | * 38 | * @return the index 39 | */ 40 | public int getIndex() { 41 | return index; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/NotLeaderException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * This exception tells that the query as been routed to a server which is no (more) the leader for the tablespace 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class NotLeaderException extends StatementExecutionException { 29 | 30 | public NotLeaderException(String message) { 31 | super(message); 32 | } 33 | 34 | public NotLeaderException(String message, Throwable cause) { 35 | super(message, cause); 36 | } 37 | 38 | public NotLeaderException(Throwable cause) { 39 | super(cause); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/RecordTooBigException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * The record is too big to fit in any page, even an empty page too. 25 | * 26 | * @author diego.salvi 27 | */ 28 | public class RecordTooBigException extends StatementExecutionException { 29 | 30 | /** 31 | * Default Serial Version UID 32 | */ 33 | private static final long serialVersionUID = 1L; 34 | 35 | public RecordTooBigException(String message) { 36 | super(message); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/ScanLimits.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * @author eolivelli 25 | */ 26 | public interface ScanLimits { 27 | 28 | int computeMaxRows(StatementEvaluationContext context) throws StatementExecutionException; 29 | 30 | int computeOffset(StatementEvaluationContext context) throws StatementExecutionException; 31 | 32 | // this is to break circular dependencies with referenced ScanStatements 33 | String toStringForScan(); 34 | } 35 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/ScanResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Result of a Scan as StatementExecutionResult 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class ScanResult extends StatementExecutionResult implements AutoCloseable { 29 | 30 | public final DataScanner dataScanner; 31 | 32 | public ScanResult(long transactionId, DataScanner dataScanner) { 33 | super(transactionId); 34 | this.dataScanner = dataScanner; 35 | } 36 | 37 | @Override 38 | public void close() throws DataScannerException { 39 | dataScanner.close(); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/StatementExecutionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | import herddb.core.HerdDBInternalException; 24 | 25 | /** 26 | * Error while executin a Statement 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class StatementExecutionException extends HerdDBInternalException { 31 | 32 | public StatementExecutionException(String message) { 33 | super(message); 34 | } 35 | 36 | public StatementExecutionException(String message, Throwable cause) { 37 | super(message, cause); 38 | } 39 | 40 | public StatementExecutionException(Throwable cause) { 41 | super(cause); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/StatementExecutionResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Result of the execution of a statement 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public abstract class StatementExecutionResult { 29 | 30 | public final long transactionId; 31 | 32 | public StatementExecutionResult(long transactionId) { 33 | this.transactionId = transactionId; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/TableAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * a Table already exists 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class TableAlreadyExistsException extends DDLException { 29 | 30 | public TableAlreadyExistsException(String message) { 31 | super(message); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/TableContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * Access to Table level information and functions 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface TableContext { 29 | 30 | byte[] computeNewPrimaryKeyValue(); 31 | 32 | Table getTable(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/TableDoesNotExistException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * A Table does not exist 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class TableDoesNotExistException extends DDLException { 29 | 30 | public TableDoesNotExistException(String message) { 31 | super(message); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/TableSpaceAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * A TableSpace already exists with the same name 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class TableSpaceAlreadyExistsException extends DDLException { 29 | 30 | public TableSpaceAlreadyExistsException(String message) { 31 | super(message); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/TableSpaceDoesNotExistException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | /** 24 | * The requested TableSpace does not exist 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class TableSpaceDoesNotExistException extends DDLException { 29 | 30 | public TableSpaceDoesNotExistException(String message) { 31 | super(message); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/TupleComparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | import herddb.utils.DataAccessor; 24 | import java.io.Serializable; 25 | import java.util.Comparator; 26 | 27 | /** 28 | * "Order by" clauses inplementaions 29 | * 30 | * @author enrico.olivelli 31 | */ 32 | public interface TupleComparator extends Comparator, Serializable { 33 | 34 | default boolean isOnlyPrimaryKeyAndAscending() { 35 | return false; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/commands/BeginTransactionStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model.commands; 22 | 23 | import herddb.model.Statement; 24 | 25 | /** 26 | * Begin a transaction over a given tablespace 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class BeginTransactionStatement extends Statement { 31 | 32 | public BeginTransactionStatement(String tableSpace) { 33 | super(tableSpace); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/commands/CommitTransactionStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model.commands; 22 | 23 | import herddb.model.Statement; 24 | 25 | /** 26 | * Commit a transaction over a given tablespace 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class CommitTransactionStatement extends Statement { 31 | 32 | private final long transactionId; 33 | 34 | public CommitTransactionStatement(String tableSpace, long transactionId) { 35 | super(tableSpace); 36 | this.transactionId = transactionId; 37 | } 38 | 39 | public long getTransactionId() { 40 | return transactionId; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/commands/DropTableSpaceStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model.commands; 22 | 23 | import herddb.model.DDLStatement; 24 | 25 | /** 26 | * Drop tablespace 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class DropTableSpaceStatement extends DDLStatement { 31 | 32 | public DropTableSpaceStatement(String tableSpace) { 33 | super(tableSpace); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/commands/RollbackTransactionStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model.commands; 22 | 23 | import herddb.model.Statement; 24 | 25 | /** 26 | * Rollback a transaction over a given tablespace 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class RollbackTransactionStatement extends Statement { 31 | 32 | private final long transactionId; 33 | 34 | public RollbackTransactionStatement(String tableSpace, long transactionId) { 35 | super(tableSpace); 36 | this.transactionId = transactionId; 37 | } 38 | 39 | public long getTransactionId() { 40 | return transactionId; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/commands/TableConsistencyCheckStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | package herddb.model.commands; 21 | 22 | import herddb.model.TableAwareStatement; 23 | 24 | /** 25 | * Table consistency check statement 26 | * @author Hamado.Dene 27 | */ 28 | public final class TableConsistencyCheckStatement extends TableAwareStatement { 29 | 30 | public TableConsistencyCheckStatement(String table, String tableSpace) { 31 | super(table, tableSpace); 32 | } 33 | 34 | } 35 | 36 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/commands/TableSpaceConsistencyCheckStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | package herddb.model.commands; 21 | 22 | import herddb.model.Statement; 23 | 24 | /** 25 | * TableSpace consistency check statement 26 | * @author hamado 27 | */ 28 | public class TableSpaceConsistencyCheckStatement extends Statement{ 29 | 30 | public TableSpaceConsistencyCheckStatement(String tableSpace) { 31 | super(tableSpace); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/commands/TruncateTableStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model.commands; 22 | 23 | import herddb.model.TableAwareStatement; 24 | 25 | /** 26 | * Truncate table: delete all records in a single statement 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class TruncateTableStatement extends TableAwareStatement { 31 | 32 | public TruncateTableStatement(String tableSpace, String tableName) { 33 | super(tableName, tableSpace); 34 | } 35 | 36 | @Override 37 | public boolean supportsTransactionAutoCreate() { 38 | return false; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/planner/BindableTableScanOp.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model.planner; 22 | 23 | import herddb.model.commands.ScanStatement; 24 | 25 | /** 26 | * TableScanOp + ProjectOp + FilerOp 27 | * 28 | * @author eolivelli 29 | */ 30 | public class BindableTableScanOp extends SimpleScanOp { 31 | 32 | public BindableTableScanOp(ScanStatement scan) { 33 | super(scan); 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return "BindableTableScanOp{" + "statement=" + statement + '}'; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/planner/LimitedBindableTableScanOp.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model.planner; 22 | 23 | import herddb.model.commands.ScanStatement; 24 | 25 | /** 26 | * TableScanOp + ProjectOp + FilerOp + Sort 27 | * 28 | * @author eolivelli 29 | */ 30 | public class LimitedBindableTableScanOp extends SimpleScanOp { 31 | 32 | public LimitedBindableTableScanOp(ScanStatement scan) { 33 | super(scan); 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return "LimitedBindableTableScanOp{" + "statement=" + statement + '}'; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/planner/LimitedSortedBindableTableScanOp.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model.planner; 22 | 23 | import herddb.model.commands.ScanStatement; 24 | 25 | /** 26 | * LimitedOp + BindableTableScanOp 27 | * 28 | * @author eolivelli 29 | */ 30 | public class LimitedSortedBindableTableScanOp extends SimpleScanOp { 31 | 32 | public LimitedSortedBindableTableScanOp(ScanStatement scan) { 33 | super(scan); 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return "LimitedSortedBindableTableScanOp{" + "statement=" + statement + '}'; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/planner/SortedBindableTableScanOp.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model.planner; 22 | 23 | import herddb.model.commands.ScanStatement; 24 | 25 | /** 26 | * TableScanOp + ProjectOp + FilerOp + Sort 27 | * 28 | * @author eolivelli 29 | */ 30 | public class SortedBindableTableScanOp extends SimpleScanOp { 31 | 32 | public SortedBindableTableScanOp(ScanStatement scan) { 33 | super(scan); 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return "SortedBindableTableScanOp{" + "statement=" + statement + '}'; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/planner/SortedTableScanOp.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model.planner; 22 | 23 | import herddb.model.commands.ScanStatement; 24 | 25 | /** 26 | * TableScanOp + Sort 27 | * 28 | * @author eolivelli 29 | */ 30 | public class SortedTableScanOp extends SimpleScanOp { 31 | 32 | public SortedTableScanOp(ScanStatement scan) { 33 | super(scan); 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return "SortedTableScanOp{" + "statement=" + statement + '}'; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/model/planner/TableScanOp.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model.planner; 22 | 23 | import herddb.model.commands.ScanStatement; 24 | 25 | /** 26 | * Full table scan 27 | * 28 | * @author eolivelli 29 | */ 30 | public class TableScanOp extends SimpleScanOp { 31 | 32 | public TableScanOp(ScanStatement statement) { 33 | super(statement); 34 | } 35 | 36 | @Override 37 | public String toString() { 38 | return "TableScanOp{" + "statement=" + statement + '}'; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/sql/AggregatedColumnCalculator.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.sql; 22 | 23 | import herddb.model.StatementExecutionException; 24 | 25 | /** 26 | * Aggregated Column Calculator 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public interface AggregatedColumnCalculator { 31 | 32 | Object getValue(); 33 | 34 | String getFieldName(); 35 | 36 | void consume(herddb.utils.DataAccessor tuple) throws StatementExecutionException; 37 | 38 | } 39 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/sql/CompatibilityUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.sql; 22 | 23 | /** 24 | * Utility for compatibility with other DBMS languages 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class CompatibilityUtils { 29 | 30 | public static String fixMySqlName(String tableName) { 31 | if (tableName == null || tableName.length() <= 1) { 32 | return tableName; 33 | } 34 | if (tableName.charAt(0) == '`' && tableName.charAt(tableName.length() - 1) == '`') { 35 | return tableName.substring(1, tableName.length() - 1); 36 | } 37 | return tableName; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/sql/TranslatedQuery.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.sql; 22 | 23 | import herddb.model.ExecutionPlan; 24 | 25 | /** 26 | * Result of SQL transaction, it is made of two parts, a cachable part (the Statement) and a context, non cachable, part 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class TranslatedQuery { 31 | 32 | public final ExecutionPlan plan; 33 | public final SQLStatementEvaluationContext context; 34 | 35 | public TranslatedQuery(ExecutionPlan plan, SQLStatementEvaluationContext context) { 36 | this.plan = plan; 37 | this.context = context; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/sql/expressions/BindableTableScanColumnNameResolver.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.sql.expressions; 22 | 23 | import herddb.model.Column; 24 | import herddb.model.Table; 25 | 26 | /** 27 | * Helper which associates a given position to a column name. 28 | * 29 | * @author eolivelli 30 | */ 31 | public interface BindableTableScanColumnNameResolver { 32 | 33 | /** 34 | * Returns the namr of the column in a table. It is assumed that the 35 | * index is relative to the logical structure of the table 36 | * 37 | * @param columnReference 38 | * @return 39 | * @see Table#getColumns() 40 | */ 41 | Column resolveColumName(int columnReference); 42 | } 43 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/storage/DataStorageManagerException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.storage; 22 | 23 | import herddb.core.HerdDBInternalException; 24 | 25 | /** 26 | * Error on storage 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class DataStorageManagerException extends HerdDBInternalException { 31 | 32 | public DataStorageManagerException(String message) { 33 | super(message); 34 | } 35 | 36 | public DataStorageManagerException(String message, Throwable cause) { 37 | super(message, cause); 38 | } 39 | 40 | public DataStorageManagerException(Throwable cause) { 41 | super(cause); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/storage/FullIndexScanConsumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.storage; 22 | 23 | /** 24 | * Receives all data from an index 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface FullIndexScanConsumer { 29 | 30 | void acceptIndexStatus(IndexStatus tableStatus); 31 | 32 | void acceptPage(long pageId, byte[] data); 33 | } 34 | -------------------------------------------------------------------------------- /herddb-core/src/main/java/herddb/storage/FullTableScanConsumer.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.storage; 22 | 23 | import herddb.model.Record; 24 | import java.util.List; 25 | 26 | /** 27 | * Receives all data from a table 28 | * 29 | * @author enrico.olivelli 30 | */ 31 | public interface FullTableScanConsumer { 32 | 33 | default void acceptTableStatus(TableStatus tableStatus) { 34 | } 35 | 36 | default void acceptPage(long pageId, List records) { 37 | } 38 | 39 | default void endTable() { 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /herddb-core/src/main/resources/META-INF/herddb.version.properties: -------------------------------------------------------------------------------- 1 | # Licensed to Diennea S.r.l. under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. Diennea S.r.l. licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | build.timestamp=${buildNumber} 19 | version=${project.version} 20 | -------------------------------------------------------------------------------- /herddb-core/src/main/resources/herddb/metadata/nodeidslist.txt: -------------------------------------------------------------------------------- 1 | # Licensed to Diennea S.r.l. under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. Diennea S.r.l. licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | mucca 19 | capra 20 | maiale 21 | cane 22 | pecora 23 | vitello 24 | gatto 25 | gallina 26 | galletto 27 | pulcino 28 | toro 29 | papera 30 | cavallo 31 | asino 32 | coniglio 33 | -------------------------------------------------------------------------------- /herddb-core/src/test/java/herddb/core/FileRecordSetTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.core; 22 | 23 | import herddb.file.FileRecordSetFactory; 24 | import org.junit.Rule; 25 | import org.junit.rules.TemporaryFolder; 26 | 27 | /** 28 | * @author enrico.olivelli 29 | */ 30 | public class FileRecordSetTest extends RecordSetSuite { 31 | 32 | @Rule 33 | public TemporaryFolder folder = new TemporaryFolder(); 34 | 35 | @Override 36 | protected RecordSetFactory buildRecordSetFactory(int threshold) { 37 | return new FileRecordSetFactory(folder.getRoot().toPath(), threshold); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /herddb-core/src/test/java/herddb/core/MemoryRecordSetTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.core; 22 | 23 | import herddb.mem.MemoryRecordSetFactory; 24 | 25 | /** 26 | * @author enrico.olivelli 27 | */ 28 | public class MemoryRecordSetTest extends RecordSetSuite { 29 | 30 | @Override 31 | protected RecordSetFactory buildRecordSetFactory(int s) { 32 | return new MemoryRecordSetFactory(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /herddb-core/src/test/java/herddb/core/indexes/BrinNonUniqueIndexAccessTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.core.indexes; 22 | 23 | import herddb.model.Index; 24 | 25 | /** 26 | * Tests on BRIN indexes 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class BrinNonUniqueIndexAccessTest extends SecondaryNonUniqueIndexAccessSuite { 31 | 32 | public BrinNonUniqueIndexAccessTest() { 33 | super(Index.TYPE_BRIN); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /herddb-core/src/test/java/herddb/core/indexes/BrinUniqueIndexAccessTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.core.indexes; 22 | 23 | import herddb.model.Index; 24 | 25 | /** 26 | * Tests on BRIN UNIQUE indexes 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class BrinUniqueIndexAccessTest extends SecondaryUniqueIndexAccessSuite { 31 | 32 | public BrinUniqueIndexAccessTest() { 33 | super(Index.TYPE_BRIN); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /herddb-core/src/test/java/herddb/core/indexes/HashNonUniqueIndexAccessTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.core.indexes; 22 | 23 | import herddb.model.Index; 24 | 25 | /** 26 | * Tests on HASH indexes 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class HashNonUniqueIndexAccessTest extends SecondaryNonUniqueIndexAccessSuite { 31 | 32 | public HashNonUniqueIndexAccessTest() { 33 | super(Index.TYPE_HASH); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /herddb-core/src/test/java/herddb/core/indexes/HashUniqueIndexAccessTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.core.indexes; 22 | 23 | import herddb.model.Index; 24 | 25 | /** 26 | * Tests on HASH UNIQUE indexes 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class HashUniqueIndexAccessTest extends SecondaryUniqueIndexAccessSuite { 31 | 32 | public HashUniqueIndexAccessTest() { 33 | super(Index.TYPE_HASH); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /herddb-core/src/test/java/herddb/index/ConcurrentMapKeyToPageIndexTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.index; 22 | 23 | import java.util.concurrent.ConcurrentHashMap; 24 | 25 | /** 26 | * Base test suite for {@link ConcurrentMapKeyToPageIndex} 27 | * 28 | * @author diego.salvi 29 | */ 30 | public class ConcurrentMapKeyToPageIndexTest extends KeyToPageIndexTest { 31 | 32 | @Override 33 | KeyToPageIndex createIndex() { 34 | 35 | return new ConcurrentMapKeyToPageIndex(new ConcurrentHashMap<>()); 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /herddb-core/src/test/java/herddb/model/ColumnTypesTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.model; 22 | 23 | public class ColumnTypesTest { 24 | } 25 | -------------------------------------------------------------------------------- /herddb-core/src/test/java/herddb/server/PortAutoDiscoveryTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.server; 22 | 23 | import org.junit.Rule; 24 | import org.junit.Test; 25 | import org.junit.rules.TemporaryFolder; 26 | 27 | /** 28 | * @author enrico.olivelli 29 | */ 30 | public class PortAutoDiscoveryTest { 31 | 32 | @Rule 33 | public TemporaryFolder folder = new TemporaryFolder(); 34 | 35 | @Test 36 | public void test() throws Exception { 37 | try (Server server = new Server( 38 | new ServerConfiguration(folder.newFolder().toPath()) 39 | .set(ServerConfiguration.PROPERTY_PORT, ServerConfiguration.PROPERTY_PORT_AUTODISCOVERY))) { 40 | server.start(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /herddb-core/src/test/java/herddb/utils/RawStringTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | import static org.junit.Assert.assertEquals; 24 | import java.nio.charset.StandardCharsets; 25 | import org.junit.Test; 26 | 27 | /** 28 | * This test must be here and not in herddb-utils, in order to leverage Multi 29 | * Release JAR feature 30 | * 31 | * @author enrico.olivelli 32 | */ 33 | public class RawStringTest { 34 | 35 | @Test 36 | public void test() throws Exception { 37 | byte[] test2 = "aaaaaaaaab".getBytes(StandardCharsets.UTF_8); 38 | RawString a = RawString.of("b"); 39 | RawString b = RawString.newPooledRawString(test2, 9, 1); 40 | assertEquals(a, b); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /herddb-core/src/test/resources/test_jaas_md5.conf: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | HerdDBServer { 22 | herddb.security.sasl.DigestLoginModule required 23 | user_hd="testpwd"; 24 | }; 25 | 26 | HerdDBClient { 27 | herddb.security.sasl.DigestLoginModule required 28 | username="hd" 29 | password="testpwd"; 30 | }; 31 | -------------------------------------------------------------------------------- /herddb-docker/src/main/resources/log4j2.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /herddb-jdbc/nb-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | ${project.basedir}/../licenseheader.txt 17 | none 18 | 19 | 20 | -------------------------------------------------------------------------------- /herddb-jdbc/src/main/java/herddb/jdbc/HerdDBDataSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.jdbc; 22 | 23 | import java.sql.SQLException; 24 | 25 | /** 26 | * Generic DataSource for connecting to a remote HerdDB cluster 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public class HerdDBDataSource extends BasicHerdDBDataSource { 31 | 32 | public HerdDBDataSource() { 33 | } 34 | 35 | @Override 36 | protected synchronized void ensureClient() throws SQLException { 37 | super.ensureClient(); 38 | doWaitForTableSpace(); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-jdbc/src/main/java/herddb/jdbc/PreparedStatementAsync.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.jdbc; 22 | 23 | import java.sql.PreparedStatement; 24 | import java.util.concurrent.CompletableFuture; 25 | 26 | /** 27 | * An extension to JDBC PreparedStatement which supports Async dispatch. 28 | * 29 | * @author enrico.olivelli 30 | */ 31 | public interface PreparedStatementAsync extends PreparedStatement { 32 | 33 | CompletableFuture executeBatchAsync(); 34 | 35 | CompletableFuture executeLargeUpdateAsync(); 36 | 37 | CompletableFuture executeUpdateAsync(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /herddb-jdbc/src/main/resources/META-INF/services/java.sql.Driver: -------------------------------------------------------------------------------- 1 | herddb.jdbc.Driver 2 | -------------------------------------------------------------------------------- /herddb-mock/src/main/java/com/esri/core/geometry/Geometry.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | package com.esri.core.geometry; 21 | 22 | /** 23 | * This is only a dummy class to allow us to not depend on Geometry. 24 | */ 25 | public interface Geometry { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /herddb-mock/src/main/java/com/esri/core/geometry/Point.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | package com.esri.core.geometry; 21 | 22 | /** 23 | * This is only a dummy class to allow us to not depend on Geometry. 24 | */ 25 | public interface Point extends Geometry { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /herddb-mock/src/main/java/com/jayway/jsonpath/spi/json/JsonProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | package com.jayway.jsonpath.spi.json; 21 | 22 | /** 23 | * This is only a dummy class to allow us to not depend on JSONPath. 24 | */ 25 | public interface JsonProvider { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /herddb-mock/src/main/java/com/jayway/jsonpath/spi/mapper/JacksonMappingProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | package com.jayway.jsonpath.spi.mapper; 21 | 22 | /** 23 | * This is only a dummy class to allow us to not depend on JSONPath. 24 | */ 25 | public class JacksonMappingProvider extends MappingProvider { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /herddb-mock/src/main/java/com/jayway/jsonpath/spi/mapper/MappingProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | package com.jayway.jsonpath.spi.mapper; 21 | 22 | /** 23 | * This is only a dummy class to allow us to not depend on JSONPath. 24 | */ 25 | public class MappingProvider { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /herddb-net/findbugs-exclude.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /herddb-net/nb-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | none 17 | 18 | 19 | -------------------------------------------------------------------------------- /herddb-net/src/main/java/herddb/network/ChannelEventListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.network; 22 | 23 | import herddb.proto.Pdu; 24 | 25 | /** 26 | * Receives inbound messages from the channel 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public interface ChannelEventListener { 31 | 32 | default void requestReceived(Pdu pdu, Channel channel) { 33 | 34 | } 35 | 36 | default void channelClosed(Channel channel) { 37 | 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /herddb-net/src/main/java/herddb/network/ConnectionRequestInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.network; 22 | 23 | /** 24 | * Information for the client 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface ConnectionRequestInfo { 29 | 30 | String getClientId(); 31 | 32 | String getSharedSecret(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-net/src/main/java/herddb/network/SendResultCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.network; 22 | 23 | /** 24 | * Callback for async calls 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface SendResultCallback { 29 | 30 | void messageSent(Throwable error); 31 | } 32 | -------------------------------------------------------------------------------- /herddb-net/src/main/java/herddb/network/ServerLocator.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.network; 22 | 23 | /** 24 | * Locates the current broker 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface ServerLocator extends AutoCloseable { 29 | 30 | Channel connect(ChannelEventListener messageReceiver, ConnectionRequestInfo workerInfo) throws InterruptedException, ServerNotAvailableException, ServerRejectedConnectionException; 31 | 32 | void brokerDisconnected(); 33 | 34 | @Override 35 | default void close() { 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /herddb-net/src/main/java/herddb/network/ServerNotAvailableException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.network; 22 | 23 | /** 24 | * No Broker is avilable 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class ServerNotAvailableException extends Exception { 29 | 30 | public ServerNotAvailableException() { 31 | } 32 | 33 | public ServerNotAvailableException(Throwable cause) { 34 | super(cause); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /herddb-net/src/main/java/herddb/network/ServerRejectedConnectionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.network; 22 | 23 | /** 24 | * Broker rejected connection attempt 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class ServerRejectedConnectionException extends Exception { 29 | 30 | public ServerRejectedConnectionException(String message) { 31 | super(message); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /herddb-net/src/main/java/herddb/network/ServerSideConnection.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.network; 22 | 23 | /** 24 | * A Connection registered on the broker 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface ServerSideConnection { 29 | 30 | long getConnectionId(); 31 | } 32 | -------------------------------------------------------------------------------- /herddb-net/src/main/java/herddb/network/ServerSideConnectionAcceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.network; 22 | 23 | /** 24 | * Interface implemented by the broker in order to accept/register incoming 25 | * connections 26 | * 27 | * @author enrico.olivelli 28 | */ 29 | public interface ServerSideConnectionAcceptor { 30 | 31 | T createConnection(Channel channel); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /herddb-net/src/test/java/herddb/network/netty/Utils.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.network.netty; 22 | 23 | import herddb.proto.Pdu; 24 | import herddb.proto.PduCodec; 25 | import io.netty.buffer.ByteBuf; 26 | 27 | public class Utils { 28 | 29 | static ByteBuf buildAckResponse(Pdu message) { 30 | return PduCodec.AckResponse.write(message.messageId); 31 | } 32 | 33 | static ByteBuf buildAckRequest(int i) { 34 | return PduCodec.CloseScanner.write(i, i * 100); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /herddb-services/licenseheader.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ -------------------------------------------------------------------------------- /herddb-services/nb-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | none 17 | ${project.basedir}/licenseheader.txt 18 | 19 | 20 | -------------------------------------------------------------------------------- /herddb-services/nbactions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | CUSTOM-dependency:tree 5 | dependency:tree 6 | 7 | dependency:tree 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /herddb-services/src/main/resources/bin/bookkeeper: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | # Licensed to Diennea S.r.l. under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. Diennea S.r.l. licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | ### BASE_DIR discovery 20 | if [ -z "$BASE_DIR" ]; then 21 | BASE_DIR="`dirname \"$0\"`" 22 | BASE_DIR="`( cd \"$BASE_DIR\" && pwd )`" 23 | fi 24 | BASE_DIR=$BASE_DIR/.. 25 | BASE_DIR="`( cd \"$BASE_DIR\" && pwd )`" 26 | 27 | JAVA="$JAVA_HOME/bin/java" 28 | $JAVA -cp $BASE_DIR/lib/\* org.apache.bookkeeper.bookie.BookieShell -conf dbdata/bookie/embedded.bookie.properties "$@" 29 | -------------------------------------------------------------------------------- /herddb-services/src/main/resources/bin/herddb-cli.sh: -------------------------------------------------------------------------------- 1 | #/bin/bash 2 | # Licensed to Diennea S.r.l. under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. Diennea S.r.l. licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | ### BASE_DIR discovery 20 | if [ -z "$BASE_DIR" ]; then 21 | BASE_DIR="`dirname \"$0\"`" 22 | BASE_DIR="`( cd \"$BASE_DIR\" && pwd )`" 23 | fi 24 | BASE_DIR=$BASE_DIR/.. 25 | BASE_DIR="`( cd \"$BASE_DIR\" && pwd )`" 26 | 27 | . $BASE_DIR/bin/setenv.sh 28 | 29 | JAVA="$JAVA_HOME/bin/java" 30 | MAINCLASS=herddb.cli.HerdDBCLI 31 | 32 | $JAVA -cp $BASE_DIR'/lib/*' $MAINCLASS "$@" 33 | -------------------------------------------------------------------------------- /herddb-services/src/main/resources/conf/logging.properties: -------------------------------------------------------------------------------- 1 | # Licensed to Diennea S.r.l. under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. Diennea S.r.l. licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | handlers=java.util.logging.ConsoleHandler 19 | 20 | # Default global logging level 21 | .level= INFO 22 | 23 | # BookKeeper client 24 | org.apache.bookkeeper.level=SEVERE 25 | 26 | ############################################################ 27 | # Handler specific properties. 28 | # Describes specific configuration info for Handlers. 29 | ############################################################ 30 | java.util.logging.ConsoleHandler.level = INFO 31 | java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter 32 | -------------------------------------------------------------------------------- /herddb-services/src/main/resources/conf/users: -------------------------------------------------------------------------------- 1 | # Licensed to Diennea S.r.l. under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. Diennea S.r.l. licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Users 19 | # 20 | # File format 21 | # username,password,role 22 | # 23 | 24 | sa,hdb,admin 25 | -------------------------------------------------------------------------------- /herddb-services/src/main/resources/conf/zoo.cfg: -------------------------------------------------------------------------------- 1 | # Licensed to Diennea S.r.l. under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. Diennea S.r.l. licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | # Base stand-alone ZooKeeper configuration file 19 | tickTime=2000 20 | dataDir=${user.dir}/dbdata/zookeeper 21 | clientPort=2181 22 | -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/Sora-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/Sora-Bold.ttf -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/Sora-ExtraBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/Sora-ExtraBold.ttf -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/Sora-ExtraLight.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/Sora-ExtraLight.ttf -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/Sora-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/Sora-Light.ttf -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/Sora-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/Sora-Medium.ttf -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/Sora-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/Sora-Regular.ttf -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/Sora-SemiBold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/Sora-SemiBold.ttf -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/Sora-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/Sora-Thin.ttf -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/diennea.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/diennea.png -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/engineering.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/engineering.jpg -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/favicon.ico -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/hero.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/hero.jpg -------------------------------------------------------------------------------- /herddb-site-skin/src/main/resources/media/separator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-site-skin/src/main/resources/media/separator.png -------------------------------------------------------------------------------- /herddb-thirdparty/openjpa-test/nb-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | none 17 | 18 | 19 | -------------------------------------------------------------------------------- /herddb-thirdparty/openjpa-test/src/main/java/test/entity/Address.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to Diennea S.r.l. under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. Diennea S.r.l. licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | * 19 | */ 20 | package test.entity; 21 | 22 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 23 | import javax.persistence.Entity; 24 | import javax.persistence.GeneratedValue; 25 | import javax.persistence.Id; 26 | import lombok.AllArgsConstructor; 27 | import lombok.Data; 28 | import lombok.NoArgsConstructor; 29 | 30 | @Data 31 | @Entity 32 | @NoArgsConstructor 33 | @AllArgsConstructor 34 | @SuppressFBWarnings(value = {"UWF_UNWRITTEN_FIELD", "NP_BOOLEAN_RETURN_NULL"}) 35 | public class Address { 36 | 37 | @Id 38 | @GeneratedValue 39 | private long id; 40 | private String city; 41 | 42 | } 43 | -------------------------------------------------------------------------------- /herddb-ui/nb-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | ide 17 | 18 | 19 | -------------------------------------------------------------------------------- /herddb-ui/src/main/webapp/META-INF/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | -------------------------------------------------------------------------------- /herddb-ui/src/main/webapp/fonts/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-ui/src/main/webapp/fonts/.DS_Store -------------------------------------------------------------------------------- /herddb-ui/src/main/webapp/fonts/themify.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-ui/src/main/webapp/fonts/themify.eot -------------------------------------------------------------------------------- /herddb-ui/src/main/webapp/fonts/themify.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-ui/src/main/webapp/fonts/themify.ttf -------------------------------------------------------------------------------- /herddb-ui/src/main/webapp/fonts/themify.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-ui/src/main/webapp/fonts/themify.woff -------------------------------------------------------------------------------- /herddb-ui/src/main/webapp/html/main-footer.html: -------------------------------------------------------------------------------- 1 | 19 | 20 | 33 | -------------------------------------------------------------------------------- /herddb-ui/src/main/webapp/images/sort_asc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-ui/src/main/webapp/images/sort_asc.png -------------------------------------------------------------------------------- /herddb-ui/src/main/webapp/images/sort_both.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-ui/src/main/webapp/images/sort_both.png -------------------------------------------------------------------------------- /herddb-ui/src/main/webapp/images/sort_desc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-ui/src/main/webapp/images/sort_desc.png -------------------------------------------------------------------------------- /herddb-ui/src/main/webapp/js/refresh.controller.js: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | modulo.controller('refreshController', function ($rootScope, $scope) { 22 | $scope.sendRefresh = function(val) { 23 | $rootScope.$broadcast('refresh', val); 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /herddb-utils/nb-configuration.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 9 | 10 | 16 | none 17 | ${project.basedir}/../licenseheader.txt 18 | JDK_10 19 | 20 | 21 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/BooleanHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 24 | 25 | /** 26 | * Holds a native {@code boolean} value. 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 31 | public class BooleanHolder { 32 | 33 | public boolean value; 34 | 35 | public BooleanHolder() { 36 | } 37 | 38 | public BooleanHolder(boolean value) { 39 | this.value = value; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/ChangeThreadName.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | /** 24 | * Utility for changing thread name 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class ChangeThreadName implements AutoCloseable { 29 | 30 | private final String threadName; 31 | 32 | public ChangeThreadName(String newName) { 33 | threadName = Thread.currentThread().getName(); 34 | Thread.currentThread().setName(threadName + " - " + newName); 35 | } 36 | 37 | @Override 38 | public void close() { 39 | Thread.currentThread().setName(threadName); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/DefaultJVMHalt.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | /** 24 | * Default fast-fail procedure for the JVM 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class DefaultJVMHalt implements Runnable { 29 | 30 | public static final DefaultJVMHalt INSTANCE = new DefaultJVMHalt(); 31 | 32 | @Override 33 | public void run() { 34 | System.out.println("HERDDB will force the Halt of the JVM"); 35 | System.out.flush(); 36 | System.err.println("HERDDB will force the Halt of the JVM"); 37 | System.err.flush(); 38 | Runtime.getRuntime().halt(1); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/EnsureIntegerIncrementAccumulator.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | import java.util.function.IntBinaryOperator; 24 | 25 | /** 26 | * Ensure increment 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public final class EnsureIntegerIncrementAccumulator implements IntBinaryOperator { 31 | 32 | public static final EnsureIntegerIncrementAccumulator INSTANCE = new EnsureIntegerIncrementAccumulator(); 33 | 34 | @Override 35 | public int applyAsInt(int left, int right) { 36 | if (left <= right) { 37 | return right; 38 | } else { 39 | return left; 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/EnsureLongIncrementAccumulator.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | import java.util.function.LongBinaryOperator; 24 | 25 | /** 26 | * Ensure increment 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | public final class EnsureLongIncrementAccumulator implements LongBinaryOperator { 31 | 32 | public static final EnsureLongIncrementAccumulator INSTANCE = new EnsureLongIncrementAccumulator(); 33 | 34 | @Override 35 | public long applyAsLong(long left, long right) { 36 | if (left <= right) { 37 | return right; 38 | } else { 39 | return left; 40 | } 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/Holder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 24 | 25 | /** 26 | * Holds an object 27 | */ 28 | @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 29 | public class Holder { 30 | 31 | public T value; 32 | 33 | public Holder() { 34 | } 35 | 36 | public Holder(T value) { 37 | this.value = value; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/ILocalLockManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | /** 24 | * Handle locks by key 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public interface ILocalLockManager { 29 | 30 | LockHandle acquireReadLockForKey(Bytes key); 31 | 32 | LockHandle acquireWriteLockForKey(Bytes key); 33 | 34 | void clear(); 35 | 36 | void releaseLock(LockHandle handle); 37 | 38 | void releaseReadLock(LockHandle handle); 39 | 40 | void releaseWriteLock(LockHandle handle); 41 | 42 | int getNumKeys(); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/IllegalDataAccessException.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | /** 24 | * An illegal access to data 25 | * 26 | * @author enrico.olivelli 27 | */ 28 | public class IllegalDataAccessException extends RuntimeException { 29 | 30 | public IllegalDataAccessException(String message) { 31 | super(message); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/IntHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 24 | 25 | /** 26 | * Holds a native {@code int} value. 27 | * 28 | * @author diego.salvi 29 | */ 30 | @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 31 | public class IntHolder { 32 | 33 | public int value; 34 | 35 | public IntHolder() { 36 | this.value = 0; 37 | } 38 | 39 | public IntHolder(int value) { 40 | this.value = value; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/KeyValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 24 | 25 | /** 26 | * Key + Value 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | @SuppressFBWarnings("EI2") 31 | public class KeyValue { 32 | 33 | public final Bytes key; 34 | public final Bytes value; 35 | 36 | public KeyValue(Bytes key, Bytes value) { 37 | this.key = key; 38 | this.value = value; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/LockAcquireTimeoutException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to Diennea S.r.l. under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. Diennea S.r.l. licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | * 19 | */ 20 | package herddb.utils; 21 | 22 | import herddb.core.HerdDBInternalException; 23 | 24 | /** 25 | * Timeout. 26 | */ 27 | public final class LockAcquireTimeoutException extends HerdDBInternalException { 28 | 29 | public LockAcquireTimeoutException(String message) { 30 | super(message); 31 | } 32 | 33 | public LockAcquireTimeoutException(String message, Throwable cause) { 34 | super(message, cause); 35 | } 36 | 37 | public LockAcquireTimeoutException(Throwable cause) { 38 | super(cause); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/LongHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; 24 | 25 | /** 26 | * Holds a native {@code long} value. 27 | * 28 | * @author enrico.olivelli 29 | */ 30 | @SuppressFBWarnings("URF_UNREAD_PUBLIC_OR_PROTECTED_FIELD") 31 | public class LongHolder { 32 | 33 | public long value; 34 | 35 | public LongHolder() { 36 | } 37 | 38 | public LongHolder(long value) { 39 | this.value = value; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/NonClosingInputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | import java.io.FilterInputStream; 24 | import java.io.IOException; 25 | import java.io.InputStream; 26 | 27 | /** 28 | * {@link FilterInputStream} implementation which doesn't propagate {@link #close()} invocations. 29 | *

30 | * Usefull when wrapped stream musn't be close but you want to wrap it in a try-with-resources manner 31 | *

32 | * 33 | * @author diego.salvi 34 | */ 35 | public class NonClosingInputStream extends FilterInputStream { 36 | 37 | public NonClosingInputStream(InputStream in) { 38 | super(in); 39 | } 40 | 41 | @Override 42 | public void close() throws IOException { 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/NullOutputStream.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | import java.io.IOException; 24 | import java.io.OutputStream; 25 | 26 | /** 27 | * Null Output Stream 28 | * 29 | * @author enrico.olivelli 30 | */ 31 | public final class NullOutputStream extends OutputStream { 32 | 33 | public static final NullOutputStream INSTANCE = new NullOutputStream(); 34 | 35 | @Override 36 | public void write(int b) throws IOException { 37 | } 38 | 39 | @Override 40 | public void write(byte[] b, int off, int len) throws IOException { 41 | } 42 | 43 | @Override 44 | public void write(byte[] b) throws IOException { 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /herddb-utils/src/main/java/herddb/utils/SizeAwareObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ 20 | 21 | package herddb.utils; 22 | 23 | /** 24 | * Represent an object aware of his heap size. 25 | * 26 | * @author diego.salvi 27 | */ 28 | public interface SizeAwareObject { 29 | 30 | /** 31 | * Returns an estimation of the heap size of this instance. 32 | * 33 | * @return size estimation in bytes 34 | */ 35 | long getEstimatedSize(); 36 | } 37 | -------------------------------------------------------------------------------- /herddb-website/src/site/resources/images/herddb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/diennea/herddb/e13b1ef85e8aad56155046631f8edd087b59c758/herddb-website/src/site/resources/images/herddb.png -------------------------------------------------------------------------------- /licences/bookkeeper.NOTICE.txt: -------------------------------------------------------------------------------- 1 | Apache BookKeeper 2 | Copyright 2011 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | 7 | -------------------------------------------------------------------------------- /licences/zookeeper.NOTICE.txt: -------------------------------------------------------------------------------- 1 | Apache ZooKeeper 2 | Copyright 2009-2014 The Apache Software Foundation 3 | 4 | This product includes software developed at 5 | The Apache Software Foundation (http://www.apache.org/). 6 | -------------------------------------------------------------------------------- /licenseheader.txt: -------------------------------------------------------------------------------- 1 | /* 2 | Licensed to Diennea S.r.l. under one 3 | or more contributor license agreements. See the NOTICE file 4 | distributed with this work for additional information 5 | regarding copyright ownership. Diennea S.r.l. licenses this file 6 | to you under the Apache License, Version 2.0 (the 7 | "License"); you may not use this file except in compliance 8 | with the License. You may obtain a copy of the License at 9 | 10 | http://www.apache.org/licenses/LICENSE-2.0 11 | 12 | Unless required by applicable law or agreed to in writing, 13 | software distributed under the License is distributed on an 14 | "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | KIND, either express or implied. See the License for the 16 | specific language governing permissions and limitations 17 | under the License. 18 | 19 | */ -------------------------------------------------------------------------------- /ycsb-runner/cluster.properties: -------------------------------------------------------------------------------- 1 | # Licensed to Diennea S.r.l. under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. Diennea S.r.l. licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | db.driver=herddb.jdbc.Driver 19 | db.url=jdbc:herddb:zookeeper:localhost:2181 20 | db.user=sa 21 | db.passwd=hdb 22 | -------------------------------------------------------------------------------- /ycsb-runner/herd.properties: -------------------------------------------------------------------------------- 1 | # Licensed to Diennea S.r.l. under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. Diennea S.r.l. licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | db.driver=herddb.jdbc.Driver 19 | db.url=jdbc:herddb:server:127.0.0.1:7000 20 | db.user=sa 21 | db.passwd=hdb 22 | -------------------------------------------------------------------------------- /ycsb-runner/metrics.sh: -------------------------------------------------------------------------------- 1 | #/usr/bin/env bash 2 | # Licensed to Diennea S.r.l. under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. Diennea S.r.l. licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | DATE=$(date '+%Y-%m-%d-%H-%M-%S') 20 | workload=$1 21 | separator="_" 22 | type=$2 23 | metrics="metrics" 24 | host=$(hostname) #hostname 25 | url="http://$host:9845/metrics" 26 | folder="target/metrics/" 27 | filename="metrics" 28 | name="$folder$workload$separator$type$separator$metrics" 29 | extension=".log" 30 | 31 | 32 | mkdir -p $folder 33 | 34 | 35 | wget $url -P $folder #dowload metrics from url and save it in target/metrics 36 | 37 | if [[ -e $name$extension ]]; then 38 | i=1 39 | while [[ -e $name.$i$extension ]]; do 40 | let i++ 41 | done 42 | name=$name.$i 43 | fi 44 | 45 | mv $folder$filename $name$extension #change file name 46 | -------------------------------------------------------------------------------- /ycsb-runner/prepare.sh: -------------------------------------------------------------------------------- 1 | #/usr/bin/env bash 2 | # Licensed to Diennea S.r.l. under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. Diennea S.r.l. licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. You may obtain a copy of the License at 9 | # 10 | # http://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, 13 | # software distributed under the License is distributed on an 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | # KIND, either express or implied. See the License for the 16 | # specific language governing permissions and limitations 17 | # under the License. 18 | 19 | cd .. 20 | JAVA_HOME=~/dev/jdk-12 mvn clean install -DskipTests 21 | cd herddb-services/target 22 | unzip herddb-services*zip 23 | cd ../../ycsb-runner 24 | cp setsenv_bench_jdk11.sh ../herddb-services/target/herddb-service*-SNAPSHOT/bin/setenv.sh 25 | --------------------------------------------------------------------------------