├── .gitignore ├── .rat-excludes ├── .reviewboardrc ├── CHANGELOG_OPENSOURCE ├── LICENSE.txt ├── README.md ├── build.gradle ├── build.sh ├── build_script ├── avroSchema.gradle ├── dataTemplate.gradle ├── publishIdl.gradle ├── restClient.gradle └── restModel.gradle ├── database └── databus2-bootstrap │ └── createSchema │ └── logs │ └── schema.log ├── databus-bootstrap-client └── databus-bootstrap-client-impl │ ├── build.gradle │ └── src │ └── main │ └── java │ └── com │ └── linkedin │ └── databus │ └── client │ └── bootstrap │ ├── DatabusBootstrapDummyConsumer.java │ └── IntegratedDummyDatabusConsumer.java ├── databus-bootstrap-common ├── databus-bootstrap-common-api │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── bootstrap │ │ └── api │ │ ├── BootstrapEventCallback.java │ │ ├── BootstrapEventCallbackV3.java │ │ ├── BootstrapEventProcessResult.java │ │ ├── BootstrapProcessingException.java │ │ ├── BootstrapProducerStatus.java │ │ └── BootstrapRequestAction.java └── databus-bootstrap-common-impl │ ├── build.gradle │ └── src │ └── main │ └── java │ └── com │ └── linkedin │ └── databus │ └── bootstrap │ ├── common │ ├── BootstrapCleanerConfig.java │ ├── BootstrapCleanerStaticConfig.java │ ├── BootstrapConfig.java │ ├── BootstrapConfigBase.java │ ├── BootstrapConn.java │ ├── BootstrapDBCleaner.java │ ├── BootstrapDBCleanerQueryExecutor.java │ ├── BootstrapDBCleanerQueryHelper.java │ ├── BootstrapDBMetaDataDAO.java │ ├── BootstrapDBRow.java │ ├── BootstrapDBSingleSourceCleaner.java │ ├── BootstrapDBTimedQuery.java │ ├── BootstrapDataAccessObject.java │ ├── BootstrapHttpStatsCollector.java │ ├── BootstrapHttpStatsCollectorMBean.java │ ├── BootstrapLogInfo.java │ ├── BootstrapProducerStatsCollector.java │ ├── BootstrapProducerStatsCollectorMBean.java │ ├── BootstrapReadOnlyConfig.java │ └── SourceInfo.java │ ├── monitoring │ ├── producer │ │ ├── events │ │ │ └── DbusBootstrapProducerStatsEvent.java │ │ └── mbean │ │ │ ├── DbusBootstrapProducerStats.java │ │ │ └── DbusBootstrapProducerStatsMBean.java │ └── server │ │ ├── events │ │ └── DbusBootstrapHttpStatsEvent.java │ │ └── mbean │ │ ├── DbusBootstrapHttpStats.java │ │ └── DbusBootstrapHttpStatsMBean.java │ └── server │ └── monitoring │ └── events │ └── DbusBootstrapHttpStatsEvent.java ├── databus-bootstrap-producer └── databus-bootstrap-producer-impl │ ├── build.gradle │ └── src │ └── main │ └── java │ └── com │ └── linkedin │ └── databus │ └── bootstrap │ └── producer │ ├── BootstrapApplierThread.java │ ├── BootstrapDBDiskSpaceTriggerThread.java │ ├── BootstrapDBPeriodicTriggerThread.java │ ├── BootstrapProducerCallback.java │ ├── BootstrapProducerConfig.java │ ├── BootstrapProducerDestination.java │ ├── BootstrapProducerStaticConfig.java │ ├── DatabusBootstrapProducer.java │ └── ProducerNotification.java ├── databus-bootstrap-server ├── databus-bootstrap-server-impl │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── linkedin │ │ │ └── databus │ │ │ └── bootstrap │ │ │ └── server │ │ │ ├── BootstrapEventWriter.java │ │ │ ├── BootstrapHttpServer.java │ │ │ ├── BootstrapProcessor.java │ │ │ ├── BootstrapRequestProcessor.java │ │ │ ├── BootstrapRequestProcessorBase.java │ │ │ ├── BootstrapSCNProcessor.java │ │ │ ├── BootstrapServerConfig.java │ │ │ ├── BootstrapServerStaticConfig.java │ │ │ ├── StartSCNRequestProcessor.java │ │ │ └── TargetSCNRequestProcessor.java │ │ └── test │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── bootstrap │ │ ├── server │ │ ├── TestBootstrapProcessor.java │ │ └── TestBootstrapSCNProcessor.java │ │ └── test │ │ ├── DatabusBootstrapClient.java │ │ ├── EventProcessor.java │ │ ├── TestBootstrap.java │ │ └── TestFilterToSQL.java └── databus-bootstrap-server-pkg │ ├── build.gradle │ ├── conf │ ├── databus-bst-server.properties │ └── databus-bst-server_log4j.properties │ └── script │ ├── setup-bst-server.inc │ ├── start-bst-server.sh │ └── stop-bst-server.sh ├── databus-bootstrap-utils └── databus-bootstrap-utils-impl │ ├── build.gradle │ └── src │ └── main │ └── java │ └── com │ └── linkedin │ └── databus │ └── bootstrap │ └── utils │ ├── BootstrapAddSource.java │ ├── BootstrapAuditMain.java │ ├── BootstrapAuditTableReader.java │ ├── BootstrapAuditTester.java │ ├── BootstrapAvroFileEventReader.java │ ├── BootstrapAvroFileSeederMain.java │ ├── BootstrapAvroRecordDumper.java │ ├── BootstrapDBCleanerMain.java │ ├── BootstrapDBReader.java │ ├── BootstrapDBSeeder.java │ ├── BootstrapDbControlMain.java │ ├── BootstrapDropSource.java │ ├── BootstrapEventBuffer.java │ ├── BootstrapMetadata.java │ ├── BootstrapReaderEventHandler.java │ ├── BootstrapSeederMain.java │ ├── BootstrapSeederOracleAvroGenericEventFactory.java │ ├── BootstrapSeederOracleEventProducerFactory.java │ ├── BootstrapSeederWriterThread.java │ ├── BootstrapSrcDBEventReader.java │ ├── BootstrapTableReader.java │ ├── DbusSeederBaseThread.java │ └── bst_reader │ ├── BootstrapReaderV2Main.java │ ├── BootstrapTableReaderV2.java │ ├── MetaDataFilters.java │ ├── MetaDataFiltersBuilder.java │ └── filter │ ├── BootstrapReaderFilter.java │ ├── PayloadFieldEqFilter.java │ ├── PayloadFieldGtFilter.java │ └── PayloadFieldLtFilter.java ├── databus-client ├── databus-client-api │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── linkedin │ │ │ └── databus │ │ │ └── client │ │ │ └── pub │ │ │ ├── CheckpointPersistenceProvider.java │ │ │ ├── CheckpointPersistenceProviderAbstract.java │ │ │ ├── ClusterCheckpointPersistenceProvider.java │ │ │ ├── ConsumerCallbackResult.java │ │ │ ├── DatabusBootstrapConsumer.java │ │ │ ├── DatabusClient.java │ │ │ ├── DatabusClientException.java │ │ │ ├── DatabusClientGroupMember.java │ │ │ ├── DatabusClientNode.java │ │ │ ├── DatabusCombinedConsumer.java │ │ │ ├── DatabusEventHolder.java │ │ │ ├── DatabusInvalidRegistrationException.java │ │ │ ├── DatabusLegacyConsumerAdapter.java │ │ │ ├── DatabusLegacyConsumerCallback.java │ │ │ ├── DatabusLegacyEventConverter.java │ │ │ ├── DatabusRegistration.java │ │ │ ├── DatabusServerCoordinates.java │ │ │ ├── DatabusStreamConsumer.java │ │ │ ├── DatabusV3Client.java │ │ │ ├── DatabusV3Consumer.java │ │ │ ├── DatabusV3MultiPartitionRegistration.java │ │ │ ├── DatabusV3Registration.java │ │ │ ├── DbusClusterConsumerFactory.java │ │ │ ├── DbusClusterInfo.java │ │ │ ├── DbusEventDecoder.java │ │ │ ├── DbusModPartitionedFilterFactory.java │ │ │ ├── DbusPartitionInfo.java │ │ │ ├── DbusPartitionListener.java │ │ │ ├── DbusRangePartitionedFilterFactory.java │ │ │ ├── DbusServerSideFilterFactory.java │ │ │ ├── DbusV3ClusterConsumerFactory.java │ │ │ ├── DbusV3PartitionListener.java │ │ │ ├── DefaultDbusClusterConsumerFactory.java │ │ │ ├── DeregisterResult.java │ │ │ ├── FetchMaxSCNRequest.java │ │ │ ├── FileSystemCheckpointPersistenceProvider.java │ │ │ ├── FlushRequest.java │ │ │ ├── LastWriteTimeTracker.java │ │ │ ├── RegistrationId.java │ │ │ ├── RegistrationState.java │ │ │ ├── RelayFindMaxSCNResult.java │ │ │ ├── RelayFlushMaxSCNResult.java │ │ │ ├── SCN.java │ │ │ ├── ServerInfo.java │ │ │ ├── ServerV3Info.java │ │ │ ├── SharedCheckpointPersistenceProvider.java │ │ │ ├── StartResult.java │ │ │ ├── mbean │ │ │ ├── ConsumerCallbackStats.java │ │ │ ├── ConsumerCallbackStatsMBean.java │ │ │ ├── UnifiedClientStats.java │ │ │ └── UnifiedClientStatsMBean.java │ │ │ └── monitoring │ │ │ └── events │ │ │ ├── ConsumerCallbackStatsEvent.java │ │ │ └── UnifiedClientStatsEvent.java │ │ └── test │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── client │ │ └── pub │ │ ├── TestClusterCheckpointPersistenceProvider.java │ │ ├── TestDatabusServerCoordinates.java │ │ ├── TestFileSystemCheckpointPersistanceProvider.java │ │ ├── TestServerInfo.java │ │ └── TestUnifiedClientStats.java ├── databus-client-common │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── linkedin │ │ │ └── databus │ │ │ └── client │ │ │ ├── CheckpointMessage.java │ │ │ ├── ClientFileBasedEventTrackingCallback.java │ │ │ ├── ClientFileBasedMetadataTrackingCallback.java │ │ │ ├── DbusEventAvroDecoder.java │ │ │ ├── SCNUtils.java │ │ │ ├── SingleSourceSCN.java │ │ │ ├── consumer │ │ │ ├── AbstractDatabusBootstrapConsumer.java │ │ │ ├── AbstractDatabusCombinedConsumer.java │ │ │ ├── AbstractDatabusStreamConsumer.java │ │ │ ├── AbstractDatabusV3Consumer.java │ │ │ ├── BatchingDatabusCombinedConsumer.java │ │ │ ├── BootstrapConsumerCallbackFactory.java │ │ │ ├── ConsumerCallable.java │ │ │ ├── ConsumerCallbackFactory.java │ │ │ ├── ConsumerRegistration.java │ │ │ ├── DatabusConsumerEventBuffer.java │ │ │ ├── DatabusV2ConsumerRegistration.java │ │ │ ├── DelegatingDatabusCombinedConsumer.java │ │ │ ├── LoggingConsumer.java │ │ │ ├── MultiConsumerCallback.java │ │ │ ├── SelectingDatabusCombinedConsumer.java │ │ │ ├── SelectingDatabusCombinedConsumerFactory.java │ │ │ └── StreamConsumerCallbackFactory.java │ │ │ ├── data_model │ │ │ └── MultiPartitionSCN.java │ │ │ └── test │ │ │ └── CallbackTrackingDatabusConsumer.java │ │ └── test │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── client │ │ └── consumer │ │ ├── TestConsumerRegistration.java │ │ ├── TestInternalMetadata.java │ │ └── TestMultiConsumerCallback.java ├── databus-client-http │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── linkedin │ │ │ └── databus │ │ │ └── client │ │ │ ├── BasePullThread.java │ │ │ ├── BootstrapDispatcher.java │ │ │ ├── BootstrapPullThread.java │ │ │ ├── BootstrapResultMessage.java │ │ │ ├── ChunkedBodyReadableByteChannel.java │ │ │ ├── ConnectionState.java │ │ │ ├── ConnectionStateFactory.java │ │ │ ├── ConnectionStateMessage.java │ │ │ ├── DatabusBootstrapConnection.java │ │ │ ├── DatabusBootstrapConnectionFactory.java │ │ │ ├── DatabusBootstrapConnectionStateMessage.java │ │ │ ├── DatabusClientDSCUpdater.java │ │ │ ├── DatabusHttpClientImpl.java │ │ │ ├── DatabusRelayConnection.java │ │ │ ├── DatabusRelayConnectionFactory.java │ │ │ ├── DatabusRelayConnectionStateMessage.java │ │ │ ├── DatabusServerConnection.java │ │ │ ├── DatabusSourcesConnection.java │ │ │ ├── DatabusStreamConnectionStateMessage.java │ │ │ ├── DbusPartitionInfoImpl.java │ │ │ ├── DispatcherState.java │ │ │ ├── GenericDispatcher.java │ │ │ ├── LastWriteTimeTrackerImpl.java │ │ │ ├── RelayDispatcher.java │ │ │ ├── RelayPullThread.java │ │ │ ├── ServerSetChangeMessage.java │ │ │ ├── SourcesMessage.java │ │ │ ├── generic │ │ │ ├── ClusterFileLoggingClient.java │ │ │ ├── ConsumerPauseRequestProcessor.java │ │ │ ├── DatabusConsumerPauseInterface.java │ │ │ ├── DatabusFileLoggingConsumer.java │ │ │ └── SimpleFileLoggingConsumer.java │ │ │ ├── monitoring │ │ │ └── RegistrationStatsInfo.java │ │ │ ├── netty │ │ │ ├── AbstractHttpResponseProcessorDecorator.java │ │ │ ├── AbstractNettyHttpConnection.java │ │ │ ├── GenericHttpClientPipelineFactory.java │ │ │ ├── GenericHttpResponseHandler.java │ │ │ ├── HttpResponseProcessor.java │ │ │ ├── NettyHttpConnectionFactory.java │ │ │ ├── NettyHttpDatabusBootstrapConnection.java │ │ │ ├── NettyHttpDatabusRelayConnection.java │ │ │ ├── NettyHttpDatabusRelayConnectionInspector.java │ │ │ └── RemoteExceptionHandler.java │ │ │ ├── registration │ │ │ ├── DatabusMultiPartitionRegistration.java │ │ │ ├── DatabusV2ClusterRegistrationImpl.java │ │ │ ├── DatabusV2RegistrationImpl.java │ │ │ └── RegistrationIdGenerator.java │ │ │ └── request │ │ │ ├── ClientRequestProcessor.java │ │ │ ├── ClientStateRequestProcessor.java │ │ │ └── ClientStatsRequestProcessor.java │ │ └── test │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── client │ │ ├── TestBootstrapPullThread.java │ │ ├── TestChunkedBodyReadableByteChannel.java │ │ ├── TestDatabusHttpClient.java │ │ ├── TestDatabusSourcesConnection.java │ │ ├── TestGenericDispatcher.java │ │ ├── TestMultitenantRelay.java │ │ ├── TestRelayPullThread.java │ │ ├── netty │ │ ├── TestClientChannelClose.java │ │ ├── TestGenericHttpResponseHandler.java │ │ ├── TestNettyHttpDatabusBootstrapConnection.java │ │ ├── TestNettyHttpDatabusRelayConnection.java │ │ ├── TestResponseProcessors.java │ │ └── TestingConnectionCallback.java │ │ ├── pub │ │ └── TestDatabusClientNode.java │ │ └── registration │ │ ├── TestDatabusV2ClusterRegistrationImpl.java │ │ └── TestDatabusV2RegistrationImpl.java ├── databus-client-test-util │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── client │ │ └── netty │ │ └── NettyTestUtils.java └── databus2-client-util │ ├── build.gradle │ └── src │ └── main │ └── java │ └── com │ └── linkedin │ └── databus2 │ └── client │ └── util │ ├── CheckpointSerializerMain.java │ ├── DatabusClusterUtil.java │ └── DbusClientClusterUtil.java ├── databus-cluster └── databus-cluster-manager-impl │ ├── build.gradle │ └── src │ ├── main │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ ├── client │ │ └── registration │ │ │ ├── ClusterRegistrationConfig.java │ │ │ └── ClusterRegistrationStaticConfig.java │ │ └── cluster │ │ ├── DatabusCluster.java │ │ ├── DatabusClusterDataNotifier.java │ │ ├── DatabusClusterNotifier.java │ │ ├── DatabusClusterNotifierFactory.java │ │ └── DatabusClusterNotifierStateModel.java │ └── test │ └── java │ └── com │ └── linkedin │ └── databus │ └── cluster │ └── TestDatabusCluster.java ├── databus-core ├── databus-core-container │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── linkedin │ │ │ └── databus2 │ │ │ └── core │ │ │ └── container │ │ │ ├── ChunkedWritableByteChannel.java │ │ │ ├── DatabusHttpHeaders.java │ │ │ ├── DummyPipelineFactory.java │ │ │ ├── ExtendedReadTimeoutHandler.java │ │ │ ├── ExtendedWriteTimeoutHandler.java │ │ │ ├── HttpRequestLoggingHandler.java │ │ │ ├── JmxStaticConfig.java │ │ │ ├── JmxStaticConfigBuilder.java │ │ │ ├── client │ │ │ └── ContainerQueryingClient.java │ │ │ ├── monitoring │ │ │ ├── events │ │ │ │ ├── ContainerStatsEvent.java │ │ │ │ ├── ContainerTrafficTotalStatsEvent.java │ │ │ │ └── DbusHttpTotalStatsEvent.java │ │ │ └── mbean │ │ │ │ ├── ContainerStatisticsCollector.java │ │ │ │ ├── ContainerStatisticsCollectorMBean.java │ │ │ │ ├── ContainerStats.java │ │ │ │ ├── ContainerStatsMBean.java │ │ │ │ ├── ContainerTrafficTotalStats.java │ │ │ │ ├── ContainerTrafficTotalStatsMBean.java │ │ │ │ ├── DatabusComponentAdmin.java │ │ │ │ ├── DatabusComponentAdminMBean.java │ │ │ │ ├── DbusHttpTotalStats.java │ │ │ │ ├── DbusHttpTotalStatsMBean.java │ │ │ │ ├── HttpStatisticsCollector.java │ │ │ │ └── HttpStatisticsCollectorMBean.java │ │ │ ├── netty │ │ │ ├── ChunkedBodyWritableByteChannel.java │ │ │ ├── ConnectionChannelRegistrationHandler.java │ │ │ ├── DatabusRequestExecutionHandler.java │ │ │ ├── HttpRequestHandler.java │ │ │ ├── HttpServerPipelineFactory.java │ │ │ ├── InboundContainerStatisticsCollectingHandler.java │ │ │ ├── OutboundContainerStatisticsCollectingHandler.java │ │ │ ├── ServerContainer.java │ │ │ └── TcpServerPipelineFactory.java │ │ │ ├── request │ │ │ ├── AbstractRequestProcesser.java │ │ │ ├── AbstractStatsRequestProcessor.java │ │ │ ├── BaseBinaryCommandParser.java │ │ │ ├── BinaryCommandParser.java │ │ │ ├── BinaryCommandParserFactory.java │ │ │ ├── BinaryProtocol.java │ │ │ ├── BootstrapDBException.java │ │ │ ├── BootstrapDatabaseTooOldException.java │ │ │ ├── BootstrapDatabaseTooYoungException.java │ │ │ ├── CommandsRegistry.java │ │ │ ├── ConfigRequestProcessor.java │ │ │ ├── ContainerAdminRequestProcessor.java │ │ │ ├── ContainerOperationProcessor.java │ │ │ ├── ContainerStatsRequestProcessor.java │ │ │ ├── DatabusRequest.java │ │ │ ├── EchoRequestProcessor.java │ │ │ ├── ErrorResponse.java │ │ │ ├── IDatabusRequest.java │ │ │ ├── IDatabusResponse.java │ │ │ ├── InvalidRequestParamValueException.java │ │ │ ├── InvalidRequestType.java │ │ │ ├── JavaStatsRequestProcessor.java │ │ │ ├── ProcessorRegistrationConflictException.java │ │ │ ├── RegisterResponseEntry.java │ │ │ ├── RegisterResponseMetadataEntry.java │ │ │ ├── RequestExecutionHandlerFactory.java │ │ │ ├── RequestProcessingException.java │ │ │ ├── RequestProcessor.java │ │ │ ├── RequestProcessorRegistry.java │ │ │ ├── SimpleBinaryDatabusRequestDecoder.java │ │ │ ├── SimpleBinaryDatabusResponseEncoder.java │ │ │ ├── SimpleDatabusRequest.java │ │ │ ├── SimpleDatabusResponse.java │ │ │ ├── SleepRequestProcessor.java │ │ │ ├── SourcesTooOldException.java │ │ │ ├── UnexpectedCommand.java │ │ │ ├── UnknownCommandException.java │ │ │ ├── UnsupportedProtocolVersionException.java │ │ │ └── codec │ │ │ │ └── SimpleBinaryDatabusRequestEncoder.java │ │ │ └── tool │ │ │ └── TcpCommandMain.java │ │ └── test │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus2 │ │ └── core │ │ └── container │ │ ├── TestAggregatedDbusEventStatsCollector.java │ │ ├── TestExtendedReadTimeoutHandler.java │ │ ├── TestExtendedWriteTimeoutHandler.java │ │ ├── TestServerContainer.java │ │ └── request │ │ └── TestDatabusRequest.java ├── databus-core-fwk-test │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus2 │ │ └── test │ │ ├── ClassIntrospectionUtils.java │ │ ├── ConditionCheck.java │ │ ├── TestUtil.java │ │ └── container │ │ ├── ExceptionListenerTestHandler.java │ │ ├── MockServerChannelHandler.java │ │ ├── SimpleObjectCaptureHandler.java │ │ ├── SimpleResponseBytesAggregatorHandler.java │ │ ├── SimpleTestClientConnection.java │ │ ├── SimpleTestMessageReader.java │ │ └── SimpleTestServerConnection.java ├── databus-core-impl │ ├── build.gradle │ ├── src │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── linkedin │ │ │ │ ├── databus │ │ │ │ └── core │ │ │ │ │ ├── BaseCli.java │ │ │ │ │ ├── BootstrapCheckpointHandler.java │ │ │ │ │ ├── BootstrapPhase.java │ │ │ │ │ ├── BufferInfoResponse.java │ │ │ │ │ ├── Checkpoint.java │ │ │ │ │ ├── CheckpointMult.java │ │ │ │ │ ├── CompoundDatabusComponentStatus.java │ │ │ │ │ ├── DataChangeEvent.java │ │ │ │ │ ├── DatabusComponentStatus.java │ │ │ │ │ ├── DatabusRuntimeException.java │ │ │ │ │ ├── DatabusThreadBase.java │ │ │ │ │ ├── DbusClientMode.java │ │ │ │ │ ├── DbusConstantPartitionRouter.java │ │ │ │ │ ├── DbusConstants.java │ │ │ │ │ ├── DbusErrorEvent.java │ │ │ │ │ ├── DbusEvent.java │ │ │ │ │ ├── DbusEventAccumulator.java │ │ │ │ │ ├── DbusEventBuffer.java │ │ │ │ │ ├── DbusEventBufferAppendable.java │ │ │ │ │ ├── DbusEventBufferBatchReadable.java │ │ │ │ │ ├── DbusEventBufferMetaInfo.java │ │ │ │ │ ├── DbusEventBufferMult.java │ │ │ │ │ ├── DbusEventBufferReadable.java │ │ │ │ │ ├── DbusEventBufferStreamAppendable.java │ │ │ │ │ ├── DbusEventFactory.java │ │ │ │ │ ├── DbusEventInfo.java │ │ │ │ │ ├── DbusEventInternalReadable.java │ │ │ │ │ ├── DbusEventInternalWritable.java │ │ │ │ │ ├── DbusEventKey.java │ │ │ │ │ ├── DbusEventPart.java │ │ │ │ │ ├── DbusEventSerializable.java │ │ │ │ │ ├── DbusEventUtils.java │ │ │ │ │ ├── DbusEventV1.java │ │ │ │ │ ├── DbusEventV1Factory.java │ │ │ │ │ ├── DbusEventV2.java │ │ │ │ │ ├── DbusEventV2Factory.java │ │ │ │ │ ├── DbusHashPartitionRouter.java │ │ │ │ │ ├── DbusLogAccumulator.java │ │ │ │ │ ├── DbusOpcode.java │ │ │ │ │ ├── DbusPartitionId.java │ │ │ │ │ ├── DbusPartitionRouter.java │ │ │ │ │ ├── DbusPartitionRouterFactory.java │ │ │ │ │ ├── DbusPrettyLogUtils.java │ │ │ │ │ ├── DispatcherRetriesExhaustedException.java │ │ │ │ │ ├── Encoding.java │ │ │ │ │ ├── EventLogReader.java │ │ │ │ │ ├── EventLogWriter.java │ │ │ │ │ ├── EventScanningState.java │ │ │ │ │ ├── FileBasedEventTrackingCallback.java │ │ │ │ │ ├── InternalDatabusEventsListener.java │ │ │ │ │ ├── InternalDatabusEventsListenerAbstract.java │ │ │ │ │ ├── InvalidCheckpointException.java │ │ │ │ │ ├── InvalidEventException.java │ │ │ │ │ ├── KeyTypeNotImplementedException.java │ │ │ │ │ ├── NamedObject.java │ │ │ │ │ ├── OffsetNotFoundException.java │ │ │ │ │ ├── PendingEventTooLargeException.java │ │ │ │ │ ├── PullerRetriesExhaustedException.java │ │ │ │ │ ├── RelayEventTraceOption.java │ │ │ │ │ ├── SCNRegressMessage.java │ │ │ │ │ ├── ScnIndex.java │ │ │ │ │ ├── ScnNotFoundException.java │ │ │ │ │ ├── StreamEventsArgs.java │ │ │ │ │ ├── StreamEventsResult.java │ │ │ │ │ ├── UnsupportedDbusEventVersionRuntimeException.java │ │ │ │ │ ├── UnsupportedKeyException.java │ │ │ │ │ ├── async │ │ │ │ │ ├── AbstractActorMessageQueue.java │ │ │ │ │ ├── ActorMessageQueue.java │ │ │ │ │ └── LifecycleMessage.java │ │ │ │ │ ├── cmclient │ │ │ │ │ ├── LogicalPartitionRepresentation.java │ │ │ │ │ ├── NotAReplicatingResourceException.java │ │ │ │ │ └── ResourceKey.java │ │ │ │ │ ├── data_model │ │ │ │ │ ├── DatabusSubscription.java │ │ │ │ │ ├── LegacySubscriptionUriCodec.java │ │ │ │ │ ├── LogicalPartition.java │ │ │ │ │ ├── LogicalSource.java │ │ │ │ │ ├── LogicalSourceId.java │ │ │ │ │ ├── PhysicalPartition.java │ │ │ │ │ ├── PhysicalSource.java │ │ │ │ │ ├── Role.java │ │ │ │ │ ├── SubscriptionUriCodec.java │ │ │ │ │ └── UnknownPartitionException.java │ │ │ │ │ ├── monitoring │ │ │ │ │ ├── HistogramBasedIntStats.java │ │ │ │ │ ├── StatsCollectorCallback.java │ │ │ │ │ ├── SynchornizedHistogramBasedIntStats.java │ │ │ │ │ ├── events │ │ │ │ │ │ └── DbusEventsTotalStatsEvent.java │ │ │ │ │ └── mbean │ │ │ │ │ │ ├── AbstractMonitoringMBean.java │ │ │ │ │ │ ├── AbstractStatsCollectorsPartitioner.java │ │ │ │ │ │ ├── AggregatedDbusEventsStatisticsCollector.java │ │ │ │ │ │ ├── AggregatedDbusEventsTotalStats.java │ │ │ │ │ │ ├── DatabusMonitoringMBean.java │ │ │ │ │ │ ├── DbusEventStatsCollectorsPartitioner.java │ │ │ │ │ │ ├── DbusEventsStatisticsCollector.java │ │ │ │ │ │ ├── DbusEventsStatisticsCollectorMBean.java │ │ │ │ │ │ ├── DbusEventsTotalStats.java │ │ │ │ │ │ ├── DbusEventsTotalStatsMBean.java │ │ │ │ │ │ ├── DbusGenericSensor.java │ │ │ │ │ │ ├── MBeanSensorHelper.java │ │ │ │ │ │ ├── StatsCollectorMergeable.java │ │ │ │ │ │ └── StatsCollectors.java │ │ │ │ │ ├── test │ │ │ │ │ ├── CheckpointForTesting.java │ │ │ │ │ ├── DbusEventAppender.java │ │ │ │ │ ├── DbusEventBufferConsumer.java │ │ │ │ │ ├── DbusEventBufferReader.java │ │ │ │ │ ├── DbusEventBufferReflector.java │ │ │ │ │ ├── DbusEventBufferWriter.java │ │ │ │ │ ├── DbusEventCorrupter.java │ │ │ │ │ ├── DbusEventFactoryForTesting.java │ │ │ │ │ └── DbusEventGenerator.java │ │ │ │ │ └── util │ │ │ │ │ ├── Base64.java │ │ │ │ │ ├── BufferPosition.java │ │ │ │ │ ├── BufferPositionParser.java │ │ │ │ │ ├── ByteBufferCRC32.java │ │ │ │ │ ├── ByteSizeConstants.java │ │ │ │ │ ├── CompressUtil.java │ │ │ │ │ ├── ConfigApplier.java │ │ │ │ │ ├── ConfigBuilder.java │ │ │ │ │ ├── ConfigHelper.java │ │ │ │ │ ├── ConfigLoader.java │ │ │ │ │ ├── ConfigManager.java │ │ │ │ │ ├── CrcToolMain.java │ │ │ │ │ ├── DatabusEventProducer.java │ │ │ │ │ ├── DatabusEventRandomProducer.java │ │ │ │ │ ├── DbusHttpUtils.java │ │ │ │ │ ├── EventBufferConsumer.java │ │ │ │ │ ├── FileUtils.java │ │ │ │ │ ├── Fnv1aHashImpl.java │ │ │ │ │ ├── FnvHashFunction.java │ │ │ │ │ ├── HashFunction.java │ │ │ │ │ ├── IdNamePair.java │ │ │ │ │ ├── InvalidConfigException.java │ │ │ │ │ ├── JenkinsHashFunction.java │ │ │ │ │ ├── JmxUtil.java │ │ │ │ │ ├── JsonUtils.java │ │ │ │ │ ├── NamedThreadFactory.java │ │ │ │ │ ├── ObjectGenerationTracker.java │ │ │ │ │ ├── PropertiesHelper.java │ │ │ │ │ ├── Range.java │ │ │ │ │ ├── RangeBasedReaderWriterLock.java │ │ │ │ │ ├── RateControl.java │ │ │ │ │ ├── RateMonitor.java │ │ │ │ │ ├── ReadWriteSyncedObject.java │ │ │ │ │ ├── RngUtils.java │ │ │ │ │ ├── StringUtils.java │ │ │ │ │ ├── TimeUtils.java │ │ │ │ │ ├── UncaughtExceptionTrackingThread.java │ │ │ │ │ └── Utils.java │ │ │ │ └── databus2 │ │ │ │ ├── core │ │ │ │ ├── AssertLevel.java │ │ │ │ ├── BackoffTimer.java │ │ │ │ ├── BackoffTimerStaticConfig.java │ │ │ │ ├── BackoffTimerStaticConfigBuilder.java │ │ │ │ ├── BufferNotFoundException.java │ │ │ │ ├── DatabusException.java │ │ │ │ ├── filter │ │ │ │ │ ├── AllowAllDbusFilter.java │ │ │ │ │ ├── ConjunctionDbusFilter.java │ │ │ │ │ ├── DbusFilter.java │ │ │ │ │ ├── DbusKeyCompositeFilter.java │ │ │ │ │ ├── DbusKeyCompositeFilterConfig.java │ │ │ │ │ ├── DbusKeyFilter.java │ │ │ │ │ ├── FilterToSQL.java │ │ │ │ │ ├── KeyFilterConfig.java │ │ │ │ │ ├── KeyFilterConfigHolder.java │ │ │ │ │ ├── KeyFilterConfigJSONFactory.java │ │ │ │ │ ├── KeyModFilter.java │ │ │ │ │ ├── KeyModFilterConfig.java │ │ │ │ │ ├── KeyRangeFilter.java │ │ │ │ │ ├── KeyRangeFilterConfig.java │ │ │ │ │ ├── LogicalSourceAndPartitionDbusFilter.java │ │ │ │ │ ├── PhysicalPartitionDbusFilter.java │ │ │ │ │ └── SourceDbusFilter.java │ │ │ │ ├── mbean │ │ │ │ │ ├── BaseDatabusMBean.java │ │ │ │ │ ├── DatabusCompoundReadOnlyStatus.java │ │ │ │ │ ├── DatabusCompoundReadOnlyStatusMBean.java │ │ │ │ │ ├── DatabusReadOnlyStatus.java │ │ │ │ │ └── DatabusReadOnlyStatusMBean.java │ │ │ │ └── seq │ │ │ │ │ ├── FileMaxSCNHandler.java │ │ │ │ │ ├── FileMaxSCNHandlerFactory.java │ │ │ │ │ ├── InMemorySequenceNumberHandler.java │ │ │ │ │ ├── InMemorySequenceNumberHandlerFactory.java │ │ │ │ │ ├── MaxSCNReader.java │ │ │ │ │ ├── MaxSCNReaderWriter.java │ │ │ │ │ ├── MaxSCNReaderWriterConfig.java │ │ │ │ │ ├── MaxSCNReaderWriterStaticConfig.java │ │ │ │ │ ├── MaxSCNWriter.java │ │ │ │ │ ├── MultiServerSequenceNumberHandler.java │ │ │ │ │ ├── MysqlMaxSCNHandler.java │ │ │ │ │ ├── MysqlMaxSCNHandlerFactory.java │ │ │ │ │ ├── SequenceNumberHandlerFactory.java │ │ │ │ │ └── ServerName.java │ │ │ │ ├── relay │ │ │ │ ├── AddRemovePartitionInterface.java │ │ │ │ └── config │ │ │ │ │ ├── DatabusRelaySources.java │ │ │ │ │ ├── DatabusRelaySourcesInFiles.java │ │ │ │ │ ├── LogicalSourceConfig.java │ │ │ │ │ ├── LogicalSourceStaticConfig.java │ │ │ │ │ ├── PhysicalSourceConfig.java │ │ │ │ │ ├── PhysicalSourceStaticConfig.java │ │ │ │ │ ├── ReplicationBitSetterConfig.java │ │ │ │ │ └── ReplicationBitSetterStaticConfig.java │ │ │ │ └── util │ │ │ │ └── DBHelper.java │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── linkedin │ │ │ ├── databus │ │ │ └── core │ │ │ │ ├── EventBufferTestInput.java │ │ │ │ ├── TestBootstrapCheckpointHandler.java │ │ │ │ ├── TestCheckpoint.java │ │ │ │ ├── TestCheckpointMult.java │ │ │ │ ├── TestDbusConstants.java │ │ │ │ ├── TestDbusEvent.java │ │ │ │ ├── TestDbusEventBuffer.java │ │ │ │ ├── TestDbusEventBufferAppendEvents.java │ │ │ │ ├── TestDbusEventBufferIterators.java │ │ │ │ ├── TestDbusEventBufferMult.java │ │ │ │ ├── TestDbusEventBufferNG.java │ │ │ │ ├── TestDbusEventBufferPersistence.java │ │ │ │ ├── TestDbusEventBufferStreamEvents.java │ │ │ │ ├── TestDbusEventKey.java │ │ │ │ ├── TestDbusEventV2.java │ │ │ │ ├── TestDbusKeyCompositeFilter.java │ │ │ │ ├── TestDbusLogAccumulator.java │ │ │ │ ├── TestDbusPhysicalPartitionEventBuffer.java │ │ │ │ ├── TestPhysicalPartition.java │ │ │ │ ├── TestScnIndex.java │ │ │ │ ├── TestSourceDbusFilter.java │ │ │ │ ├── data_model │ │ │ │ └── TestSubscriptions.java │ │ │ │ └── util │ │ │ │ ├── TestBufferOffset.java │ │ │ │ ├── TestBufferPosition.java │ │ │ │ ├── TestConfigHelper.java │ │ │ │ ├── TestConfigManager.java │ │ │ │ ├── TestFnv1aHashImpl.java │ │ │ │ ├── TestHashFunctions.java │ │ │ │ ├── TestRange.java │ │ │ │ ├── TestRangeBasedReaderWriterLock.java │ │ │ │ ├── TestRangeBasedReaderWriterLockPerf.java │ │ │ │ ├── TestRateControl.java │ │ │ │ ├── TestRateMonitor.java │ │ │ │ ├── TestReadWriteSyncedObjectPerf.java │ │ │ │ ├── TestRngUtils.java │ │ │ │ └── TestStringUtils.java │ │ │ └── databus2 │ │ │ ├── core │ │ │ ├── TestErrorRetriesCounter.java │ │ │ ├── TestGetTime.java │ │ │ └── monitoring │ │ │ │ ├── HistogramBaseIntStatsPerf.java │ │ │ │ ├── TestDbusEventStatsCollectorPartitioner.java │ │ │ │ └── TestHistogramBaseIntStats.java │ │ │ └── relay │ │ │ └── config │ │ │ ├── TestDatabusRelaySourcesInFile.java │ │ │ └── TestPhysicalSourceConfig.java │ └── test_data │ │ ├── DbusEventUpsertByOldJava.evt │ │ └── README ├── databus-core-schema-tools-pkg │ ├── bin │ │ ├── avro-converter.sh │ │ └── setup.inc │ └── build.gradle ├── databus-core-schema-tools │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus2 │ │ └── core │ │ └── schema │ │ └── tools │ │ ├── AvroConvertMain.java │ │ └── AvroConverter.java ├── databus-core-schemas-test │ └── build.gradle └── databus-core-schemas │ ├── build.gradle │ ├── src │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── linkedin │ │ │ └── databus2 │ │ │ └── schemas │ │ │ ├── FileSystemSchemaRegistryService.java │ │ │ ├── FileSystemVersionedSchemaSetProvider.java │ │ │ ├── NoSuchSchemaException.java │ │ │ ├── ResourceVersionedSchemaSetProvider.java │ │ │ ├── SchemaId.java │ │ │ ├── SchemaRegistryConfigBuilder.java │ │ │ ├── SchemaRegistryService.java │ │ │ ├── SchemaRegistryStaticConfig.java │ │ │ ├── SourceIdNameRegistry.java │ │ │ ├── StandardSchemaRegistryFactory.java │ │ │ ├── VersionedSchema.java │ │ │ ├── VersionedSchemaId.java │ │ │ ├── VersionedSchemaSet.java │ │ │ ├── VersionedSchemaSetBackedRegistryService.java │ │ │ ├── VersionedSchemaSetProvider.java │ │ │ ├── VersionedTableSchemaLookup.java │ │ │ ├── mbean │ │ │ ├── VersionedSchemaSetStatus.java │ │ │ └── VersionedSchemaSetStatusMBean.java │ │ │ └── utils │ │ │ ├── SchemaHelper.java │ │ │ └── Utils.java │ └── test │ │ ├── java │ │ └── com │ │ │ └── linkedin │ │ │ └── databus2 │ │ │ └── schemas │ │ │ ├── TestFileSystemSchemaRegistryService.java │ │ │ ├── TestFileSystemVersionedSchemaSetProvider.java │ │ │ ├── TestResourceVersionedSchemaSetProvider.java │ │ │ └── TestVersionedSchemaSet.java │ │ └── resources │ │ ├── com.linkedin.events.example.fake.FakeSchema.1.avsc │ │ ├── com.linkedin.events.example.fake.FakeSchema.2.avsc │ │ ├── com.linkedin.events.example.person.Person.1.avsc │ │ └── index.schemas_registry │ └── testng.xml ├── databus-group-leader ├── databus-group-leader-api │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── groupleader │ │ └── pub │ │ ├── AcceptLeadershipCallback.java │ │ ├── GroupLeadershipConnection.java │ │ ├── GroupLeadershipConnectionFactory.java │ │ ├── GroupLeadershipInfo.java │ │ ├── GroupLeadershipSession.java │ │ ├── GroupMemberInfo.java │ │ └── GroupsLeadershipInfo.java ├── databus-group-leader-example │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── groupleader │ │ └── example │ │ └── simple │ │ ├── ExampleUtils.java │ │ ├── LeaderElectSimpleExample.java │ │ └── RemovePaths.java └── databus-group-leader-impl │ ├── build.gradle │ └── src │ ├── main │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── groupleader │ │ └── impl │ │ └── zkclient │ │ ├── GroupLeadershipConnectionFactoryZkClientImpl.java │ │ ├── GroupLeadershipConnectionZkClientImpl.java │ │ └── LeaderElectUtils.java │ └── test │ └── java │ └── com │ └── linkedin │ └── databus │ └── groupleader │ └── impl │ └── zkclient │ └── TestLeaderElect.java ├── databus-relay └── databus-relay-run │ ├── build.gradle │ └── run.py ├── databus-tools ├── databus-dtail-impl │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus2 │ │ └── tools │ │ └── dtail │ │ ├── AvroBinaryDtailPrinter.java │ │ ├── AvroJsonDtailPrinter.java │ │ ├── Dtail.java │ │ ├── DtailCliBase.java │ │ ├── DtailPrinter.java │ │ ├── EventInfoDtailPrinter.java │ │ ├── GenericRecordDtailPrinter.java │ │ ├── JsonDtailPrinter.java │ │ └── NoopDtailPrinter.java └── databus-tools-pkg │ ├── build.gradle │ ├── conf │ └── dtail.properties │ └── script │ └── dtail ├── databus-util-cmdline ├── databus-util-cmdline-impl │ ├── FindBugs-excludes.xml │ ├── build.gradle │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── linkedin │ │ │ └── databus │ │ │ ├── eventgenerator │ │ │ ├── ArrayFieldGenerate.java │ │ │ ├── BooleanFieldGenerate.java │ │ │ ├── BytesFieldGenerate.java │ │ │ ├── DataGenerator.java │ │ │ ├── DefaultRandomGenerator.java │ │ │ ├── DoubleFieldGenerate.java │ │ │ ├── EnumFieldGenerate.java │ │ │ ├── FixedLengthFieldGenerate.java │ │ │ ├── FloatFieldGenerate.java │ │ │ ├── IntegerFieldGenerate.java │ │ │ ├── LongFieldGenerate.java │ │ │ ├── MapFieldGenerate.java │ │ │ ├── NullFieldGenerate.java │ │ │ ├── RandomDataGenerator.java │ │ │ ├── RecordFieldGenerate.java │ │ │ ├── SchemaFiller.java │ │ │ ├── StringFieldGenerate.java │ │ │ ├── UnionFieldGenerate.java │ │ │ └── UnknownTypeException.java │ │ │ └── util │ │ │ ├── AvroPrimitiveTypes.java │ │ │ ├── CollectionTypeInfo.java │ │ │ ├── CommandLineHelper.java │ │ │ ├── DataReader.java │ │ │ ├── DevRelayConfigGenerator.java │ │ │ ├── FieldInfo.java │ │ │ ├── FieldToAvro.java │ │ │ ├── InteractiveSchemaGenerator.java │ │ │ ├── InteractiveSchemaGeneratorCli.java │ │ │ ├── SchemaGeneratorMain.java │ │ │ ├── SchemaMetaDataManager.java │ │ │ ├── SchemaUtils.java │ │ │ ├── SimpleTypeInfo.java │ │ │ ├── TableTypeInfo.java │ │ │ ├── TypeInfo.java │ │ │ ├── TypeInfoFactory.java │ │ │ ├── TypeInfoFactoryInteractive.java │ │ │ └── UserTypeInfo.java │ │ └── test │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── util │ │ ├── TestDevRelaySrcConfigGen.java │ │ ├── TestInteractiveSchemaGeneratorCli.java │ │ └── TestSchemaMetaDataManager.java └── databus2-cmdline-tools-pkg │ ├── build.gradle │ └── script │ ├── avro-data-gen.sh │ ├── dbus2-avro-schema-gen.sh │ ├── dbus2-interactive-avro-schema-gen.sh │ └── run-devrelay-src-config-gen.sh ├── databus2-example ├── database │ ├── README_Person │ ├── dbreinit_persons.sh │ ├── loadPersons.sh │ └── person │ │ ├── person.tab │ │ ├── person.view │ │ └── tablespace ├── databus2-example-bst-producer-pkg │ ├── build.gradle │ ├── conf │ │ ├── databus-bst-producer.properties │ │ └── databus-bst-producer_log4j.properties │ └── script │ │ ├── setup-bst-producer.inc │ │ ├── start-bst-producer.sh │ │ └── stop-bst-producer.sh ├── databus2-example-client-pkg │ ├── build.gradle │ ├── conf │ │ ├── client_log4j.properties │ │ └── client_person.properties │ └── script │ │ ├── setup-client.inc │ │ ├── start-example-client.sh │ │ └── stop-example-client.sh ├── databus2-example-client │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── client │ │ └── example │ │ ├── PersonClientMain.java │ │ └── PersonConsumer.java ├── databus2-example-person │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── events │ │ └── example │ │ └── person │ │ └── Person_V1.java ├── databus2-example-relay-pkg │ ├── build.gradle │ ├── conf │ │ ├── or_relay_person.properties │ │ ├── relay_log4j.properties │ │ ├── relay_or_person.properties │ │ ├── relay_person.properties │ │ ├── sources-or-person.json │ │ └── sources-person.json │ ├── schemas_registry │ │ ├── com.linkedin.events.example.or_test.Person.1.avsc │ │ ├── com.linkedin.events.example.person.Person.1.avsc │ │ └── index.schemas_registry │ ├── script │ │ ├── create_person.sh │ │ ├── setup-relay.inc │ │ ├── start-example-relay.sh │ │ └── stop-example-relay.sh │ └── sql │ │ ├── create_person.sql │ │ └── insert_person_test_data_1.sql ├── databus2-example-relay │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus │ │ └── relay │ │ └── example │ │ └── PersonRelayServer.java └── schemas_registry │ └── com.linkedin.events.example.person.Person.1.avsc ├── databus2-gg └── databus2-ggparser-impl │ └── build.gradle ├── databus2-relay ├── databus2-event-producer-common │ ├── build.gradle │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── linkedin │ │ ├── databus │ │ └── monitoring │ │ │ └── mbean │ │ │ ├── EventSourceStatistics.java │ │ │ ├── EventSourceStatisticsMBean.java │ │ │ ├── GGParserStatistics.java │ │ │ └── GGParserStatisticsMBean.java │ │ └── databus2 │ │ └── producers │ │ ├── AbstractEventProducer.java │ │ ├── ConstantPartitionFunction.java │ │ ├── EventCreationException.java │ │ ├── EventProducer.java │ │ ├── EventProducerServiceProvider.java │ │ ├── PartitionFunction.java │ │ ├── RelayEventProducersRegistry.java │ │ ├── db │ │ ├── EventFactory.java │ │ ├── EventReaderSummary.java │ │ ├── EventSourceStatisticsIface.java │ │ ├── GGMonitoredSourceInfo.java │ │ ├── OracleTriggerMonitoredSourceInfo.java │ │ └── ReadEventCycleSummary.java │ │ └── ds │ │ ├── DbChangeEntry.java │ │ ├── KeyPair.java │ │ ├── PerSourceTransaction.java │ │ ├── PrimaryKeySchema.java │ │ └── Transaction.java ├── databus2-event-producer-mock │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── linkedin │ │ │ │ └── databus2 │ │ │ │ └── producers │ │ │ │ ├── MockEventProducerServiceProvider.java │ │ │ │ └── RelayEventGenerator.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── services │ │ │ └── com.linkedin.databus2.producers.EventProducerServiceProvider │ │ └── test │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus2 │ │ └── producers │ │ └── TestMockEventProducerServiceProvider.java ├── databus2-event-producer-or │ ├── build.gradle │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── linkedin │ │ │ │ └── databus2 │ │ │ │ └── producers │ │ │ │ ├── ORListener.java │ │ │ │ ├── ORMonitoredSourceInfo.java │ │ │ │ ├── OpenReplicatorAvroEventFactory.java │ │ │ │ ├── OpenReplicatorEventProducer.java │ │ │ │ ├── OpenReplicatorEventProducerServiceProvider.java │ │ │ │ ├── TransactionWriter.java │ │ │ │ └── util │ │ │ │ └── Or2AvroConvert.java │ │ └── resources │ │ │ └── META-INF │ │ │ └── services │ │ │ └── com.linkedin.databus2.producers.EventProducerServiceProvider │ │ └── test │ │ └── java │ │ └── com │ │ └── linkedin │ │ └── databus2 │ │ └── producers │ │ └── TestOpenReplicatorEventProducer.java └── databus2-relay-impl │ ├── build.gradle │ └── src │ ├── main │ └── java │ │ └── com │ │ └── linkedin │ │ ├── databus │ │ ├── container │ │ │ ├── netty │ │ │ │ ├── HttpRelay.java │ │ │ │ ├── HttpRelayPipelineFactory.java │ │ │ │ └── RelayStatisticsCollectingHandler.java │ │ │ └── request │ │ │ │ ├── BufferInfoRequestProcessor.java │ │ │ │ ├── ChannelCloseFaultInjectionRequestProcessor.java │ │ │ │ ├── ControlSourceEventsRequestProcessor.java │ │ │ │ ├── FaultInjectionRequestProcessor.java │ │ │ │ ├── GenerateDataEventsRequestProcessor.java │ │ │ │ ├── LoadDataEventsRequestProcessor.java │ │ │ │ ├── OracleProducerTestRequestProcessor.java │ │ │ │ ├── PhysicalBuffersRequestProcessor.java │ │ │ │ ├── PhysicalSourcesRequestProcessor.java │ │ │ │ ├── ReadEventsRequestProcessor.java │ │ │ │ ├── RegisterRequestProcessor.java │ │ │ │ ├── RelayCommandRequestProcessor.java │ │ │ │ ├── RelayContainerStatsRequestProcessor.java │ │ │ │ ├── RelayStatsRequestProcessor.java │ │ │ │ └── SourcesRequestProcessor.java │ │ ├── core │ │ │ ├── ConcurrentAppendableCompositeFileInputStream.java │ │ │ ├── ConcurrentAppendableSingleFileInputStream.java │ │ │ ├── ScnTxnPos.java │ │ │ ├── TrailFileNotifier.java │ │ │ ├── TrailFilePositionSetter.java │ │ │ └── util │ │ │ │ └── PhysicalSourceConfigBuilder.java │ │ └── monitoring │ │ │ ├── events │ │ │ └── DbusDbSourceConnectionStatsEvent.java │ │ │ └── mbean │ │ │ ├── DBStatistics.java │ │ │ ├── DBStatisticsMBean.java │ │ │ ├── DbusDbSourceConnectionStats.java │ │ │ ├── DbusDbSourceConnectionStatsMBean.java │ │ │ ├── SourceDBStatistics.java │ │ │ └── SourceDBStatisticsMBean.java │ │ └── databus2 │ │ ├── ggParser │ │ ├── XmlStateMachine │ │ │ ├── AbstractStateTransitionProcessor.java │ │ │ ├── ColumnState.java │ │ │ ├── ColumnsState.java │ │ │ ├── DbUpdateState.java │ │ │ ├── PrimaryKey.java │ │ │ ├── RootState.java │ │ │ ├── ShutdownState.java │ │ │ ├── StateMachine.java │ │ │ ├── StateMachineHelper.java │ │ │ ├── StateProcessor.java │ │ │ ├── TokenState.java │ │ │ ├── TokensState.java │ │ │ ├── TransactionState.java │ │ │ ├── TransactionSuccessCallBack.java │ │ │ └── XmlStreamReaderHelper.java │ │ └── staxparser │ │ │ ├── AvroFiller.java │ │ │ ├── AvroSchemaHandler.java │ │ │ ├── StaxBuilder.java │ │ │ ├── StaxBuilderTest.java │ │ │ ├── XmlParser.java │ │ │ └── validator │ │ │ ├── XmlFormatTrailParser.java │ │ │ └── XmlFormatTrailValidator.java │ │ ├── producers │ │ ├── RelayEventProducer.java │ │ ├── RelayStatsAdapter.java │ │ ├── db │ │ │ ├── GGXMLTrailTransactionFinder.java │ │ │ ├── OracleAvroGenericEventFactory.java │ │ │ ├── OracleEventProducer.java │ │ │ ├── OracleRelayFactory.java │ │ │ ├── OracleTxlogEventReader.java │ │ │ └── SourceDBEventReader.java │ │ └── gg │ │ │ ├── DBUpdatesMergeUtils.java │ │ │ └── GGEventGenerationFactory.java │ │ └── relay │ │ ├── AbstractRelayFactory.java │ │ ├── DatabusRelayMain.java │ │ ├── GoldenGateEventProducer.java │ │ ├── MonitoringEventProducer.java │ │ ├── OracleEventProducerFactory.java │ │ ├── OracleJarUtils.java │ │ ├── RelayFactory.java │ │ ├── config │ │ ├── DataSourcesStaticConfig.java │ │ └── DataSourcesStaticConfigBuilder.java │ │ └── util │ │ └── test │ │ └── DatabusRelayTestUtil.java │ └── test │ ├── TestData │ ├── SchemaRegistry │ │ └── com.linkedin.events.member2.test.test.1.avsc │ └── XmlData │ │ ├── DifferentOperations.xml │ │ ├── basicprocessing.xml │ │ ├── extrafields.xml │ │ ├── extraspaces.xml │ │ ├── keyCompression.xml │ │ ├── missingfields.xml │ │ ├── missingscn.xml │ │ ├── missingtokens.xml │ │ ├── nullTransactions.xml │ │ ├── nullfields.xml │ │ └── sortMultipleSources.xml │ ├── java │ └── com │ │ └── linkedin │ │ ├── databus │ │ ├── container │ │ │ └── netty │ │ │ │ ├── TestRegisterRequestProcessor.java │ │ │ │ └── TestRelayCommandsLocal.java │ │ └── core │ │ │ ├── TestChunkedBodyWritableByteChannel.java │ │ │ ├── TestConcurrentAppendOnlyCompositeFileStream.java │ │ │ ├── TestConcurrentAppendOnlySingleFileInputStream.java │ │ │ ├── TestEventLogWriter.java │ │ │ ├── TestTrailFilePositionSetter.java │ │ │ └── test │ │ │ └── netty │ │ │ ├── FooterAwareHttpChunkAggregator.java │ │ │ ├── SimpleHttpResponseHandler.java │ │ │ └── SimpleTestHttpClient.java │ │ ├── databus2 │ │ ├── ggParser │ │ │ ├── XmlStateMachine │ │ │ │ └── TestPrimaryKey.java │ │ │ └── staxparser │ │ │ │ └── validator │ │ │ │ └── TestXmlFormatTrailValidator.java │ │ └── relay │ │ │ ├── TestDatabusRelayEvents.java │ │ │ ├── TestDatabusRelayMain.java │ │ │ ├── TestGoldenGateEventProducer.java │ │ │ └── TestOracleJarUtils.java │ │ └── ggtest │ │ ├── DummyTransactionCallback.java │ │ └── TestParser.java │ └── resources │ ├── com.linkedin.events.example.Account.1.avsc │ ├── com.linkedin.events.example.Settings.1.avsc │ ├── com.linkedin.events.example.fake.FakeSchema.1.avsc │ ├── com.linkedin.events.example.fake.FakeSchema.2.avsc │ ├── com.linkedin.events.example.person.Person.1.avsc │ └── index.schemas_registry ├── db ├── databus2-bootstrap │ ├── .ant-targets-build.xml │ ├── bootstrap_create_tables.sh │ ├── bootstrap_db_reinit.sh │ ├── bootstrap_drop_tables.sh │ ├── build.gradle │ ├── createSchema │ │ ├── apply_patches.sh │ │ ├── createSchema.sh │ │ ├── dropSchema.sh │ │ └── schema │ │ │ └── cdsddl.tab │ ├── createUser │ │ ├── README │ │ └── cr_databus2.sh │ ├── database.properties │ └── schema │ │ └── ddl │ │ ├── cdsddl.ind │ │ └── cdsddl.tab ├── oracle │ ├── README │ ├── bin │ │ ├── createSchema.sh │ │ ├── createUser.sh │ │ └── dropSchema.sh │ └── fwk │ │ └── schema │ │ ├── ddl_con.sh │ │ ├── ddl_ind.sh │ │ ├── ddl_prc.sh │ │ ├── ddl_prc1.sh │ │ ├── ddl_sqs.sh │ │ ├── ddl_tab.sh │ │ ├── ddl_trg.sh │ │ └── ddl_vw.sh └── templates │ ├── cdsddl.prc │ ├── cdsddl.prc1 │ └── cdsddl.sqs ├── defaultEnvironment.gradle ├── doc ├── engineering_docs │ ├── CrossColoReplication.graffle │ ├── DbusEvent.pdf │ ├── client-library-arch.graffle │ ├── client-library-arch.png │ ├── relay-architecture.graffle │ └── relay-architecture.png └── user_docs │ ├── DatabusExecModel.graffle │ ├── DatabusExecModel.png │ ├── DatabusV2Events.png │ ├── DatabusV2EventsMT.graffle │ ├── dynamic-clb.png │ ├── sm-client-bootstrap-failmode.graffle │ ├── sm-client-bootstrap-failmode.jpg │ ├── sm-client-bootstrap-overview.graffle │ ├── sm-client-bootstrap-overview.jpg │ ├── sm-client-bootstrap-stream-requested.graffle │ ├── sm-client-bootstrap-stream-requested.jpg │ ├── sm-client-dispatcher-dataevents.graffle │ ├── sm-client-dispatcher-dataevents.jpg │ ├── sm-client-dispatcher-overview.graffle │ ├── sm-client-dispatcher-overview.jpg │ ├── sm-client-overview-failmode.graffle │ ├── sm-client-overview-failmode.jpg │ ├── sm-client-overview.graffle │ ├── sm-client-overview.jpg │ ├── sm-client-stream-requested.graffle │ ├── sm-client-stream-requested.jpg │ ├── static-clb.png │ ├── static_relay_chaining.graffle │ └── static_relay_chaining.png ├── gradle.properties ├── javadoc └── index.html ├── merge-source-trees.sh ├── metrics-histograms └── metrics-core-impl │ ├── build.gradle │ └── src │ ├── main │ └── java │ │ └── com │ │ └── codahale │ │ └── metrics │ │ └── MergeableExponentiallyDecayingReservoir.java │ └── test │ └── java │ └── com │ └── codahale │ └── metrics │ └── TestMergeableExponentiallyDecayingReservoir.java ├── sandbox-repo ├── com │ ├── google │ │ └── open-replicator │ │ │ ├── 1.0.5 │ │ │ ├── open-replicator-1.0.5-sources.jar │ │ │ └── open-replicator-1.0.5.jar │ │ │ └── 1.0.7 │ │ │ ├── open-replicator-1.0.7-sources.jar │ │ │ └── open-replicator-1.0.7.jar │ ├── linkedin │ │ └── helix │ │ │ └── helix-core │ │ │ └── 0.5.31 │ │ │ ├── helix-core-0.5.31.ivy │ │ │ └── helix-core-0.5.31.jar │ └── oracle │ │ └── ojdbc6 │ │ └── 11.2.0.2.0 │ │ ├── README │ │ └── ojdbc6-11.2.0.2.0.ivy └── net │ └── sf │ └── josql │ ├── gentlyweb-utils │ └── 1.5 │ │ ├── gentlyweb-utils-1.5.ivy │ │ └── gentlyweb-utils-1.5.jar │ └── josql │ └── 1.5 │ ├── josql-1.5.ivy │ └── josql-1.5.jar ├── script └── setup.inc ├── settings.gradle └── subprojects.gradle /.rat-excludes: -------------------------------------------------------------------------------- 1 | build 2 | build.gradle 3 | build_script 4 | CHANGELOG 5 | codecoverage 6 | config 7 | database 8 | defaultEnvironment.gradle 9 | doc 10 | integration-test 11 | javadoc 12 | LICENSE.txt 13 | README 14 | sandbox-repo 15 | settings.gradle 16 | svninfo 17 | 18 | -------------------------------------------------------------------------------- /.reviewboardrc: -------------------------------------------------------------------------------- 1 | REPOSITORY='databus2' 2 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | subprojects { 2 | apply from: rootProject.file("subprojects.gradle") 3 | 4 | dependencies { 5 | //runtime externalDependency.log4j 6 | // Force easymock to version 3.1. One of the espresso dependencies changes it to 2.4 7 | // and v2.4 does not support mocking of classes, causing our espresso unit tests 8 | // to break. 9 | //runtime(externalDependency.easymock) { 10 | // force = true 11 | //} 12 | //compile(externalDependency.easymock) { 13 | // force = true 14 | //} 15 | } 16 | } 17 | 18 | task wrapper(type: Wrapper) { 19 | gradleVersion = '1.8' 20 | } 21 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright 2013 LinkedIn Corp. All rights reserved 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # 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 | # 19 | 20 | gradle -Dopen_source $* 21 | -------------------------------------------------------------------------------- /build_script/avroSchema.gradle: -------------------------------------------------------------------------------- 1 | final Configuration dataAvroConfig = project(':data-avro').configurations.default 2 | final Configuration dataConfig = project(':data').configurations.default 3 | 4 | project.sourceSets.all { SourceSet sourceSet -> 5 | final inputDataSchemaDirPath = "src${File.separatorChar}${sourceSet.name}${File.separatorChar}pegasus" 6 | final String outputDirPath = "src${File.separatorChar}${sourceSet.name}GeneratedAvroSchema${File.separatorChar}avro" 7 | 8 | final FileTree inputDataSchemaFiles = project.fileTree(dir: inputDataSchemaDirPath, includes: ["**${File.separatorChar}*.pdsc"]) 9 | if (inputDataSchemaFiles.empty) 10 | { 11 | return; 12 | } 13 | 14 | project.mkdir(outputDirPath) 15 | 16 | final Task generateAvroSchemaTask = project.task(sourceSet.name + 'GenerateAvroSchema', type: JavaExec) { 17 | main = 'com.linkedin.data.avro.generator.AvroSchemaGenerator' 18 | classpath = dataAvroConfig + dataAvroConfig.allArtifacts.files + dataConfig + dataConfig.allArtifacts.files 19 | args outputDirPath 20 | args inputDataSchemaFiles 21 | systemProperties(['generator.resolver.path': inputDataSchemaDirPath]) 22 | } 23 | 24 | project.tasks[sourceSet.getTaskName('', 'jar')].dependsOn(generateAvroSchemaTask) 25 | } -------------------------------------------------------------------------------- /build_script/dataTemplate.gradle: -------------------------------------------------------------------------------- 1 | final Configuration generatorConfig = project(':generator').configurations.default 2 | 3 | project.sourceSets.all { SourceSet sourceSet -> 4 | final inputDataSchemaDirPath = "src${File.separatorChar}${sourceSet.name}${File.separatorChar}pegasus" 5 | final String outputDirPath = "src${File.separatorChar}${sourceSet.name}GeneratedDataTemplate${File.separatorChar}java" 6 | 7 | final FileTree inputDataSchemaFiles = project.fileTree(dir: inputDataSchemaDirPath, includes: ["**${File.separatorChar}*.pdsc"]) 8 | if (inputDataSchemaFiles.empty) 9 | { 10 | return; 11 | } 12 | 13 | final File outputDir = project.mkdir(outputDirPath) 14 | sourceSet.java.srcDir(outputDir) 15 | 16 | final Task generateDataTemplateTask = project.task(sourceSet.name + 'GenerateDataTemplate', type: JavaExec) { 17 | main = 'com.linkedin.pegasus.generator.PegasusDataTemplateGenerator' 18 | classpath = generatorConfig + generatorConfig.allArtifacts.files 19 | args outputDirPath 20 | args inputDataSchemaFiles 21 | systemProperties(['generator.resolver.path': inputDataSchemaDirPath]) 22 | } 23 | 24 | project.tasks[sourceSet.compileJavaTaskName].dependsOn(generateDataTemplateTask) 25 | } -------------------------------------------------------------------------------- /build_script/restClient.gradle: -------------------------------------------------------------------------------- 1 | final Configuration restliToolsConfig = project(':restli-tools').configurations.default 2 | 3 | project.sourceSets.all { SourceSet sourceSet -> 4 | final inputIdlDirPath = "src${File.separatorChar}${sourceSet.name}${File.separatorChar}idl" 5 | final String outputDirPath = "src${File.separatorChar}${sourceSet.name}GeneratedRest${File.separatorChar}java" 6 | 7 | final FileTree inputIdlFiles = project.fileTree(dir: inputIdlDirPath, includes: ["**${File.separatorChar}*.restspec.json"]) 8 | if (inputIdlFiles.empty) 9 | { 10 | return; 11 | } 12 | 13 | final File outputDir = project.mkdir(outputDirPath) 14 | sourceSet.java.srcDir(outputDir) 15 | 16 | final Task generateRestClientTask = project.task(sourceSet.name + 'GenerateRestClient', type: JavaExec) { 17 | main = 'com.linkedin.restli.tools.clientgen.RestRequestBuilderGenerator' 18 | classpath = restliToolsConfig + restliToolsConfig.allArtifacts.files 19 | args outputDirPath 20 | args inputIdlFiles 21 | systemProperties(['generator.resolver.path': "src${File.separatorChar}${sourceSet.name}${File.separatorChar}pegasus", 22 | 'generator.rest.generate.datatemplates': 'false']) 23 | } 24 | 25 | project.tasks[sourceSet.compileJavaTaskName].dependsOn(generateRestClientTask) 26 | } -------------------------------------------------------------------------------- /build_script/restModel.gradle: -------------------------------------------------------------------------------- 1 | final Configuration restliToolsConfig = project(':restli-tools').configurations.default 2 | 3 | project.sourceSets.all { SourceSet sourceSet -> 4 | if (project.ext.resourcePackages[sourceSet.name] == null || 5 | project.ext.resourcePackages[sourceSet.name].empty) 6 | { 7 | return; 8 | } 9 | 10 | final String outputDirPath = "src${File.separatorChar}${sourceSet.name}GeneratedRest${File.separatorChar}idl" 11 | mkdir(outputDirPath) 12 | 13 | final Task generateRestModelTask = project.task(sourceSet.name + 'GenerateRestModel', 14 | type: JavaExec, 15 | dependsOn: tasks[sourceSet.classesTaskName]) { 16 | main = 'com.linkedin.restli.tools.idlgen.RestLiResourceModelExporterCmdLineApp' 17 | classpath = restliToolsConfig + restliToolsConfig.allArtifacts.files + sourceSet.compileClasspath + project.files(sourceSet.output.classesDir) 18 | args '-outdir' 19 | args outputDirPath 20 | args '-sourcepath' 21 | args sourceSet.java.srcDirs 22 | args '-resourcepackages' 23 | args resourcePackages[sourceSet.name] 24 | } 25 | 26 | project.tasks[sourceSet.getTaskName('', 'jar')].dependsOn(generateRestModelTask) 27 | } -------------------------------------------------------------------------------- /database/databus2-bootstrap/createSchema/logs/schema.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/database/databus2-bootstrap/createSchema/logs/schema.log -------------------------------------------------------------------------------- /databus-bootstrap-client/databus-bootstrap-client-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-bootstrap-common:databus-bootstrap-common-impl') 5 | compile project(':databus-client:databus-client-api') 6 | compile project(':databus-client:databus-client-http') 7 | compile project(':databus-client:databus-client-common') 8 | compile project(':databus-core:databus-core-schemas') 9 | compile project(':databus-core:databus-core-impl') 10 | compile project(':databus-core:databus-core-container') 11 | 12 | compile externalDependency.avro 13 | compile externalDependency.jacksonCoreAsl 14 | compile externalDependency.jacksonMapperAsl 15 | compile externalDependency.log4j 16 | compile externalDependency.netty 17 | } 18 | -------------------------------------------------------------------------------- /databus-bootstrap-common/databus-bootstrap-common-api/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-core:databus-core-impl') 5 | 6 | compile externalDependency.log4j 7 | } 8 | -------------------------------------------------------------------------------- /databus-bootstrap-common/databus-bootstrap-common-api/src/main/java/com/linkedin/databus/bootstrap/api/BootstrapEventCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.linkedin.databus.bootstrap.api; 5 | /* 6 | * 7 | * Copyright 2013 LinkedIn Corp. All rights reserved 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, 16 | * software distributed under the License is distributed on an 17 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | * KIND, either express or implied. See the License for the 19 | * specific language governing permissions and limitations 20 | * under the License. 21 | * 22 | */ 23 | 24 | 25 | import java.sql.ResultSet; 26 | 27 | import com.linkedin.databus.core.Checkpoint; 28 | import com.linkedin.databus.core.monitoring.mbean.DbusEventsStatisticsCollector; 29 | 30 | public interface BootstrapEventCallback 31 | { 32 | // it shall be called for each row fetched from database 33 | BootstrapEventProcessResult onEvent(ResultSet rs, DbusEventsStatisticsCollector statsCollector) throws BootstrapProcessingException; 34 | 35 | void onCheckpointEvent(Checkpoint ckpt, DbusEventsStatisticsCollector curStatsCollector); 36 | } 37 | -------------------------------------------------------------------------------- /databus-bootstrap-common/databus-bootstrap-common-api/src/main/java/com/linkedin/databus/bootstrap/api/BootstrapProcessingException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.linkedin.databus.bootstrap.api; 5 | /* 6 | * 7 | * Copyright 2013 LinkedIn Corp. All rights reserved 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, 16 | * software distributed under the License is distributed on an 17 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | * KIND, either express or implied. See the License for the 19 | * specific language governing permissions and limitations 20 | * under the License. 21 | * 22 | */ 23 | 24 | public class BootstrapProcessingException extends Exception 25 | { 26 | private static final long serialVersionUID = 1L; 27 | 28 | public BootstrapProcessingException(String arg0, Throwable arg1) 29 | { 30 | super(arg0, arg1); 31 | } 32 | 33 | public BootstrapProcessingException(String arg0) 34 | { 35 | super(arg0); 36 | } 37 | 38 | public BootstrapProcessingException(Throwable arg0) 39 | { 40 | super(arg0); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /databus-bootstrap-common/databus-bootstrap-common-api/src/main/java/com/linkedin/databus/bootstrap/api/BootstrapRequestAction.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.bootstrap.api; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public enum BootstrapRequestAction 23 | { 24 | get_snapshot, 25 | get_catchup, 26 | get_scn 27 | } 28 | -------------------------------------------------------------------------------- /databus-bootstrap-common/databus-bootstrap-common-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-bootstrap-common:databus-bootstrap-common-api') 5 | compile project(':databus-client:databus-client-http') 6 | compile project(':databus-client:databus-client-api') 7 | compile project(':databus-core:databus-core-impl') 8 | compile project(':databus-core:databus-core-container') 9 | 10 | compile externalDependency.log4j 11 | compile externalDependency.mysqlConnectorJava 12 | compile externalDependency.avro 13 | compile externalDependency.jacksonCoreAsl 14 | compile externalDependency.jacksonMapperAsl 15 | 16 | } 17 | -------------------------------------------------------------------------------- /databus-bootstrap-common/databus-bootstrap-common-impl/src/main/java/com/linkedin/databus/bootstrap/common/BootstrapDataAccessObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2013 LinkedIn Corp. All rights reserved 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | */ 19 | 20 | -------------------------------------------------------------------------------- /databus-bootstrap-producer/databus-bootstrap-producer-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-bootstrap-common:databus-bootstrap-common-api') 5 | compile project(':databus-bootstrap-common:databus-bootstrap-common-impl') 6 | compile project(':databus-bootstrap-utils:databus-bootstrap-utils-impl') 7 | compile project(':databus-client:databus-client-api') 8 | compile project(':databus-client:databus-client-http') 9 | compile project(':databus-client:databus-client-common') 10 | compile project(':databus-core:databus-core-impl') 11 | compile project(':databus-core:databus-core-container') 12 | compile project(':databus2-relay:databus2-relay-impl') 13 | 14 | compile externalDependency.log4j 15 | compile externalDependency.mysqlConnectorJava 16 | compile externalDependency.avro 17 | } 18 | -------------------------------------------------------------------------------- /databus-bootstrap-producer/databus-bootstrap-producer-impl/src/main/java/com/linkedin/databus/bootstrap/producer/BootstrapProducerDestination.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2013 LinkedIn Corp. All rights reserved 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | */ 19 | 20 | -------------------------------------------------------------------------------- /databus-bootstrap-server/databus-bootstrap-server-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | test.workingDir = "${project.rootDir}" 4 | test.dependsOn(':db:databus2-bootstrap:reinit') 5 | 6 | dependencies { 7 | compile project(':databus-bootstrap-common:databus-bootstrap-common-api') 8 | compile project(':databus-bootstrap-common:databus-bootstrap-common-impl') 9 | compile project(':databus-client:databus-client-api') 10 | compile project(':databus-core:databus-core-impl') 11 | compile project(':databus-core:databus-core-schemas') 12 | compile project(':databus-core:databus-core-container') 13 | compile project(':databus2-relay:databus2-relay-impl') 14 | 15 | compile externalDependency.log4j 16 | compile externalDependency.mysqlConnectorJava 17 | compile externalDependency.jacksonCoreAsl 18 | compile externalDependency.jacksonMapperAsl 19 | compile externalDependency.json 20 | 21 | 22 | testCompile externalDependency.testng 23 | testCompile externalDependency.easymock 24 | testCompile project(':databus-core:databus-core-fwk-test') 25 | } 26 | 27 | test.useTestNG() 28 | -------------------------------------------------------------------------------- /databus-bootstrap-server/databus-bootstrap-server-pkg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-bootstrap-server:databus-bootstrap-server-impl') 5 | } 6 | 7 | task myTar(type: Tar) { 8 | extension = 'tar.gz' 9 | baseName = project.name 10 | compression = Compression.GZIP 11 | 12 | into("conf") { from "conf/" } 13 | 14 | from("script") { 15 | into ("bin") 16 | fileMode = 0755 17 | } 18 | 19 | into("bin") { 20 | from("${project.rootDir}/script") 21 | include('setup.inc') 22 | } 23 | 24 | into("lib") { 25 | from configurations.runtime 26 | } 27 | } 28 | 29 | myTar.dependsOn ':databus-bootstrap-server:databus-bootstrap-server-impl:assemble' 30 | assemble.dependsOn myTar 31 | -------------------------------------------------------------------------------- /databus-bootstrap-server/databus-bootstrap-server-pkg/conf/databus-bst-server.properties: -------------------------------------------------------------------------------- 1 | databus.bootstrap.db.bootstrapDBHostname=localhost 2 | databus.bootstrap.db.bootstrapDBPassword=bootstrap 3 | databus.bootstrap.db.bootstrapDBUsername=bootstrap 4 | databus.bootstrap.db.bootstrapLogSize=1024000 5 | databus.bootstrap.db.bootstrapBatchSize=1000 6 | databus.bootstrap.db.container.httpPort=11111 7 | databus.bootstrap.db.container.jmx.rmiEnabled=false 8 | databus.bootstrap.defaultRowsThresholdForSnapshotBypass=-1 9 | 10 | -------------------------------------------------------------------------------- /databus-bootstrap-server/databus-bootstrap-server-pkg/script/setup-bst-server.inc: -------------------------------------------------------------------------------- 1 | var_dir=${script_dir}/../var 2 | 3 | if [ ! -d ${var_dir} ] ; then 4 | mkdir -p ${var_dir} 5 | fi 6 | 7 | pid_file=${var_dir}/databus-bst-server.pid 8 | out_file=${logs_dir}/databus-bst-server.out 9 | jvm_gc_log=${logs_dir}/databus-bst-server_gc.log 10 | 11 | 12 | # Custom memory configuration 13 | heap_size= 14 | max_heap_size=${heap_size:-} 15 | new_size= 16 | max_new_size=${new_size:-} 17 | direct_mem_size= 18 | -------------------------------------------------------------------------------- /databus-bootstrap-server/databus-bootstrap-server-pkg/script/stop-bst-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | script_dir=`dirname $0` 22 | source $script_dir/setup.inc 23 | source $script_dir/setup-bst-server.inc 24 | 25 | if [ -f ${pid_file} ] ; then 26 | kill `cat ${pid_file}` 27 | else 28 | echo "$0: unable to find PID file ${pid_file}" 29 | fi 30 | -------------------------------------------------------------------------------- /databus-bootstrap-utils/databus-bootstrap-utils-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-bootstrap-common:databus-bootstrap-common-api') 5 | compile project(':databus-bootstrap-common:databus-bootstrap-common-impl') 6 | compile project(':databus-client:databus-client-http') 7 | compile project(':databus-client:databus-client-common') 8 | compile project(':databus-core:databus-core-impl') 9 | compile project(':databus-core:databus-core-schemas') 10 | compile project(':databus-core:databus-core-container') 11 | compile project(':databus2-relay:databus2-relay-impl') 12 | 13 | compile externalDependency.log4j 14 | compile externalDependency.mysqlConnectorJava 15 | compile externalDependency.avro 16 | compile externalDependency.commonsCli 17 | compile externalDependency.jacksonCoreAsl 18 | compile externalDependency.jacksonMapperAsl 19 | 20 | runtime externalDependency.ojdbc6 21 | } 22 | -------------------------------------------------------------------------------- /databus-bootstrap-utils/databus-bootstrap-utils-impl/src/main/java/com/linkedin/databus/bootstrap/utils/BootstrapReaderEventHandler.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.bootstrap.utils; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import org.apache.avro.generic.GenericRecord; 23 | 24 | import com.linkedin.databus.core.DbusEvent; 25 | 26 | public interface BootstrapReaderEventHandler { 27 | 28 | public void onStart(String query); 29 | 30 | public void onRecord(DbusEvent event, GenericRecord record); 31 | 32 | public void onEnd(int count); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /databus-bootstrap-utils/databus-bootstrap-utils-impl/src/main/java/com/linkedin/databus/bootstrap/utils/bst_reader/filter/BootstrapReaderFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2013 LinkedIn Corp. All rights reserved 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | */ 19 | package com.linkedin.databus.bootstrap.utils.bst_reader.filter; 20 | 21 | import org.apache.avro.generic.GenericRecord; 22 | 23 | import com.linkedin.databus.core.DbusEvent; 24 | 25 | /** 26 | * Filter for bootstrap events 27 | */ 28 | public interface BootstrapReaderFilter 29 | { 30 | /** return true if the specified event with the specified payload matches the filter */ 31 | public boolean matches(DbusEvent event, GenericRecord payload); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /databus-client/databus-client-api/src/main/java/com/linkedin/databus/client/pub/DatabusCombinedConsumer.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client.pub; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /** 23 | * A convenience interface for consumers which implement both the {@link DatabusStreamConsumer} and 24 | * {@link DatabusBootstrapConsumer}. 25 | */ 26 | public interface DatabusCombinedConsumer extends DatabusStreamConsumer, DatabusBootstrapConsumer 27 | { 28 | /** 29 | * @return true, if this consumer-callback instance can consume bootstrap/catchup events 30 | * false, if it cannot 31 | */ 32 | public boolean canBootstrap(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /databus-client/databus-client-api/src/main/java/com/linkedin/databus/client/pub/DatabusInvalidRegistrationException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client.pub; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public class DatabusInvalidRegistrationException 23 | extends RuntimeException 24 | { 25 | public DatabusInvalidRegistrationException() 26 | { 27 | super(); 28 | } 29 | 30 | public DatabusInvalidRegistrationException(String message) 31 | { 32 | super(message); 33 | } 34 | 35 | public DatabusInvalidRegistrationException(String message, Throwable throwable) 36 | { 37 | super(message, throwable); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /databus-client/databus-client-api/src/main/java/com/linkedin/databus/client/pub/DatabusLegacyConsumerAdapter.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client.pub; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /* 23 | * Marker Interface for all Consumers transforming V2 to V1 Events 24 | */ 25 | public interface DatabusLegacyConsumerAdapter 26 | { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /databus-client/databus-client-api/src/main/java/com/linkedin/databus/client/pub/DatabusLegacyEventConverter.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client.pub; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import java.util.List; 23 | 24 | /* 25 | * Interface for converting Databus V2 Event Objects to V1 Event Objects 26 | * 27 | */ 28 | public interface DatabusLegacyEventConverter 29 | { 30 | /* 31 | * Convert a V2 Event object to a V1 event Object 32 | */ 33 | DatabusEventHolder convert(DatabusEventHolder event); 34 | 35 | 36 | /* 37 | * Convert a List Event objects to a List of V1 events objects 38 | */ 39 | List> convert(List> events); 40 | } 41 | -------------------------------------------------------------------------------- /databus-client/databus-client-api/src/main/java/com/linkedin/databus/client/pub/DbusPartitionInfo.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client.pub; 2 | 3 | 4 | /* 5 | * 6 | * Copyright 2013 LinkedIn Corp. All rights reserved 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * 26 | * Databus Partition Info 27 | * 28 | */ 29 | public interface DbusPartitionInfo 30 | { 31 | /** 32 | * 33 | * @return numeric id of this partition 34 | */ 35 | public long getPartitionId(); 36 | 37 | /** 38 | * 39 | * Checks if other partition is equal to this instance 40 | * @param other 41 | * @return true if equal otherwise false 42 | */ 43 | public boolean equalsPartition(DbusPartitionInfo other); 44 | 45 | } 46 | -------------------------------------------------------------------------------- /databus-client/databus-client-api/src/main/java/com/linkedin/databus/client/pub/DbusServerSideFilterFactory.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client.pub; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | import com.linkedin.databus.core.util.InvalidConfigException; 22 | import com.linkedin.databus2.core.filter.DbusKeyCompositeFilterConfig; 23 | 24 | 25 | /** 26 | * Factory interface for generating server-side filter corresponding to the partition 27 | * that is getting added. 28 | * 29 | * @author bvaradar 30 | * 31 | */ 32 | public interface DbusServerSideFilterFactory 33 | { 34 | public DbusKeyCompositeFilterConfig createServerSideFilter(DbusClusterInfo cluster, 35 | DbusPartitionInfo partition) throws InvalidConfigException; 36 | } 37 | -------------------------------------------------------------------------------- /databus-client/databus-client-api/src/main/java/com/linkedin/databus/client/pub/StartResult.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client.pub; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public interface StartResult { 23 | /** 24 | * Result of start 25 | */ 26 | public boolean getSuccess(); 27 | 28 | /** 29 | * Error Message when result code failed. 30 | * @return null, if start did not fail 31 | * error message otherwise 32 | */ 33 | public String getErrorMessage(); 34 | 35 | /** 36 | * Returns an exception in case of an error 37 | * If there is no exception ( but there is an error ), can return null 38 | * @return 39 | */ 40 | public Exception getException(); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /databus-client/databus-client-common/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-client:databus-client-api') 5 | compile project(':databus-core:databus-core-impl') 6 | compile project(':databus-core:databus-core-container') 7 | compile project(':databus-core:databus-core-schemas') 8 | compile project(':databus-group-leader:databus-group-leader-api') 9 | 10 | compile externalDependency.avro 11 | compile externalDependency.jacksonCoreAsl 12 | compile externalDependency.jacksonMapperAsl 13 | compile externalDependency.log4j 14 | 15 | testCompile project(':databus-core:databus-core-fwk-test') 16 | testCompile project(':databus-group-leader:databus-group-leader-impl') 17 | 18 | testCompile externalDependency.testng 19 | testCompile externalDependency.easymock 20 | testCompile externalDependency.easymockext 21 | } 22 | 23 | test.useTestNG() 24 | -------------------------------------------------------------------------------- /databus-client/databus-client-common/src/main/java/com/linkedin/databus/client/consumer/AbstractDatabusV3Consumer.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client.consumer; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import com.linkedin.databus.client.pub.DatabusV3Consumer; 23 | 24 | /** Default implementation of {@link DatabusV3Consumer} interface.*/ 25 | public class AbstractDatabusV3Consumer extends AbstractDatabusCombinedConsumer 26 | implements DatabusV3Consumer 27 | { 28 | 29 | @Override 30 | public boolean canBootstrap() 31 | { 32 | return false; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /databus-client/databus-client-http/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-client:databus-client-api') 5 | compile project(':databus-client:databus-client-common') 6 | compile project(':databus-core:databus-core-impl') 7 | compile project(':databus-core:databus-core-container') 8 | compile project(':databus-core:databus-core-schemas') 9 | compile project(':databus-group-leader:databus-group-leader-api') 10 | 11 | compile externalDependency.avro 12 | compile externalDependency.jacksonCoreAsl 13 | compile externalDependency.jacksonMapperAsl 14 | compile externalDependency.log4j 15 | compile externalDependency.netty 16 | compile externalDependency.commonsCli 17 | 18 | testCompile project(':databus-core:databus-core-fwk-test') 19 | testCompile project(':databus-group-leader:databus-group-leader-impl') 20 | testCompile project(':databus-client:databus-client-test-util') 21 | 22 | testCompile externalDependency.testng 23 | testCompile externalDependency.easymock 24 | testCompile externalDependency.easymockext 25 | } 26 | 27 | test.useTestNG() 28 | -------------------------------------------------------------------------------- /databus-client/databus-client-http/src/main/java/com/linkedin/databus/client/ConnectionStateFactory.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client; 2 | 3 | import java.util.List; 4 | 5 | import com.linkedin.databus.core.DbusEventBuffer; 6 | /* 7 | * 8 | * Copyright 2013 LinkedIn Corp. All rights reserved 9 | * 10 | * Licensed under the Apache License, Version 2.0 (the "License"); 11 | * you may not use this file except in compliance with the License. 12 | * You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, 17 | * software distributed under the License is distributed on an 18 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19 | * KIND, either express or implied. See the License for the 20 | * specific language governing permissions and limitations 21 | * under the License. 22 | * 23 | */ 24 | 25 | public class ConnectionStateFactory 26 | { 27 | protected List _sourcesNames = null; 28 | 29 | public ConnectionStateFactory(List sourcesNames) 30 | { 31 | _sourcesNames = sourcesNames; 32 | } 33 | 34 | public ConnectionState create(DbusEventBuffer eventBuffer) 35 | { 36 | ConnectionState connState = new ConnectionState(eventBuffer, _sourcesNames, null); 37 | connState.createBootstrapCheckpointHandler(); 38 | return connState; 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /databus-client/databus-client-http/src/main/java/com/linkedin/databus/client/DatabusBootstrapConnectionFactory.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import java.io.IOException; 23 | 24 | import com.linkedin.databus.client.netty.RemoteExceptionHandler; 25 | import com.linkedin.databus.client.pub.ServerInfo; 26 | import com.linkedin.databus.core.async.ActorMessageQueue; 27 | 28 | public interface DatabusBootstrapConnectionFactory 29 | { 30 | DatabusBootstrapConnection createConnection(ServerInfo relay, 31 | ActorMessageQueue callback, 32 | RemoteExceptionHandler remoteExceptionHandler) 33 | throws IOException; 34 | } 35 | -------------------------------------------------------------------------------- /databus-client/databus-client-http/src/main/java/com/linkedin/databus/client/DatabusRelayConnectionFactory.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import java.io.IOException; 23 | 24 | import com.linkedin.databus.client.netty.RemoteExceptionHandler; 25 | import com.linkedin.databus.client.pub.ServerInfo; 26 | import com.linkedin.databus.core.async.ActorMessageQueue; 27 | 28 | public interface DatabusRelayConnectionFactory 29 | { 30 | DatabusRelayConnection createRelayConnection(ServerInfo relay, 31 | ActorMessageQueue callback, 32 | RemoteExceptionHandler remoteExceptionHandler) 33 | throws IOException; 34 | } 35 | -------------------------------------------------------------------------------- /databus-client/databus-client-http/src/main/java/com/linkedin/databus/client/DatabusServerConnection.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public interface DatabusServerConnection 23 | { 24 | /* Close the Connection */ 25 | void close(); 26 | 27 | /** Client-relay protocol version */ 28 | int getProtocolVersion(); 29 | 30 | /** The host name or ip address of the remote server */ 31 | String getRemoteHost(); 32 | 33 | /** Get a service name identifying the remote server */ 34 | String getRemoteService(); 35 | 36 | /** max event version client understands */ 37 | int getMaxEventVersion(); 38 | } 39 | -------------------------------------------------------------------------------- /databus-client/databus-client-http/src/main/java/com/linkedin/databus/client/DatabusStreamConnectionStateMessage.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | 23 | public interface DatabusStreamConnectionStateMessage 24 | { 25 | void switchToStreamRequestError(); 26 | void switchToStreamResponseError(); 27 | void switchToStreamSuccess(ChunkedBodyReadableByteChannel result); 28 | } 29 | -------------------------------------------------------------------------------- /databus-client/databus-client-http/src/main/java/com/linkedin/databus/client/generic/DatabusConsumerPauseInterface.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.client.generic; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /** 23 | * @author dzhang 24 | * Create a pause/resume interface for consumer testing 25 | */ 26 | public interface DatabusConsumerPauseInterface 27 | { 28 | public void pause(); 29 | public void resume(); 30 | public void waitIfPaused(); 31 | } 32 | -------------------------------------------------------------------------------- /databus-client/databus-client-test-util/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-core:databus-core-impl') 5 | compile project(':databus-core:databus-core-container') 6 | compile project(':databus-core:databus-core-fwk-test') 7 | 8 | compile externalDependency.avro 9 | compile externalDependency.jacksonCoreAsl 10 | compile externalDependency.jacksonMapperAsl 11 | compile externalDependency.log4j 12 | compile externalDependency.netty 13 | testCompile externalDependency.testng 14 | } 15 | 16 | test.useTestNG() 17 | -------------------------------------------------------------------------------- /databus-client/databus2-client-util/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-client:databus-client-api') 5 | compile project(':databus-client:databus-client-common') 6 | compile project(':databus-client:databus-client-http') 7 | compile project(':databus-core:databus-core-impl') 8 | 9 | compile externalDependency.commonsCli 10 | compile externalDependency.log4j 11 | compile externalDependency.jacksonCoreAsl 12 | compile externalDependency.jacksonMapperAsl 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /databus-cluster/databus-cluster-manager-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-core:databus-core-impl') 5 | testCompile project(':databus-core:databus-core-fwk-test') 6 | compile externalDependency.log4j 7 | compile externalDependency.guava 8 | compile externalDependency.helixCore 9 | testCompile externalDependency.testng 10 | } 11 | 12 | test.useTestNG() 13 | -------------------------------------------------------------------------------- /databus-core/databus-core-container/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-core:databus-core-impl') 5 | 6 | compile externalDependency.avro 7 | compile externalDependency.log4j 8 | compile externalDependency.netty 9 | compile externalDependency.commonsCli 10 | compile externalDependency.jacksonMapperAsl 11 | compile externalDependency.jacksonCoreAsl 12 | 13 | testCompile externalDependency.testng 14 | testCompile externalDependency.easymock 15 | testCompile project(':databus-core:databus-core-fwk-test') 16 | } 17 | 18 | test.useTestNG() 19 | 20 | -------------------------------------------------------------------------------- /databus-core/databus-core-container/src/main/java/com/linkedin/databus2/core/container/request/BootstrapDBException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.container.request; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public class BootstrapDBException extends Exception 23 | { 24 | private static final long serialVersionUID = 1L; 25 | 26 | public BootstrapDBException() 27 | { 28 | super(); 29 | } 30 | 31 | public BootstrapDBException(String arg0, Throwable arg1) 32 | { 33 | super(arg0, arg1); 34 | } 35 | 36 | public BootstrapDBException(String arg0) 37 | { 38 | super(arg0); 39 | } 40 | 41 | public BootstrapDBException(Throwable arg0) 42 | { 43 | super(arg0); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /databus-core/databus-core-container/src/main/java/com/linkedin/databus2/core/container/request/BootstrapDatabaseTooYoungException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.container.request; 2 | 3 | /* 4 | * 5 | * Copyright 2013 LinkedIn Corp. All rights reserved 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | public class BootstrapDatabaseTooYoungException extends BootstrapDBException 23 | { 24 | private static final long serialVersionUID = 1L; 25 | 26 | public BootstrapDatabaseTooYoungException() 27 | { 28 | super(); 29 | } 30 | 31 | public BootstrapDatabaseTooYoungException(String arg0, Throwable arg1) 32 | { 33 | super(arg0, arg1); 34 | } 35 | 36 | public BootstrapDatabaseTooYoungException(String arg0) 37 | { 38 | super(arg0); 39 | } 40 | 41 | public BootstrapDatabaseTooYoungException(Throwable arg0) 42 | { 43 | super(arg0); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /databus-core/databus-core-container/src/main/java/com/linkedin/databus2/core/container/request/IDatabusRequest.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.container.request; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import org.jboss.netty.channel.Channel; 23 | import org.jboss.netty.channel.ChannelFuture; 24 | import org.jboss.netty.channel.ChannelHandlerContext; 25 | 26 | public interface IDatabusRequest 27 | { 28 | 29 | public byte getProtocolVersion(); 30 | public void sendDownstreamAsBinary(ChannelHandlerContext ctx, ChannelFuture future); 31 | public ChannelFuture writeToChannelAsBinary(Channel channel); 32 | } 33 | -------------------------------------------------------------------------------- /databus-core/databus-core-container/src/main/java/com/linkedin/databus2/core/container/request/IDatabusResponse.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.container.request; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import org.jboss.netty.channel.ChannelFuture; 23 | import org.jboss.netty.channel.ChannelHandlerContext; 24 | 25 | public interface IDatabusResponse 26 | { 27 | public void writeToChannelAsBinary(ChannelHandlerContext ctx, ChannelFuture future); 28 | public String toJsonString(boolean pretty); 29 | } 30 | -------------------------------------------------------------------------------- /databus-core/databus-core-container/src/main/java/com/linkedin/databus2/core/container/request/ProcessorRegistrationConflictException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.container.request; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import com.linkedin.databus2.core.DatabusException; 23 | 24 | public class ProcessorRegistrationConflictException extends DatabusException 25 | { 26 | private static final long serialVersionUID = 1L; 27 | 28 | private final String _commandName; 29 | 30 | public ProcessorRegistrationConflictException(String commandName) { 31 | super("Processor for the command has already been registered: " + commandName); 32 | _commandName = commandName; 33 | } 34 | 35 | public String getCommandName() { 36 | return _commandName; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /databus-core/databus-core-container/src/main/java/com/linkedin/databus2/core/container/request/RequestExecutionHandlerFactory.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.container.request; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import org.jboss.netty.channel.Channel; 23 | import org.jboss.netty.channel.SimpleChannelHandler; 24 | 25 | /** 26 | * The factory interface for execution handlers which listen on a Netty pipeline for a 27 | * particular type of command objects and execute the commands represented by the objects.*/ 28 | public interface RequestExecutionHandlerFactory 29 | { 30 | 31 | /** Creates a handler for the execution of a particular types of request */ 32 | SimpleChannelHandler createHandler(Channel channel); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /databus-core/databus-core-container/src/main/java/com/linkedin/databus2/core/container/request/RequestProcessingException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.container.request; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public class RequestProcessingException extends Exception { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | public RequestProcessingException(String arg0, Throwable arg1) { 27 | super(arg0, arg1); 28 | } 29 | 30 | public RequestProcessingException(String arg0) { 31 | super(arg0); 32 | } 33 | 34 | public RequestProcessingException(Throwable arg0) { 35 | super(arg0); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /databus-core/databus-core-container/src/main/java/com/linkedin/databus2/core/container/request/UnknownCommandException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.container.request; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public class UnknownCommandException extends Exception { 23 | 24 | private static final long serialVersionUID = 1L; 25 | 26 | private final String _commandName; 27 | 28 | public UnknownCommandException(String commandName) { 29 | super("Unknown databus command: " + commandName); 30 | _commandName = commandName; 31 | } 32 | 33 | public String getCommandName() { 34 | return _commandName; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /databus-core/databus-core-container/src/main/java/com/linkedin/databus2/core/container/request/UnsupportedProtocolVersionException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.container.request; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import com.linkedin.databus2.core.DatabusException; 23 | 24 | public class UnsupportedProtocolVersionException extends DatabusException 25 | { 26 | private static final long serialVersionUID = 1L; 27 | 28 | private final byte _protocolVerson; 29 | 30 | public UnsupportedProtocolVersionException(byte protocolVersion) 31 | { 32 | super("unsupported protocol version: " + Byte.toString(protocolVersion)); 33 | _protocolVerson = protocolVersion; 34 | } 35 | 36 | public byte getProtocolVerson() 37 | { 38 | return _protocolVerson; 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /databus-core/databus-core-container/src/main/java/com/linkedin/databus2/core/container/tool/TcpCommandMain.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.container.tool; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public class TcpCommandMain 23 | { 24 | 25 | /** 26 | * @param args 27 | */ 28 | public static void main(String[] args) 29 | { 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /databus-core/databus-core-fwk-test/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile externalDependency.log4j 5 | compile externalDependency.netty 6 | compile externalDependency.commonsIo 7 | compile externalDependency.zookeeper 8 | compile externalDependency.zkclientHelix 9 | compile externalDependency.testng 10 | } 11 | -------------------------------------------------------------------------------- /databus-core/databus-core-fwk-test/src/main/java/com/linkedin/databus2/test/ConditionCheck.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.test; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /** 23 | * A simple interface meant to be used with 24 | */ 25 | public interface ConditionCheck 26 | { 27 | /** Return true iff the condition check passes */ 28 | boolean check(); 29 | } 30 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | test.workingDir = "${project.rootDir}" 4 | 5 | dependencies { 6 | compile externalDependency.avro 7 | compile externalDependency.commonsBeanutils 8 | compile externalDependency.commonsCli 9 | compile externalDependency.commonsCodec 10 | compile externalDependency.commonsCollections 11 | compile externalDependency.commonsIo 12 | compile externalDependency.commonsLang 13 | compile externalDependency.commonsLogging 14 | compile externalDependency.jacksonCoreAsl 15 | compile externalDependency.jacksonMapperAsl 16 | compile externalDependency.json 17 | compile externalDependency.log4j 18 | compile externalDependency.netty 19 | compile externalDependency.c3p0 20 | compile externalDependency.guava 21 | 22 | testCompile externalDependency.testng 23 | testCompile externalDependency.easymock 24 | testCompile project(':databus-core:databus-core-fwk-test') 25 | } 26 | 27 | test { 28 | useTestNG() 29 | ext.testDataDirName = projectDir.absolutePath + "/test_data" 30 | systemProperties.put('test.datadir', "${ext.testDataDirName}") 31 | } 32 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/BootstrapPhase.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 3 | */ 4 | package com.linkedin.databus.core; 5 | /* 6 | * 7 | * Copyright 2013 LinkedIn Corp. All rights reserved 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, 16 | * software distributed under the License is distributed on an 17 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | * KIND, either express or implied. See the License for the 19 | * specific language governing permissions and limitations 20 | * under the License. 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * @author ksurlake 27 | * 28 | */ 29 | public enum BootstrapPhase { 30 | BOOTSTRAP_PHASE_SNAPSHOT, 31 | BOOTSTRAP_PHASE_CATCHUP, 32 | BOOTSTRAP_PHASE_COMPLETE 33 | } 34 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/DataChangeEvent.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /** 23 | * Read-only interface for Databus events. 24 | * TODO Remove this file. 25 | * @deprecated 26 | **/ 27 | public interface DataChangeEvent 28 | { 29 | } 30 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/DatabusRuntimeException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /** A base class for all Databus runtime exception */ 23 | public class DatabusRuntimeException extends RuntimeException 24 | { 25 | private static final long serialVersionUID = 1L; 26 | 27 | public DatabusRuntimeException(String message, Throwable cause) 28 | { 29 | super(message, cause); 30 | } 31 | 32 | public DatabusRuntimeException(String message) 33 | { 34 | super(message); 35 | } 36 | 37 | public DatabusRuntimeException(Throwable cause) 38 | { 39 | super(cause); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/DbusClientMode.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /** Describes the type of a {@link Checkpoint}. */ 23 | public enum DbusClientMode 24 | { 25 | /** An empty checkpoint */ 26 | INIT, 27 | /** A bootstrap checkpoint in the Snapshot phase */ 28 | BOOTSTRAP_SNAPSHOT, 29 | /** A bootstrap checkpoint in the Catchup phase */ 30 | BOOTSTRAP_CATCHUP, 31 | /** A checkpoint for consuming from a relay */ 32 | ONLINE_CONSUMPTION 33 | } 34 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/DbusConstantPartitionRouter.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | 23 | public class DbusConstantPartitionRouter implements DbusPartitionRouter 24 | { 25 | private final DbusPartitionId _partitionId; 26 | 27 | public DbusConstantPartitionRouter(int constant) 28 | { 29 | _partitionId = new DbusPartitionId(constant); 30 | } 31 | 32 | @Override 33 | public DbusPartitionId getPartitionId(DbusEvent event) 34 | { 35 | return _partitionId; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/DbusEventAccumulator.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public interface DbusEventAccumulator extends DbusEventBufferAppendable 23 | { 24 | // to be removed 25 | } 26 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/DbusEventBufferReadable.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /** 23 | * allows to read evetns from the buffer one by one 24 | */ 25 | public interface DbusEventBufferReadable 26 | { 27 | //not defined yet 28 | } 29 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/DbusOpcode.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public enum DbusOpcode 23 | { 24 | UPSERT, 25 | DELETE 26 | } 27 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/DbusPartitionRouter.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | 23 | public interface DbusPartitionRouter 24 | { 25 | public DbusPartitionId getPartitionId(DbusEvent event); 26 | } 27 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/Encoding.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public enum Encoding { 23 | JSON, 24 | BINARY, 25 | JSON_PLAIN_VALUE, 26 | } 27 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/EventScanningState.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public enum EventScanningState 23 | { 24 | LOOKING_FOR_FIRST_VALID_EVENT, 25 | IN_LESS_THAN_EQUALS_SCN_ZONE, 26 | FOUND_WINDOW_ZONE, 27 | VALID_ZONE, 28 | MISSED_WINDOW_ZONE 29 | 30 | } 31 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/InternalDatabusEventsListener.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | import java.io.IOException; 22 | 23 | 24 | 25 | /** 26 | * Internal Interface for listening for databus events as they enter the system. 27 | */ 28 | public interface InternalDatabusEventsListener 29 | { 30 | /** 31 | * 32 | * @param event An event was added to the Buffer 33 | * @param offset At this offset 34 | */ 35 | public void onEvent(DbusEvent event, long offset, int size); 36 | 37 | /** Finish processing */ 38 | public void close() throws IOException; 39 | } 40 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/InternalDatabusEventsListenerAbstract.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import java.io.IOException; 23 | 24 | public abstract class InternalDatabusEventsListenerAbstract implements 25 | InternalDatabusEventsListener 26 | { 27 | @Override 28 | public void onEvent(DbusEvent event, long offset, int size) 29 | { 30 | } 31 | 32 | @Override 33 | public void close() throws IOException 34 | { 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/InvalidCheckpointException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2013 LinkedIn Corp. All rights reserved 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | */ 19 | package com.linkedin.databus.core; 20 | 21 | /** 22 | * An exception class for invalid checkpoints 23 | */ 24 | public class InvalidCheckpointException extends DatabusRuntimeException 25 | { 26 | private static final long serialVersionUID = 1L; 27 | private final Checkpoint _checkpoint; 28 | 29 | public InvalidCheckpointException(String message, Checkpoint cp) 30 | { 31 | super(message + ": " + cp); 32 | _checkpoint = cp; 33 | } 34 | 35 | protected Checkpoint getCheckpoint() 36 | { 37 | return _checkpoint; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/InvalidEventException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public class InvalidEventException extends Exception 23 | { 24 | public InvalidEventException() 25 | { 26 | super(); 27 | } 28 | 29 | public InvalidEventException(String message, Throwable cause) 30 | { 31 | super(message, cause); 32 | } 33 | 34 | public InvalidEventException(String message) 35 | { 36 | super(message); 37 | } 38 | 39 | public InvalidEventException(Throwable cause) 40 | { 41 | super(cause); 42 | } 43 | 44 | /** 45 | * 46 | */ 47 | private static final long serialVersionUID = -2563643656130857310L; 48 | 49 | } 50 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/KeyTypeNotImplementedException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public class KeyTypeNotImplementedException extends Exception 23 | { 24 | 25 | public KeyTypeNotImplementedException() { 26 | super(); 27 | } 28 | public KeyTypeNotImplementedException(String msg) { 29 | super(msg); 30 | } 31 | /** 32 | * 33 | */ 34 | private static final long serialVersionUID = 7002776328296500896L; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/NamedObject.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public interface NamedObject 23 | { 24 | String getName(); 25 | } 26 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/PendingEventTooLargeException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | public class PendingEventTooLargeException extends Exception 22 | { 23 | public PendingEventTooLargeException(String err) 24 | { 25 | super(err); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/UnsupportedDbusEventVersionRuntimeException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | /** 22 | * @class A runtime exception to be raised when there is an event version 23 | * mismatch. 24 | */ 25 | public class UnsupportedDbusEventVersionRuntimeException extends DatabusRuntimeException 26 | { 27 | public UnsupportedDbusEventVersionRuntimeException(byte version) { 28 | super("Unsupported DbusEvent version " + version); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/async/ActorMessageQueue.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core.async; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /** 23 | * An interface for sending messages to an actor. 24 | * @author cbotev 25 | * 26 | */ 27 | public interface ActorMessageQueue 28 | { 29 | /** 30 | * Add the message to the actor's message queue. 31 | * @param message 32 | */ 33 | public void enqueueMessage(Object message); 34 | } 35 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/cmclient/NotAReplicatingResourceException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core.cmclient; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public class NotAReplicatingResourceException extends Exception 23 | { 24 | private static final long serialVersionUID = 1L; 25 | private String _resourceName; 26 | 27 | public NotAReplicatingResourceException(String resourceName) 28 | { 29 | super(); 30 | _resourceName = resourceName; 31 | } 32 | 33 | public String getResourceName() 34 | { 35 | return _resourceName; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/monitoring/StatsCollectorCallback.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core.monitoring; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | 23 | /** 24 | * Defines callbacks on addition/removal of stats collector objects 25 | * Used by sensor factories, that enable dynamic registration of stats objects associated with physical sources (databases) 26 | */ 27 | 28 | public interface StatsCollectorCallback { 29 | 30 | /** stats collector object added */ 31 | void addedStats(T stats); 32 | 33 | /** stats collector object removed */ 34 | void removedStats(T stats); 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/monitoring/mbean/DbusGenericSensor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2013 LinkedIn Corp. All rights reserved 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | */ 19 | 20 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/monitoring/mbean/MBeanSensorHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2013 LinkedIn Corp. All rights reserved 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | */ 19 | 20 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/util/ByteSizeConstants.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core.util; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public class ByteSizeConstants 23 | { 24 | public static final int ONE_KILOBYTE_IN_BYTES = 1024; 25 | public static final int ONE_MEGABYTE_IN_BYTES = 1000 * ONE_KILOBYTE_IN_BYTES; 26 | public static final long ONE_GIGABYTE_IN_BYTES = 1000 * ONE_MEGABYTE_IN_BYTES; 27 | } 28 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/util/CompressUtil.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core.util; 2 | 3 | import java.io.ByteArrayInputStream; 4 | import java.io.ByteArrayOutputStream; 5 | import java.io.IOException; 6 | import java.nio.charset.Charset; 7 | import java.util.zip.GZIPInputStream; 8 | import java.util.zip.GZIPOutputStream; 9 | 10 | import com.google.common.io.BaseEncoding; 11 | 12 | public class CompressUtil 13 | { 14 | public static String compress(String str) throws IOException 15 | { 16 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 17 | GZIPOutputStream gzip = new GZIPOutputStream(out); 18 | gzip.write(str.getBytes(Charset.defaultCharset())); 19 | gzip.close(); 20 | return BaseEncoding.base64().encode(out.toByteArray()); 21 | } 22 | 23 | public static String uncompress(String str) throws IOException 24 | { 25 | byte[] encodeByteArr = BaseEncoding.base64().decode(str); 26 | ByteArrayOutputStream out = new ByteArrayOutputStream(); 27 | ByteArrayInputStream in = new ByteArrayInputStream(encodeByteArr); 28 | GZIPInputStream gunzip = new GZIPInputStream(in); 29 | byte[] buffer = new byte[256]; 30 | int n; 31 | while ((n = gunzip.read(buffer)) >= 0) 32 | { 33 | out.write(buffer, 0, n); 34 | } 35 | return out.toString(Charset.defaultCharset().name()); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/util/ConfigApplier.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core.util; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | 23 | public interface ConfigApplier 24 | { 25 | 26 | /** 27 | * Applies a new config 28 | * @param oldConfig the old config being changed; 29 | */ 30 | void applyNewConfig(T oldConfig); 31 | 32 | /** Compares with another configuration for equality */ 33 | boolean equalsConfig(T otherConfig); 34 | } 35 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/util/ConfigBuilder.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core.util; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /** 23 | * Used for creation and verification of configs 24 | * @author cbotev 25 | * 26 | * @param the type of configs to be created 27 | */ 28 | public interface ConfigBuilder 29 | { 30 | 31 | C build() throws InvalidConfigException; 32 | } 33 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/util/EventBufferConsumer.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core.util; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public interface EventBufferConsumer 23 | { 24 | public void onInvalidEvent(long numEventsReadSoFar); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/util/InvalidConfigException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core.util; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import com.linkedin.databus2.core.DatabusException; 23 | 24 | public class InvalidConfigException extends DatabusException 25 | { 26 | private static final long serialVersionUID = 1L; 27 | 28 | public InvalidConfigException(String msg) 29 | { 30 | super(msg); 31 | } 32 | 33 | public InvalidConfigException(Throwable cause) 34 | { 35 | super(cause); 36 | } 37 | 38 | public InvalidConfigException(String msg, Throwable cause) 39 | { 40 | super(msg, cause); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus/core/util/TimeUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright 2013 LinkedIn Corp. All rights reserved 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * 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 | */ 19 | package com.linkedin.databus.core.util; 20 | 21 | public class TimeUtils 22 | { 23 | /** Base physical time to synchronize with the nano time */ 24 | private static final long BASE_REALTIME = System.currentTimeMillis() * 1000000; 25 | /** Base nano time */ 26 | private static final long BASE_NANOTIME = System.nanoTime(); 27 | 28 | /** Current time with nano-second granularity */ 29 | public static long currentNanoTime() 30 | { 31 | return (System.nanoTime() - BASE_NANOTIME) + BASE_REALTIME; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus2/core/BufferNotFoundException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * $Id: BufferNotFoundException.java 168967 2011-02-25 21:56:00Z cbotev $ 3 | */ 4 | package com.linkedin.databus2.core; 5 | /* 6 | * 7 | * Copyright 2013 LinkedIn Corp. All rights reserved 8 | * 9 | * Licensed under the Apache License, Version 2.0 (the "License"); 10 | * you may not use this file except in compliance with the License. 11 | * You may obtain a copy of the License at 12 | * 13 | * http://www.apache.org/licenses/LICENSE-2.0 14 | * 15 | * Unless required by applicable law or agreed to in writing, 16 | * software distributed under the License is distributed on an 17 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 18 | * KIND, either express or implied. See the License for the 19 | * specific language governing permissions and limitations 20 | * under the License. 21 | * 22 | */ 23 | 24 | 25 | /** 26 | * @author Phanindra Ganti 27 | */ 28 | public class BufferNotFoundException 29 | extends DatabusException 30 | { 31 | private static final long serialVersionUID = 1L; 32 | 33 | public BufferNotFoundException() 34 | { 35 | super(); 36 | } 37 | 38 | public BufferNotFoundException(String message) 39 | { 40 | super(message); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus2/core/filter/AllowAllDbusFilter.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.filter; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import com.linkedin.databus.core.DbusEvent; 23 | 24 | public class AllowAllDbusFilter implements DbusFilter 25 | { 26 | public static final AllowAllDbusFilter THE_INSTANCE = new AllowAllDbusFilter(); 27 | 28 | @Override 29 | public boolean allow(DbusEvent e) 30 | { 31 | return true; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus2/core/filter/DbusFilter.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.filter; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import com.linkedin.databus.core.DbusEvent; 23 | 24 | public interface DbusFilter 25 | { 26 | public boolean allow(DbusEvent e); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus2/core/filter/SourceDbusFilter.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.filter; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import java.util.Set; 23 | 24 | import com.linkedin.databus.core.DbusEvent; 25 | 26 | public class SourceDbusFilter implements DbusFilter 27 | { 28 | 29 | private final Set sources; 30 | 31 | public SourceDbusFilter(Set sources) 32 | { 33 | this.sources = sources; 34 | } 35 | 36 | @Override 37 | public boolean allow(DbusEvent e) 38 | { 39 | if (sources.contains((int)e.srcId())) { 40 | return true; 41 | } 42 | return false; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus2/core/seq/InMemorySequenceNumberHandlerFactory.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.seq; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import com.linkedin.databus2.core.DatabusException; 23 | 24 | /** Factory for in-memory sequence number handlers */ 25 | public class InMemorySequenceNumberHandlerFactory implements SequenceNumberHandlerFactory 26 | { 27 | private final long _initSeqNumber; 28 | 29 | public InMemorySequenceNumberHandlerFactory(long initSeqNumber) 30 | { 31 | _initSeqNumber = initSeqNumber; 32 | } 33 | 34 | @Override 35 | public MaxSCNReaderWriter createHandler(String id) throws DatabusException 36 | { 37 | return new InMemorySequenceNumberHandler(_initSeqNumber); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus2/core/seq/MaxSCNReader.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: MaxSCNReader.java 33147 2007-11-18 22:29:12Z dmccutch $ */ 3 | package com.linkedin.databus2.core.seq; 4 | /* 5 | * 6 | * Copyright 2013 LinkedIn Corp. All rights reserved 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | import com.linkedin.databus2.core.DatabusException; 25 | 26 | /** 27 | * Interface to read the maxSCN 28 | * 29 | * @author ypujante 30 | */ 31 | public interface MaxSCNReader 32 | { 33 | /** 34 | * @return the max scn 35 | * @throws DatabusException if an error occurs 36 | */ 37 | public long getMaxScn() throws DatabusException; 38 | } 39 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus2/core/seq/MaxSCNReaderWriter.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.seq; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | 23 | /** 24 | * Interface to read and write the maxSCN 25 | * 26 | * @author Mitch Stuart 27 | * @version $Revision: 33147 $ 28 | */ 29 | public interface MaxSCNReaderWriter extends MaxSCNReader, MaxSCNWriter 30 | { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus2/core/seq/MaxSCNWriter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: MaxSCNWriter.java 33147 2007-11-18 22:29:12Z dmccutch $ */ 3 | package com.linkedin.databus2.core.seq; 4 | /* 5 | * 6 | * Copyright 2013 LinkedIn Corp. All rights reserved 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | import com.linkedin.databus2.core.DatabusException; 25 | 26 | /** 27 | * Interface to write the maxSCN 28 | * 29 | * @author James Richards 30 | * @version $Revision: 33147 $ 31 | */ 32 | public interface MaxSCNWriter 33 | { 34 | /** 35 | * Saves max scn 36 | * 37 | * @param endOfPeriod the scn 38 | * @throws DatabusException if an error occurs 39 | */ 40 | void saveMaxScn(long endOfPeriod) throws DatabusException; 41 | } 42 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus2/core/seq/MysqlMaxSCNHandlerFactory.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.seq; 2 | 3 | import com.linkedin.databus2.core.DatabusException; 4 | 5 | /** 6 | * 7 | */ 8 | public class MysqlMaxSCNHandlerFactory implements SequenceNumberHandlerFactory { 9 | private final MysqlMaxSCNHandler.Config _configBuilder; 10 | 11 | public MysqlMaxSCNHandlerFactory(MysqlMaxSCNHandler.Config configBuilder) 12 | { 13 | _configBuilder = configBuilder; 14 | } 15 | 16 | @Override 17 | public MaxSCNReaderWriter createHandler(String id) throws DatabusException { 18 | MysqlMaxSCNHandler maxSCNHandler; 19 | MysqlMaxSCNHandler.StaticConfig config; 20 | synchronized (_configBuilder) { 21 | config = _configBuilder.build(); 22 | maxSCNHandler = MysqlMaxSCNHandler.create(config); 23 | } 24 | return maxSCNHandler; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus2/core/seq/SequenceNumberHandlerFactory.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.core.seq; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import com.linkedin.databus2.core.DatabusException; 23 | 24 | /** A factory for creating handlers for persisting sequence numbers */ 25 | public interface SequenceNumberHandlerFactory 26 | { 27 | /** Creates a new handler with the specified id */ 28 | MaxSCNReaderWriter createHandler(String id) throws DatabusException; 29 | } 30 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/main/java/com/linkedin/databus2/relay/AddRemovePartitionInterface.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.relay; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import com.linkedin.databus2.core.DatabusException; 23 | import com.linkedin.databus2.relay.config.PhysicalSourceStaticConfig; 24 | 25 | /** 26 | * supports adding/removing partitions dynamically. 27 | * One needs to provide configuration for these partitions. 28 | */ 29 | public interface AddRemovePartitionInterface 30 | { 31 | public void addPartition(PhysicalSourceStaticConfig pConfig) throws DatabusException; 32 | public void removePartition(PhysicalSourceStaticConfig pConfig) throws DatabusException; 33 | public void dropDatabase(String dbName) throws DatabusException; 34 | } 35 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/src/test/java/com/linkedin/databus/core/TestDbusConstants.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.core; 2 | 3 | /* 4 | * 5 | * Copyright 2013 LinkedIn Corp. All rights reserved 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | 23 | import org.testng.Assert; 24 | import org.testng.annotations.Test; 25 | 26 | public class TestDbusConstants 27 | { 28 | 29 | @Test 30 | public void testGetAppname() throws Exception 31 | { 32 | String appName = DbusConstants.getAppName(); 33 | Assert.assertEquals(appName,DbusConstants.DEFAULT_VAL); 34 | 35 | appName = "appNameToBeSetInIntegrationTest"; 36 | DbusConstants.setAppName(appName); 37 | String newAppName = DbusConstants.getAppName(); 38 | 39 | Assert.assertEquals(newAppName, appName); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /databus-core/databus-core-impl/test_data/DbusEventUpsertByOldJava.evt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/databus-core/databus-core-impl/test_data/DbusEventUpsertByOldJava.evt -------------------------------------------------------------------------------- /databus-core/databus-core-impl/test_data/README: -------------------------------------------------------------------------------- 1 | 2 | This directory is to hold data files for testing, if we need to. 3 | 4 | DbusEventUpsertByOldJava.evt: Has dbus event generated when we used to set 5 | the same bit multiple times in the attribute array. The event has a numeric 6 | key (12345L), timestamp(3456L), physPartition(0),logicalPartition(30),and 7 | srcId(15), schemaId of "abcdefghijklmnop".getBytes(). It is a non-replicated 8 | data event. 9 | -------------------------------------------------------------------------------- /databus-core/databus-core-schema-tools-pkg/bin/avro-converter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | script_dir=`dirname $0` 22 | source $script_dir/setup.inc 23 | 24 | java -cp ${cp} com.linkedin.databus2.core.schema.tools.AvroConvertMain $* 25 | -------------------------------------------------------------------------------- /databus-core/databus-core-schema-tools-pkg/bin/setup.inc: -------------------------------------------------------------------------------- 1 | lib_dir="$script_dir/../lib" 2 | 3 | cp="." 4 | for f in ${lib_dir}/*.jar ; do 5 | cp="${cp}:${f}" 6 | done 7 | -------------------------------------------------------------------------------- /databus-core/databus-core-schema-tools-pkg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-core:databus-core-schema-tools') 5 | } 6 | 7 | task myTar(type: Tar) { 8 | extension = 'tar.gz' 9 | baseName = project.name 10 | compression = Compression.GZIP 11 | 12 | into("conf") { from "config/" } 13 | 14 | from("bin") { 15 | into ("bin") 16 | fileMode = 0755 17 | } 18 | 19 | into("lib") { 20 | from configurations.runtime 21 | } 22 | } 23 | 24 | myTar.dependsOn ':databus-core:databus-core-schema-tools:assemble' 25 | assemble.dependsOn myTar 26 | -------------------------------------------------------------------------------- /databus-core/databus-core-schema-tools/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-core:databus-core-impl') 5 | 6 | compile externalDependency.avro 7 | compile externalDependency.commonsCli 8 | compile externalDependency.jacksonCoreAsl 9 | compile externalDependency.jacksonMapperAsl 10 | compile externalDependency.log4j 11 | } 12 | -------------------------------------------------------------------------------- /databus-core/databus-core-schemas-test/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | test.useTestNG() 4 | 5 | dependencies { 6 | compile project(':databus-core:databus-core-schemas') 7 | 8 | compile externalDependency.log4j 9 | 10 | testCompile externalDependency.testng 11 | } 12 | -------------------------------------------------------------------------------- /databus-core/databus-core-schemas/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | test.workingDir = "${project.rootDir}" 4 | 5 | dependencies { 6 | compile project(':databus-core:databus-core-impl') 7 | 8 | compile externalDependency.avro 9 | compile externalDependency.jacksonCoreAsl 10 | compile externalDependency.jacksonMapperAsl 11 | compile externalDependency.log4j 12 | compile externalDependency.commonsIo 13 | 14 | testCompile externalDependency.testng 15 | testCompile externalDependency.zkclientHelix 16 | } 17 | 18 | test { 19 | useTestNG() 20 | options.suites(file('testng.xml')) 21 | } 22 | -------------------------------------------------------------------------------- /databus-core/databus-core-schemas/src/main/java/com/linkedin/databus2/schemas/NoSuchSchemaException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.schemas; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import com.linkedin.databus2.core.DatabusException; 23 | 24 | public class NoSuchSchemaException extends DatabusException 25 | { 26 | private static final long serialVersionUID = 1L; 27 | 28 | public NoSuchSchemaException() 29 | { 30 | super(); 31 | } 32 | 33 | public NoSuchSchemaException(String message, Throwable cause) 34 | { 35 | super(message, cause); 36 | } 37 | 38 | public NoSuchSchemaException(String message) 39 | { 40 | super(message); 41 | } 42 | 43 | public NoSuchSchemaException(Throwable cause) 44 | { 45 | super(cause); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /databus-core/databus-core-schemas/src/main/java/com/linkedin/databus2/schemas/VersionedSchemaSetProvider.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.schemas; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /** 23 | * "Borrowed" largely from com.linkedin.avro.SchemaSetProvider 24 | */ 25 | public interface VersionedSchemaSetProvider 26 | { 27 | public VersionedSchemaSet loadSchemas(); 28 | } 29 | -------------------------------------------------------------------------------- /databus-core/databus-core-schemas/src/test/resources/com.linkedin.events.example.person.Person.1.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "Person_V1", 3 | "doc" : "Auto-generated Avro schema for sy$person. Generated at Dec 04, 2012 05:07:05 PM PST", 4 | "type" : "record", 5 | "meta" : "dbFieldName=sy$person;pk=key;", 6 | "namespace" : "com.linkedin.events.example.person", 7 | "fields" : [ { 8 | "name" : "txn", 9 | "type" : [ "long", "null" ], 10 | "meta" : "dbFieldName=TXN;dbFieldPosition=0;" 11 | }, { 12 | "name" : "key", 13 | "type" : [ "long", "null" ], 14 | "meta" : "dbFieldName=KEY;dbFieldPosition=1;" 15 | }, { 16 | "name" : "firstName", 17 | "type" : [ "string", "null" ], 18 | "meta" : "dbFieldName=FIRST_NAME;dbFieldPosition=2;" 19 | }, { 20 | "name" : "lastName", 21 | "type" : [ "string", "null" ], 22 | "meta" : "dbFieldName=LAST_NAME;dbFieldPosition=3;" 23 | }, { 24 | "name" : "birthDate", 25 | "type" : [ "long", "null" ], 26 | "meta" : "dbFieldName=BIRTH_DATE;dbFieldPosition=4;" 27 | }, { 28 | "name" : "deleted", 29 | "type" : [ "string", "null" ], 30 | "meta" : "dbFieldName=DELETED;dbFieldPosition=5;" 31 | } ] 32 | } 33 | -------------------------------------------------------------------------------- /databus-core/databus-core-schemas/src/test/resources/index.schemas_registry: -------------------------------------------------------------------------------- 1 | com.linkedin.events.example.fake.FakeSchema.1.avsc 2 | com.linkedin.events.example.fake.FakeSchema.2.avsc 3 | com.linkedin.events.example.person.Person.1.avsc 4 | -------------------------------------------------------------------------------- /databus-core/databus-core-schemas/testng.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /databus-group-leader/databus-group-leader-api/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | } 5 | -------------------------------------------------------------------------------- /databus-group-leader/databus-group-leader-api/src/main/java/com/linkedin/databus/groupleader/pub/AcceptLeadershipCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: AcceptLeadershipCallback.java 154385 2010-12-08 22:05:55Z mstuart $ */ 3 | package com.linkedin.databus.groupleader.pub; 4 | /* 5 | * 6 | * Copyright 2013 LinkedIn Corp. All rights reserved 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * This is the callback that will be called when a group member must accept leadership. 26 | * 27 | * @author Mitch Stuart 28 | * @version $Revision: 154385 $ 29 | */ 30 | public interface AcceptLeadershipCallback 31 | { 32 | void doAcceptLeadership(GroupLeadershipSession groupLeadershipSession); 33 | } 34 | -------------------------------------------------------------------------------- /databus-group-leader/databus-group-leader-api/src/main/java/com/linkedin/databus/groupleader/pub/GroupLeadershipConnectionFactory.java: -------------------------------------------------------------------------------- 1 | /** 2 | * $Id: GroupLeadershipConnectionFactory.java 154385 2010-12-08 22:05:55Z mstuart $ */ 3 | package com.linkedin.databus.groupleader.pub; 4 | /* 5 | * 6 | * Copyright 2013 LinkedIn Corp. All rights reserved 7 | * 8 | * Licensed under the Apache License, Version 2.0 (the "License"); 9 | * you may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | 25 | /** 26 | * 27 | * @author Mitch Stuart 28 | * @version $Revision: 154385 $ 29 | */ 30 | public interface GroupLeadershipConnectionFactory 31 | { 32 | GroupLeadershipConnection getConnection(); 33 | } 34 | -------------------------------------------------------------------------------- /databus-group-leader/databus-group-leader-example/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-group-leader:databus-group-leader-api') 5 | compile project(':databus-group-leader:databus-group-leader-impl') 6 | 7 | compile externalDependency.jacksonCoreAsl 8 | compile externalDependency.jacksonMapperAsl 9 | compile externalDependency.log4j 10 | compile externalDependency.zkclientHelix 11 | } 12 | -------------------------------------------------------------------------------- /databus-group-leader/databus-group-leader-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | test.workingDir = "${project.rootDir}" 4 | 5 | dependencies { 6 | compile project(':databus-group-leader:databus-group-leader-api') 7 | 8 | compile externalDependency.commonsIo 9 | compile externalDependency.log4j 10 | compile externalDependency.zkclientHelix 11 | compile externalDependency.zookeeper 12 | 13 | testCompile externalDependency.testng 14 | testCompile externalDependency.easymock 15 | testCompile project(':databus-core:databus-core-fwk-test') 16 | testCompile project(':databus-core:databus-core-impl') 17 | } 18 | 19 | test.useTestNG() 20 | -------------------------------------------------------------------------------- /databus-relay/databus-relay-run/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus2-relay:databus2-relay-impl') 5 | } 6 | -------------------------------------------------------------------------------- /databus-relay/databus-relay-run/run.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | import sys; 21 | import os; 22 | import os.path; 23 | sys.path.append('integration-test/script'); 24 | import run_base; 25 | script_dir = os.getcwd() 26 | module_name = "relay" 27 | 28 | if __name__=="__main__": 29 | print "\n--- Invoking run.py target with arguments ---\n" 30 | print sys.argv 31 | run_base.main_base(sys.argv[1:], script_dir, module_name) 32 | 33 | -------------------------------------------------------------------------------- /databus-tools/databus-dtail-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | test.workingDir = "${project.rootDir}" 4 | 5 | dependencies { 6 | compile project(':databus-client:databus-client-http') 7 | 8 | compile externalDependency.log4j 9 | compile externalDependency.jacksonCoreAsl 10 | compile externalDependency.jacksonMapperAsl 11 | 12 | testCompile externalDependency.testng 13 | } 14 | 15 | test.useTestNG() 16 | 17 | -------------------------------------------------------------------------------- /databus-tools/databus-tools-pkg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-tools:databus-dtail-impl') 5 | } 6 | 7 | task myTar(type: Tar) { 8 | extension = 'tar.gz' 9 | baseName = project.name 10 | compression = Compression.GZIP 11 | 12 | into("conf") { from "conf/" } 13 | 14 | from("script") { 15 | into ("bin") 16 | fileMode = 0755 17 | } 18 | 19 | into("bin") { 20 | from("${project.rootDir}/script") 21 | include('setup.inc') 22 | } 23 | 24 | into("lib") { 25 | from configurations.runtime 26 | } 27 | } 28 | 29 | myTar.dependsOn ':databus-tools:databus-dtail-impl:assemble' 30 | //assemble.dependsOn myTar 31 | artifacts { 32 | archives myTar 33 | } 34 | 35 | if (!isDefaultEnvironment) { 36 | generateModuleArtifactSpec { 37 | exclude {proj, conf, artifact -> artifact.file.name.endsWith('.jar') } 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /databus-tools/databus-tools-pkg/conf/dtail.properties: -------------------------------------------------------------------------------- 1 | dtail.container.jmx.rmiEnabled=false 2 | dtail.loggingListener.runtime.enabled=false 3 | dtail.connectionDefaults.checkpointThresholdPct=30 4 | dtail.connectionDefaults.eventBuffer.maxSize=65000000 5 | dtail.connectionDefaults.eventBuffer.readBufferSize=20000000 6 | dtail.connectionDefaults.eventBuffer.allocationPolicy=HEAP_MEMORY 7 | dtail.connectionDefaults.pullerRetries.maxRetryNum=-1 8 | -------------------------------------------------------------------------------- /databus-tools/databus-tools-pkg/script/dtail: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | script_dir=`dirname $0` 4 | source $script_dir/setup.inc 5 | 6 | main_class=com.linkedin.databus2.tools.dtail.Dtail 7 | 8 | java -cp ${cp} -XX:+UseCompressedOops -Xmx350m -Xms275m -XX:MaxDirectMemorySize=64m ${main_class} -p ${conf_dir}/dtail.properties --config_root ${conf_dir} $* 9 | -------------------------------------------------------------------------------- /databus-util-cmdline/databus-util-cmdline-impl/FindBugs-excludes.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /databus-util-cmdline/databus-util-cmdline-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile externalDependency.avro 5 | compile externalDependency.log4j 6 | compile externalDependency.commonsCli 7 | compile externalDependency.json 8 | compile externalDependency.log4j 9 | compile externalDependency.jacksonCoreAsl 10 | compile externalDependency.jacksonMapperAsl 11 | compile externalDependency.jline 12 | compile externalDependency.mysqlConnectorJava 13 | 14 | compile project(':databus-core:databus-core-impl') 15 | compile project(':databus-core:databus-core-schemas') 16 | testCompile project(':databus-core:databus-core-fwk-test') 17 | 18 | testCompile externalDependency.testng 19 | testCompile externalDependency.easymock 20 | 21 | runtime externalDependency.ojdbc6 22 | } 23 | 24 | test.useTestNG() 25 | test.workingDir = "${project.rootDir}" 26 | 27 | -------------------------------------------------------------------------------- /databus-util-cmdline/databus-util-cmdline-impl/src/main/java/com/linkedin/databus/eventgenerator/NullFieldGenerate.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.eventgenerator; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import org.apache.avro.Schema.Field; 23 | import org.apache.avro.generic.GenericRecord; 24 | 25 | public class NullFieldGenerate extends SchemaFiller { 26 | 27 | public NullFieldGenerate(Field field) { 28 | super(field); 29 | } 30 | 31 | @Override 32 | public void writeToRecord(GenericRecord record) 33 | { 34 | record.put(field.name(), null); 35 | } 36 | 37 | @Override 38 | public Object generateRandomObject() throws UnknownTypeException 39 | { 40 | return null; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /databus-util-cmdline/databus-util-cmdline-impl/src/main/java/com/linkedin/databus/eventgenerator/RandomDataGenerator.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.eventgenerator; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | /* 23 | * The interface to generate random values. 24 | */ 25 | public interface RandomDataGenerator { 26 | public int getNextInt(); 27 | public int getNextInt(int min, int max); 28 | public String getNextString(); 29 | public String getNextString(int min, int max); 30 | public double getNextDouble(); 31 | public float getNextFloat(); 32 | public long getNextLong(); 33 | public boolean getNextBoolean(); 34 | public byte[] getNextBytes(int maxBytesLength); 35 | } 36 | -------------------------------------------------------------------------------- /databus-util-cmdline/databus-util-cmdline-impl/src/main/java/com/linkedin/databus/eventgenerator/UnknownTypeException.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus.eventgenerator; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public class UnknownTypeException extends Exception { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /databus-util-cmdline/databus2-cmdline-tools-pkg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-util-cmdline:databus-util-cmdline-impl') 5 | } 6 | 7 | task myTar(type: Tar) { 8 | extension = 'tar.gz' 9 | baseName = project.name 10 | compression = Compression.GZIP 11 | 12 | into("conf") { from "conf/" } 13 | 14 | from("script") { 15 | into ("bin") 16 | fileMode = 0755 17 | } 18 | 19 | into("bin") { 20 | from("${project.rootDir}/script") 21 | include('setup.inc') 22 | fileMode = 0755 23 | } 24 | 25 | into("lib") { 26 | from configurations.runtime 27 | } 28 | 29 | } 30 | 31 | myTar.dependsOn ':databus-util-cmdline:databus-util-cmdline-impl:assemble' 32 | //assemble.dependsOn myTar 33 | artifacts { 34 | archives myTar 35 | } 36 | 37 | if (!isDefaultEnvironment) { 38 | generateModuleArtifactSpec { 39 | exclude {proj, conf, artifact -> artifact.file.name.endsWith('.jar') } 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /databus-util-cmdline/databus2-cmdline-tools-pkg/script/avro-data-gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | script_dir=`dirname $0` 22 | source $script_dir/setup.inc 23 | 24 | main_class=com.linkedin.databus.eventgenerator.DataGenerator 25 | 26 | java -cp ${cp} ${main_class} $* 27 | -------------------------------------------------------------------------------- /databus-util-cmdline/databus2-cmdline-tools-pkg/script/dbus2-avro-schema-gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | script_dir=`dirname $0` 22 | source $script_dir/setup.inc 23 | 24 | main_class=com.linkedin.databus.util.SchemaGeneratorMain 25 | 26 | java -cp ${cp} ${main_class} $* 27 | -------------------------------------------------------------------------------- /databus-util-cmdline/databus2-cmdline-tools-pkg/script/dbus2-interactive-avro-schema-gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | script_dir=`dirname $0` 22 | source $script_dir/setup.inc 23 | 24 | main_class=com.linkedin.databus.util.InteractiveSchemaGenerator 25 | 26 | java -cp ${cp} ${main_class} $* 27 | -------------------------------------------------------------------------------- /databus-util-cmdline/databus2-cmdline-tools-pkg/script/run-devrelay-src-config-gen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | script_dir=`dirname $0` 22 | source $script_dir/setup.inc 23 | 24 | main_class=com.linkedin.databus.util.DevRelayConfigGenerator 25 | 26 | java -cp ${cp} ${main_class} $* 27 | -------------------------------------------------------------------------------- /databus2-example/database/README_Person: -------------------------------------------------------------------------------- 1 | To setup Person Schema: 2 | run ./dbreinit_persons.sh 3 | This will setup databus tables with credentials (person/person) using SID "DB" 4 | 5 | To load rows, use the loadPersons script: 6 | Usage: ./loadPersons.sh [load|unload] 7 | This will insert some rows to Person table which can be used to test the propagation of change events in databus relay. 8 | -------------------------------------------------------------------------------- /databus2-example/database/dbreinit_persons.sh: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Copyright 2013 LinkedIn Corp. All rights reserved 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # 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 | # 19 | mkdir -p logs 20 | 21 | echo "cleanup old schema" 22 | (cd ../../database/oracle/bin && ./dropSchema.sh person/person@DB > ../../../databus2-example/database/logs/person_drop_user.log) 23 | 24 | echo "Setting up User and tablespace" 25 | (cd ../../database/oracle/bin && ./createUser.sh person person DB tbs_person /mnt/u001/oracle/data/DB > ../../../databus2-example/database/logs/person_cr_user.log) 26 | 27 | echo "Setting up tables" 28 | (cd ../../database/oracle/bin && ./createSchema.sh person/person@DB ../../../databus2-example/database/person/ > ../../../databus2-example/database/logs/person_cr_schema.log) 29 | 30 | -------------------------------------------------------------------------------- /databus2-example/database/person/person.tab: -------------------------------------------------------------------------------- 1 | -- You should expect the arguments in the following order 2 | def db=&1 3 | def user=&2 4 | def password=&3 5 | def tbs=&4 6 | 7 | -- Table name must be same as the one specified in this file name. 8 | -- The DB setup framework deduces the table name from the file name and hence should be same as the one given in the create table statement. 9 | prompt 'creating person table' 10 | create table person 11 | ( 12 | id number primary key, 13 | first_name varchar(120) not null, 14 | last_name varchar(120) not null, 15 | birth_date date, 16 | deleted varchar(5) default 'false' not null, 17 | txn number 18 | ) 19 | INITRANS 1 20 | MAXTRANS 255 21 | PCTUSED 40 22 | PCTFREE 10 tablespace &tbs 23 | NOCACHE 24 | / 25 | -- END PERSON 26 | -------------------------------------------------------------------------------- /databus2-example/database/person/person.view: -------------------------------------------------------------------------------- 1 | -- You should expect the arguments in the following order 2 | def db=&1 3 | def user=&2 4 | def password=&3 5 | def tbs=&4 6 | 7 | -- View Name MUST follow the convention 8 | -- (a) It must start with sy$ 9 | -- (b) The rest part of the name must be same as table name 10 | 11 | CREATE OR REPLACE FORCE VIEW sy$person 12 | AS 13 | SELECT 14 | txn, 15 | id key, 16 | first_name, 17 | last_name, 18 | birth_date, 19 | deleted 20 | FROM 21 | person; 22 | 23 | -------------------------------------------------------------------------------- /databus2-example/database/person/tablespace: -------------------------------------------------------------------------------- 1 | tbs_person 2 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-bst-producer-pkg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-bootstrap-producer:databus-bootstrap-producer-impl') 5 | } 6 | 7 | task myTar(type: Tar) { 8 | extension = 'tar.gz' 9 | baseName = project.name 10 | compression = Compression.GZIP 11 | 12 | into("conf") { from "conf/" } 13 | 14 | from("script") { 15 | into ("bin") 16 | fileMode = 0755 17 | } 18 | 19 | into("bin") { 20 | from("${project.rootDir}/script") 21 | include('setup.inc') 22 | } 23 | 24 | into("lib") { 25 | from configurations.runtime 26 | } 27 | } 28 | 29 | myTar.dependsOn ':databus-bootstrap-producer:databus-bootstrap-producer-impl:assemble' 30 | assemble.dependsOn myTar 31 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-bst-producer-pkg/script/setup-bst-producer.inc: -------------------------------------------------------------------------------- 1 | var_dir=${script_dir}/../var 2 | 3 | if [ ! -d ${var_dir} ] ; then 4 | mkdir -p ${var_dir} 5 | fi 6 | 7 | pid_file=${var_dir}/databus-bst-producer-example.pid 8 | out_file=${logs_dir}/databus-bst-producer-example.out 9 | jvm_gc_log=${logs_dir}/databus-bst-producer-example_gc.log 10 | 11 | 12 | # Custom memory configuration 13 | heap_size= 14 | max_heap_size=${heap_size:-} 15 | new_size= 16 | max_new_size=${new_size:-} 17 | direct_mem_size= 18 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-bst-producer-pkg/script/stop-bst-producer.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | script_dir=`dirname $0` 22 | source $script_dir/setup.inc 23 | source $script_dir/setup-bst-producer.inc 24 | 25 | if [ -f ${pid_file} ] ; then 26 | kill `cat ${pid_file}` 27 | else 28 | echo "$0: unable to find PID file ${pid_file}" 29 | fi 30 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-client-pkg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-client:databus-client-api') 5 | compile project(':databus-client:databus-client-common') 6 | compile project(':databus-client:databus-client-http') 7 | compile project(':databus2-example:databus2-example-client') 8 | } 9 | 10 | task myTar(type: Tar) { 11 | extension = 'tar.gz' 12 | baseName = project.name 13 | compression = Compression.GZIP 14 | 15 | into("conf") { from "conf/" } 16 | 17 | from("script") { 18 | into ("bin") 19 | fileMode = 0755 20 | } 21 | 22 | into("bin") { 23 | from("${project.rootDir}/script") 24 | include('setup.inc') 25 | } 26 | 27 | into("lib") { 28 | from configurations.runtime 29 | } 30 | } 31 | 32 | myTar.dependsOn ':databus2-relay:databus2-relay-impl:assemble' 33 | assemble.dependsOn myTar 34 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-client-pkg/conf/client_person.properties: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Copyright 2013 LinkedIn Corp. All rights reserved 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # 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 | # 19 | 20 | databus.relay.container.httpPort=11125 21 | databus.relay.container.jmx.rmiEnabled=false 22 | databus.relay.eventBuffer.allocationPolicy=DIRECT_MEMORY 23 | databus.relay.eventBuffer.queuePolicy=BLOCK_ON_WRITE 24 | databus.relay.schemaRegistry.type=FILE_SYSTEM 25 | databus.relay.eventBuffer.maxSize=10240000 26 | databus.relay.eventBuffer.readBufferSize=1024000 27 | databus.relay.eventBuffer.scnIndexSize=1024000 28 | databus.client.connectionDefaults.pullerRetries.initSleep=1 29 | databus.client.checkpointPersistence.fileSystem.rootDirectory=./personclient-checkpoints 30 | databus.client.checkpointPersistence.clearBeforeUse=false 31 | databus.client.connectionDefaults.enablePullerMessageQueueLogging=true 32 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-client-pkg/script/setup-client.inc: -------------------------------------------------------------------------------- 1 | var_dir=${script_dir}/../var 2 | 3 | if [ ! -d ${var_dir} ] ; then 4 | mkdir -p ${var_dir} 5 | fi 6 | 7 | client_pid_file=${var_dir}/databus2-client-${source_name}.pid 8 | client_out_file=${logs_dir}/databus2-client-${source_name}.out 9 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-client-pkg/script/stop-example-client.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | cd `dirname $0`/.. 22 | 23 | 24 | source_name=$1 25 | if [ -z "${source_name}" ] ; then 26 | echo "USAGE: $0 source_name [client_args]" 27 | exit 1 28 | fi 29 | shift 30 | 31 | script_dir=./bin 32 | source $script_dir/setup.inc 33 | source $script_dir/setup-client.inc 34 | 35 | 36 | if [ -f ${client_pid_file} ] ; then 37 | kill `cat ${client_pid_file}` 38 | else 39 | echo "$0: unable to find PID file ${client_pid_file}" 40 | fi 41 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-client/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-client:databus-client-api') 5 | compile project(':databus-client:databus-client-common') 6 | compile project(':databus-client:databus-client-http') 7 | 8 | compile externalDependency.commonsCli 9 | compile externalDependency.log4j 10 | } 11 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-person/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile externalDependency.avro 5 | compile externalDependency.jacksonCoreAsl 6 | compile externalDependency.jacksonMapperAsl 7 | compile externalDependency.log4j 8 | } 9 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus2-relay:databus2-relay-impl') 5 | compile project(':databus2-example:databus2-example-relay') 6 | 7 | //if ((System.getProperty('open_source') == null) || (System.getProperty('open_source').trim().equalsIgnoreCase("false"))) { 8 | // compile externalDependency.databusSchemas 9 | //} 10 | } 11 | 12 | task myTar(type: Tar) { 13 | extension = 'tar.gz' 14 | baseName = project.name 15 | compression = Compression.GZIP 16 | 17 | into("conf") { from "conf/" } 18 | 19 | from("script") { 20 | into ("bin") 21 | fileMode = 0755 22 | } 23 | 24 | into("bin") { 25 | from("${project.rootDir}/script") 26 | include('setup.inc') 27 | } 28 | 29 | into("schemas-registry") { 30 | from("schemas-registry") 31 | } 32 | 33 | into("lib") { 34 | from configurations.runtime 35 | } 36 | 37 | into("schemas_registry") { 38 | from "schemas_registry/" 39 | } 40 | 41 | into("sql") { 42 | from "sql/" 43 | } 44 | } 45 | 46 | myTar.dependsOn ':databus2-relay:databus2-relay-impl:assemble' 47 | myTar.dependsOn ':databus2-example:databus2-example-relay:assemble' 48 | //assemble.dependsOn myTar 49 | artifacts { 50 | archives myTar 51 | } 52 | 53 | if (!isDefaultEnvironment) { 54 | generateModuleArtifactSpec { 55 | exclude {proj, conf, artifact -> artifact.file.name.endsWith('.jar') } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/conf/relay_person.properties: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Copyright 2013 LinkedIn Corp. All rights reserved 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # 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 | # 19 | 20 | databus.relay.container.httpPort=11115 21 | databus.relay.container.jmx.rmiEnabled=false 22 | databus.relay.eventBuffer.allocationPolicy=DIRECT_MEMORY 23 | databus.relay.eventBuffer.queuePolicy=OVERWRITE_ON_WRITE 24 | databus.relay.eventLogReader.enabled=false 25 | databus.relay.eventLogWriter.enabled=false 26 | databus.relay.schemaRegistry.type=FILE_SYSTEM 27 | databus.relay.eventBuffer.maxSize=1024000000 28 | databus.relay.eventBuffer.readBufferSize=10240 29 | databus.relay.eventBuffer.scnIndexSize=10240000 30 | databus.relay.physicalSourcesConfigsPattern=conf/sources-person.json 31 | databus.relay.dataSources.sequenceNumbersHandler.file.scnDir=./maxScn 32 | databus.relay.startDbPuller=true 33 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/conf/sources-or-person.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "person", 3 | "id" : 1, 4 | "uri" : "mysql://or_test%2For_test@localhost:33066/33066/mysql-bin", 5 | "slowSourceQueryThreshold" : 2000, 6 | "sources" : 7 | [ 8 | { 9 | "id" : 40, 10 | "name" : "com.linkedin.events.example.or_test.Person", 11 | "uri": "or_test.person", 12 | "partitionFunction" : "constant:1" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/conf/sources-person.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "person", 3 | "id" : 1, 4 | "uri" : "jdbc:oracle:thin:person/person@devdb:1521:db", 5 | "slowSourceQueryThreshold" : 2000, 6 | "sources" : 7 | [ 8 | {"id" : 101, 9 | "name" : "com.linkedin.events.example.person.Person", 10 | "uri": "person.person", 11 | "partitionFunction" : "constant:1" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/schemas_registry/com.linkedin.events.example.or_test.Person.1.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "Person_V1", 3 | "doc" : "Auto-generated Avro schema for sy$person. Generated at Dec 04, 2012 05:07:05 PM PST", 4 | "type" : "record", 5 | "meta" : "dbFieldName=person;pk=id;", 6 | "namespace" : "com.linkedin.events.example.or_test", 7 | "fields" : [ { 8 | "name" : "id", 9 | "type" : [ "long", "null" ], 10 | "meta" : "dbFieldName=ID;dbFieldPosition=0;" 11 | }, { 12 | "name" : "firstName", 13 | "type" : [ "string", "null" ], 14 | "meta" : "dbFieldName=FIRST_NAME;dbFieldPosition=1;" 15 | }, { 16 | "name" : "lastName", 17 | "type" : [ "string", "null" ], 18 | "meta" : "dbFieldName=LAST_NAME;dbFieldPosition=2;" 19 | }, { 20 | "name" : "birthDate", 21 | "type" : [ "long", "null" ], 22 | "meta" : "dbFieldName=BIRTH_DATE;dbFieldPosition=3;" 23 | }, { 24 | "name" : "deleted", 25 | "type" : [ "string", "null" ], 26 | "meta" : "dbFieldName=DELETED;dbFieldPosition=4;" 27 | } ] 28 | } 29 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/schemas_registry/com.linkedin.events.example.person.Person.1.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "Person_V1", 3 | "doc" : "Auto-generated Avro schema for sy$person. Generated at Dec 04, 2012 05:07:05 PM PST", 4 | "type" : "record", 5 | "meta" : "dbFieldName=sy$person;pk=key;", 6 | "namespace" : "com.linkedin.events.example.person", 7 | "fields" : [ { 8 | "name" : "txn", 9 | "type" : [ "long", "null" ], 10 | "meta" : "dbFieldName=TXN;dbFieldPosition=0;" 11 | }, { 12 | "name" : "key", 13 | "type" : [ "long", "null" ], 14 | "meta" : "dbFieldName=KEY;dbFieldPosition=1;" 15 | }, { 16 | "name" : "firstName", 17 | "type" : [ "string", "null" ], 18 | "meta" : "dbFieldName=FIRST_NAME;dbFieldPosition=2;" 19 | }, { 20 | "name" : "lastName", 21 | "type" : [ "string", "null" ], 22 | "meta" : "dbFieldName=LAST_NAME;dbFieldPosition=3;" 23 | }, { 24 | "name" : "birthDate", 25 | "type" : [ "long", "null" ], 26 | "meta" : "dbFieldName=BIRTH_DATE;dbFieldPosition=4;" 27 | }, { 28 | "name" : "deleted", 29 | "type" : [ "string", "null" ], 30 | "meta" : "dbFieldName=DELETED;dbFieldPosition=5;" 31 | } ] 32 | } 33 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/schemas_registry/index.schemas_registry: -------------------------------------------------------------------------------- 1 | com.linkedin.events.example.person.Person.1.avsc 2 | com.linkedin.events.example.or_test.Person.1.avsc 3 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/script/create_person.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | script_dir=`dirname $0` 3 | #Setup this to point appropriately to MySQL instance 4 | MYSQL='/usr/bin/mysql --protocol=tcp --port=33066' 5 | SQL_DIR=../sql 6 | 7 | ${MYSQL} -uroot -e 'CREATE DATABASE IF NOT EXISTS or_test;'; 8 | ${MYSQL} -uroot -e "CREATE USER 'or_test'@'localhost' IDENTIFIED BY 'or_test';"; 9 | ${MYSQL} -uroot -e "GRANT ALL ON or_test.* TO 'or_test'@'localhost';" 10 | ${MYSQL} -uroot -e "GRANT ALL ON *.* TO 'or_test'@'localhost';" 11 | ${MYSQL} -uroot -e "GRANT ALL ON *.* TO 'or_test'@'127.0.0.1';" 12 | 13 | ${MYSQL} -uor_test -por_test -Dor_test < ${SQL_DIR}/create_person.sql 14 | ${MYSQL} -uor_test -por_test -Dor_test < ${SQL_DIR}/insert_person_test_data_1.sql 15 | ${MYSQL} -uroot -e 'RESET MASTER;' 16 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/script/setup-relay.inc: -------------------------------------------------------------------------------- 1 | var_dir=${script_dir}/../var 2 | 3 | if [ ! -d ${var_dir} ] ; then 4 | mkdir -p ${var_dir} 5 | fi 6 | 7 | relay_pid_file=${var_dir}/databus2-relay-${source_name}.pid 8 | relay_out_file=${logs_dir}/databus2-relay-${source_name}.out 9 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/script/stop-example-relay.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | cd `dirname $0`/.. 22 | 23 | 24 | source_name=$1 25 | if [ -z "${source_name}" ] ; then 26 | echo "USAGE: $0 source_name [relay_args]" 27 | exit 1 28 | fi 29 | shift 30 | 31 | script_dir=./bin 32 | source $script_dir/setup.inc 33 | source $script_dir/setup-relay.inc 34 | 35 | 36 | if [ -f ${relay_pid_file} ] ; then 37 | kill `cat ${relay_pid_file}` 38 | else 39 | echo "$0: unable to find PID file ${relay_pid_file}" 40 | fi 41 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/sql/create_person.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS person 2 | ( 3 | id bigint primary key PRIMARY KEY AUTO_INCREMENT, 4 | first_name varchar(120) not null, 5 | last_name varchar(120) not null, 6 | birth_date date, 7 | deleted varchar(5) default 'false' not null 8 | ) 9 | 10 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay-pkg/sql/insert_person_test_data_1.sql: -------------------------------------------------------------------------------- 1 | INSERT INTO person(first_name, last_name, birth_date) 2 | VALUES('balaji', 'varadaran', '1980-01-01'); 3 | INSERT INTO person(first_name, last_name, birth_date) 4 | VALUES('boris', 'shkolnik', '1981-02-02'), 5 | ('sunil', 'nagaraj', '1982-03-03'); 6 | INSERT INTO person(first_name, last_name, birth_date) 7 | VALUES('chavdar', 'botev', '1983-04-04'), 8 | ('phanindra', 'ganti', '1984-05-05'), 9 | ('sajid', 'topiwala', '1985-06-06'), 10 | ('naveen', 'somasundaram', '1984-05-05'); 11 | INSERT INTO person(first_name, last_name, birth_date) 12 | VALUES('greg', 'roelofs', '1985-06-06'), 13 | ('kapil', 'surlaker', '1986-07-07'); 14 | -------------------------------------------------------------------------------- /databus2-example/databus2-example-relay/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-core:databus-core-impl') 5 | compile project(':databus-core:databus-core-schemas') 6 | compile project(':databus-core:databus-core-container') 7 | compile project(':databus2-relay:databus2-relay-impl') 8 | compile project(':databus-util-cmdline:databus-util-cmdline-impl') 9 | 10 | compile externalDependency.commonsIo 11 | compile externalDependency.commonsLang 12 | compile externalDependency.commonsCli 13 | compile externalDependency.jacksonCoreAsl 14 | compile externalDependency.jacksonMapperAsl 15 | compile externalDependency.log4j 16 | compile externalDependency.netty 17 | compile externalDependency.avro 18 | 19 | } 20 | -------------------------------------------------------------------------------- /databus2-example/schemas_registry/com.linkedin.events.example.person.Person.1.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "Person_V1", 3 | "doc" : "Auto-generated Avro schema for sy$person. Generated at Dec 04, 2012 05:07:05 PM PST", 4 | "type" : "record", 5 | "meta" : "dbFieldName=sy$person;", 6 | "namespace" : "com.linkedin.events.example.person", 7 | "fields" : [ { 8 | "name" : "txn", 9 | "type" : [ "long", "null" ], 10 | "meta" : "dbFieldName=TXN;dbFieldPosition=0;" 11 | }, { 12 | "name" : "key", 13 | "type" : [ "long", "null" ], 14 | "meta" : "dbFieldName=KEY;dbFieldPosition=1;" 15 | }, { 16 | "name" : "firstName", 17 | "type" : [ "string", "null" ], 18 | "meta" : "dbFieldName=FIRST_NAME;dbFieldPosition=2;" 19 | }, { 20 | "name" : "lastName", 21 | "type" : [ "string", "null" ], 22 | "meta" : "dbFieldName=LAST_NAME;dbFieldPosition=3;" 23 | }, { 24 | "name" : "birthDate", 25 | "type" : [ "long", "null" ], 26 | "meta" : "dbFieldName=BIRTH_DATE;dbFieldPosition=4;" 27 | }, { 28 | "name" : "deleted", 29 | "type" : [ "string", "null" ], 30 | "meta" : "dbFieldName=DELETED;dbFieldPosition=5;" 31 | } ] 32 | } 33 | -------------------------------------------------------------------------------- /databus2-gg/databus2-ggparser-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | 5 | compile project(':databus-core:databus-core-schemas') 6 | compile project(':databus-core:databus-core-impl') 7 | 8 | compile externalDependency.avro 9 | compile externalDependency.commonsBeanutils 10 | compile externalDependency.commonsCli 11 | compile externalDependency.commonsIo 12 | compile externalDependency.commonsLogging 13 | compile externalDependency.jacksonCoreAsl 14 | compile externalDependency.jacksonMapperAsl 15 | compile externalDependency.log4j 16 | compile externalDependency.netty 17 | compile externalDependency.json 18 | runtime externalDependency.ojdbc6 19 | 20 | } 21 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-common/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus-core:databus-core-impl') 5 | compile project(':databus-core:databus-core-schemas') 6 | 7 | compile externalDependency.avro 8 | compile externalDependency.jacksonCoreAsl 9 | compile externalDependency.jacksonMapperAsl 10 | compile externalDependency.log4j 11 | compile externalDependency.json 12 | 13 | testCompile project(':databus-core:databus-core-fwk-test') 14 | testCompile externalDependency.testng 15 | } 16 | 17 | test.useTestNG() 18 | test.workingDir = "${project.rootDir}" 19 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-common/src/main/java/com/linkedin/databus2/producers/EventProducer.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.producers; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | public interface EventProducer 23 | { 24 | String getName(); 25 | 26 | long getSCN(); 27 | 28 | void start(long sinceSCN); 29 | 30 | boolean isRunning(); 31 | 32 | boolean isPaused(); 33 | 34 | void unpause(); 35 | 36 | void pause(); 37 | 38 | void shutdown(); 39 | 40 | void waitForShutdown() throws InterruptedException, IllegalStateException; 41 | 42 | void waitForShutdown(long timeout) throws InterruptedException, IllegalStateException; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-common/src/main/java/com/linkedin/databus2/producers/PartitionFunction.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.producers; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | import com.linkedin.databus.core.DbusEventKey; 22 | import com.linkedin.databus.core.UnsupportedKeyException; 23 | 24 | /** 25 | * Interface to return the partition for a given key. 26 | */ 27 | public interface PartitionFunction 28 | { 29 | /** 30 | * Return the partition for the given key. 31 | * @param key 32 | * @return the partition for the given key 33 | * @throws UnsupportedKeyException if key is an unsupported key type 34 | */ 35 | public short getPartition(DbusEventKey key) 36 | throws UnsupportedKeyException; 37 | } 38 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-common/src/main/java/com/linkedin/databus2/producers/db/EventSourceStatisticsIface.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.producers.db; 2 | 3 | import com.linkedin.databus.monitoring.mbean.EventSourceStatistics; 4 | 5 | public interface EventSourceStatisticsIface 6 | { 7 | public EventSourceStatistics getStatisticsBean(); 8 | public String getSourceName(); 9 | public short getSourceId(); 10 | } 11 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-common/src/main/java/com/linkedin/databus2/producers/db/GGMonitoredSourceInfo.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.producers.db; 2 | 3 | import com.linkedin.databus.monitoring.mbean.EventSourceStatistics; 4 | 5 | public class GGMonitoredSourceInfo implements EventSourceStatisticsIface 6 | { 7 | final private String _sourceName; 8 | final private short _sourceId; 9 | final private EventSourceStatistics _statisticsBean; 10 | 11 | public GGMonitoredSourceInfo(short sourceId, String sourceName, EventSourceStatistics statisticsBean) { 12 | _sourceName = sourceName; 13 | _sourceId = sourceId; 14 | _statisticsBean = statisticsBean; 15 | } 16 | 17 | @Override 18 | public EventSourceStatistics getStatisticsBean() 19 | { 20 | return _statisticsBean; 21 | } 22 | 23 | @Override 24 | public String getSourceName() { 25 | return _sourceName; 26 | } 27 | 28 | @Override 29 | public short getSourceId() { 30 | return _sourceId; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-mock/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus2-relay:databus2-event-producer-common') 5 | compile project(':databus-core:databus-core-impl') 6 | compile project(':databus-core:databus-core-schemas') 7 | compile project(':databus-util-cmdline:databus-util-cmdline-impl') 8 | 9 | compile externalDependency.avro 10 | compile externalDependency.jacksonCoreAsl 11 | compile externalDependency.jacksonMapperAsl 12 | compile externalDependency.log4j 13 | compile externalDependency.json 14 | 15 | testCompile project(':databus-core:databus-core-fwk-test') 16 | testCompile externalDependency.testng 17 | } 18 | 19 | test.useTestNG() 20 | test.workingDir = "${project.rootDir}" 21 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-mock/src/main/resources/META-INF/services/com.linkedin.databus2.producers.EventProducerServiceProvider: -------------------------------------------------------------------------------- 1 | com.linkedin.databus2.producers.MockEventProducerServiceProvider 2 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-mock/src/test/java/com/linkedin/databus2/producers/TestMockEventProducerServiceProvider.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.producers; 2 | 3 | import org.apache.log4j.Level; 4 | import org.testng.Assert; 5 | import org.testng.annotations.BeforeClass; 6 | import org.testng.annotations.Test; 7 | 8 | import com.linkedin.databus2.test.TestUtil; 9 | 10 | /** Tests {@link MockEventProducerServiceProvider} */ 11 | public class TestMockEventProducerServiceProvider 12 | { 13 | 14 | @BeforeClass 15 | public void setupClass() 16 | { 17 | TestUtil.setupLogging(true, null, Level.ERROR); 18 | } 19 | 20 | @Test 21 | /** Verifies that the provider is automatically loaded */ 22 | public void testAutoLoading() 23 | { 24 | EventProducerServiceProvider provider = 25 | RelayEventProducersRegistry.getInstance().getEventProducerServiceProvider(MockEventProducerServiceProvider.SCHEME); 26 | Assert.assertNotNull(provider); 27 | Assert.assertEquals(provider.getClass(), MockEventProducerServiceProvider.class); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-or/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile project(':databus2-relay:databus2-event-producer-common') 5 | compile project(':databus-core:databus-core-impl') 6 | compile project(':databus-core:databus-core-schemas') 7 | compile project(':databus-util-cmdline:databus-util-cmdline-impl') 8 | 9 | compile externalDependency.avro 10 | compile externalDependency.jacksonCoreAsl 11 | compile externalDependency.jacksonMapperAsl 12 | compile externalDependency.log4j 13 | compile externalDependency.json 14 | compile externalDependency.or 15 | 16 | testCompile project(':databus-core:databus-core-fwk-test') 17 | testCompile externalDependency.testng 18 | } 19 | 20 | test.useTestNG() 21 | test.workingDir = "${project.rootDir}" 22 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-or/src/main/java/com/linkedin/databus2/producers/ORMonitoredSourceInfo.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.producers; 2 | 3 | import com.linkedin.databus.monitoring.mbean.EventSourceStatistics; 4 | import com.linkedin.databus2.producers.db.EventSourceStatisticsIface; 5 | 6 | public class ORMonitoredSourceInfo implements EventSourceStatisticsIface 7 | { 8 | private final String _sourceName; 9 | private final short _sourceId; 10 | private final EventSourceStatistics _statisticsBean; 11 | 12 | public ORMonitoredSourceInfo(short sourceId, String sourceName, EventSourceStatistics statisticsBean) { 13 | _sourceName = sourceName; 14 | _sourceId = sourceId; 15 | _statisticsBean = statisticsBean; 16 | } 17 | 18 | @Override 19 | public EventSourceStatistics getStatisticsBean() 20 | { 21 | return _statisticsBean; 22 | } 23 | 24 | @Override 25 | public String getSourceName() { 26 | return _sourceName; 27 | } 28 | 29 | @Override 30 | public short getSourceId() { 31 | return _sourceId; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-or/src/main/resources/META-INF/services/com.linkedin.databus2.producers.EventProducerServiceProvider: -------------------------------------------------------------------------------- 1 | com.linkedin.databus2.producers.OpenReplicatorEventProducerServiceProvider 2 | -------------------------------------------------------------------------------- /databus2-relay/databus2-event-producer-or/src/test/java/com/linkedin/databus2/producers/TestOpenReplicatorEventProducer.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.producers; 2 | 3 | import java.net.URI; 4 | import java.net.URISyntaxException; 5 | 6 | import org.testng.annotations.Test; 7 | 8 | import static org.testng.Assert.*; 9 | 10 | import com.google.code.or.OpenReplicator; 11 | import com.linkedin.databus.core.util.InvalidConfigException; 12 | 13 | public class TestOpenReplicatorEventProducer { 14 | @Test 15 | public void testUriPaths() throws Exception { 16 | runUriTest("mysql://user%2Fpassword@localhost:3306/1/mysql-binlog", "user", "password", "localhost", 3306, 1, "mysql-binlog"); 17 | runUriTest("mysql://user%2Fpassword@localhost:3306/1/mysql5-binlog", "user", "password", "localhost", 3306, 1, "mysql5-binlog"); 18 | } 19 | 20 | private void runUriTest(String raw, String user, String password, String host, int port, int serverId, String filename) throws InvalidConfigException, URISyntaxException { 21 | OpenReplicator or = new OpenReplicator(); 22 | String prefix = OpenReplicatorEventProducer.processUri(new URI(raw), or); 23 | assertEquals(or.getUser(), user); 24 | assertEquals(or.getPassword(), password); 25 | assertEquals(or.getHost(), host); 26 | assertEquals(or.getPort(), port); 27 | assertEquals(or.getServerId(), serverId); 28 | assertEquals(prefix, filename); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /databus2-relay/databus2-relay-impl/src/main/java/com/linkedin/databus2/ggParser/XmlStateMachine/TransactionSuccessCallBack.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.ggParser.XmlStateMachine; 2 | 3 | /* 4 | * 5 | * Copyright 2013 LinkedIn Corp. All rights reserved 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | import java.util.List; 23 | 24 | import com.linkedin.databus.monitoring.mbean.GGParserStatistics.TransactionInfo; 25 | 26 | 27 | public interface TransactionSuccessCallBack 28 | { 29 | public void onTransactionEnd(List dbUpdates, 30 | TransactionInfo trInfo 31 | ) throws Exception; 32 | } 33 | -------------------------------------------------------------------------------- /databus2-relay/databus2-relay-impl/src/main/java/com/linkedin/databus2/ggParser/staxparser/AvroFiller.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.ggParser.staxparser; 2 | 3 | 4 | import org.apache.avro.Schema; 5 | import org.apache.avro.generic.GenericData; 6 | import org.apache.avro.generic.GenericRecord; 7 | 8 | 9 | public class AvroFiller 10 | { 11 | AvroSchemaHandler _avroHelper; 12 | GenericRecord _record; 13 | 14 | public AvroFiller(Schema schema) 15 | throws Exception 16 | { 17 | _record = new GenericData.Record(schema); 18 | _avroHelper = new AvroSchemaHandler(_record.getSchema()); 19 | } 20 | 21 | 22 | } -------------------------------------------------------------------------------- /databus2-relay/databus2-relay-impl/src/main/java/com/linkedin/databus2/producers/db/SourceDBEventReader.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.producers.db; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import java.util.List; 23 | 24 | import com.linkedin.databus.core.UnsupportedKeyException; 25 | import com.linkedin.databus2.core.DatabusException; 26 | import com.linkedin.databus2.producers.EventCreationException; 27 | 28 | public interface SourceDBEventReader { 29 | 30 | ReadEventCycleSummary readEventsFromAllSources( 31 | long sinceSCN) throws DatabusException, EventCreationException, 32 | UnsupportedKeyException; 33 | 34 | List getSources(); 35 | } 36 | -------------------------------------------------------------------------------- /databus2-relay/databus2-relay-impl/src/main/java/com/linkedin/databus2/relay/RelayFactory.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.relay; 2 | /* 3 | * 4 | * Copyright 2013 LinkedIn Corp. All rights reserved 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * 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 | 22 | import com.linkedin.databus.container.netty.HttpRelay; 23 | import com.linkedin.databus2.core.DatabusException; 24 | 25 | /** Factory for instantiating relays in standard setups like Oracle relay, Espresso relay, RandomGen 26 | * relay, etc. */ 27 | public interface RelayFactory 28 | { 29 | HttpRelay createRelay() throws DatabusException; 30 | } 31 | -------------------------------------------------------------------------------- /databus2-relay/databus2-relay-impl/src/main/java/com/linkedin/databus2/relay/config/DataSourcesStaticConfig.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.relay.config; 2 | 3 | import com.linkedin.databus2.core.seq.MaxSCNReaderWriterStaticConfig; 4 | 5 | /** Static configuration for a collection of data sources*/ 6 | public class DataSourcesStaticConfig 7 | { 8 | private final MaxSCNReaderWriterStaticConfig _sequenceNumbersHandler; 9 | 10 | public DataSourcesStaticConfig(MaxSCNReaderWriterStaticConfig sequenceNumbersHandler) 11 | { 12 | super(); 13 | _sequenceNumbersHandler = sequenceNumbersHandler; 14 | } 15 | 16 | /** 17 | * The static configuration for the handler responsible for persisting the sequence 18 | * numbers for different sources */ 19 | public MaxSCNReaderWriterStaticConfig getSequenceNumbersHandler() 20 | { 21 | return _sequenceNumbersHandler; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /databus2-relay/databus2-relay-impl/src/main/java/com/linkedin/databus2/relay/config/DataSourcesStaticConfigBuilder.java: -------------------------------------------------------------------------------- 1 | package com.linkedin.databus2.relay.config; 2 | 3 | import com.linkedin.databus.core.util.ConfigBuilder; 4 | import com.linkedin.databus.core.util.InvalidConfigException; 5 | import com.linkedin.databus2.core.seq.MaxSCNReaderWriterConfig; 6 | 7 | public class DataSourcesStaticConfigBuilder 8 | implements ConfigBuilder 9 | { 10 | private MaxSCNReaderWriterConfig _sequenceNumbersHandler = new MaxSCNReaderWriterConfig(); 11 | 12 | @Override 13 | public DataSourcesStaticConfig build() throws InvalidConfigException 14 | { 15 | return new DataSourcesStaticConfig(_sequenceNumbersHandler.build()); 16 | } 17 | 18 | public MaxSCNReaderWriterConfig getSequenceNumbersHandler() 19 | { 20 | return _sequenceNumbersHandler; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /databus2-relay/databus2-relay-impl/src/test/TestData/SchemaRegistry/com.linkedin.events.member2.test.test.1.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "test_V1", 3 | "doc" : "Auto-generated Avro schema for sy$Test. Generated at Nov 29, 2012 04:40:36 PM PST", 4 | "type" : "record", 5 | "meta" : "dbFieldName=sy$_Test;pk=id", 6 | "namespace" : "com.linkedin.events.member2.test", 7 | "fields" : [ { 8 | "name" : "id", 9 | "type" : [ "long", "null" ], 10 | "meta" : "dbFieldName=ID;dbFieldPosition=0;dbFieldType=LONG;" 11 | }, { 12 | "name" : "fname", 13 | "type" : [ "string", "null" ], 14 | "meta" : "dbFieldName=FNAME;dbFieldPosition=1;dbFieldType=VARCHAR2;" 15 | }, { 16 | "name" : "lname", 17 | "type" : [ "string", "null" ], 18 | "meta" : "dbFieldName=LNAME;dbFieldPosition=2;dbFieldType=VARCHAR2;" 19 | }, { 20 | "name" : "X1", 21 | "type" : [ "string", "null" ], 22 | "meta" : "dbFieldName=X1;dbFieldPosition=3;dbFieldType=XMLType;" 23 | }, { 24 | "name" : "ggModiTs", 25 | "type" : [ "long", "null" ], 26 | "meta" : "dbFieldName=GG_MODI_TS;dbFieldPosition=4;dbFieldType=TIMESTAMP;" 27 | }, { 28 | "name" : "ggStatus", 29 | "type" : [ "string", "null" ], 30 | "meta" : "dbFieldName=GG_STATUS;dbFieldPosition=5;dbFieldType=VARCHAR2;" 31 | } ] 32 | } 33 | -------------------------------------------------------------------------------- /databus2-relay/databus2-relay-impl/src/test/TestData/XmlData/nullfields.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 492441 5 | test492441 6 | test492441 7 | 8 | 2013-02-06:23:49:23.147940000 9 | O 10 | 11 | 12 | 1.9.1730 13 | 242679030635 14 | 15 | 16 | 17 | 18 | 19 | 20 | 2 21 | test2 22 | test492441 23 | <xml>test</xml> 24 | 2013-02-05:23:51:43.296396000 25 | O 26 | 27 | 28 | 10.17.16227 29 | 6201021 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /databus2-relay/databus2-relay-impl/src/test/resources/com.linkedin.events.example.person.Person.1.avsc: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "Person_V1", 3 | "doc" : "Auto-generated Avro schema for sy$person. Generated at Dec 04, 2012 05:07:05 PM PST", 4 | "type" : "record", 5 | "meta" : "dbFieldName=sy$person;pk=key", 6 | "namespace" : "com.linkedin.events.example.person", 7 | "fields" : [ { 8 | "name" : "txn", 9 | "type" : [ "long", "null" ], 10 | "meta" : "dbFieldName=TXN;dbFieldPosition=0;" 11 | }, { 12 | "name" : "key", 13 | "type" : [ "long", "null" ], 14 | "meta" : "dbFieldName=KEY;dbFieldPosition=1;" 15 | }, { 16 | "name" : "firstName", 17 | "type" : [ "string", "null" ], 18 | "meta" : "dbFieldName=FIRST_NAME;dbFieldPosition=2;" 19 | }, { 20 | "name" : "lastName", 21 | "type" : [ "string", "null" ], 22 | "meta" : "dbFieldName=LAST_NAME;dbFieldPosition=3;" 23 | }, { 24 | "name" : "birthDate", 25 | "type" : [ "long", "null" ], 26 | "meta" : "dbFieldName=BIRTH_DATE;dbFieldPosition=4;" 27 | }, { 28 | "name" : "deleted", 29 | "type" : [ "string", "null" ], 30 | "meta" : "dbFieldName=DELETED;dbFieldPosition=5;" 31 | } ] 32 | } 33 | -------------------------------------------------------------------------------- /databus2-relay/databus2-relay-impl/src/test/resources/index.schemas_registry: -------------------------------------------------------------------------------- 1 | com.linkedin.events.example.fake.FakeSchema.1.avsc 2 | com.linkedin.events.example.fake.FakeSchema.2.avsc 3 | com.linkedin.events.example.person.Person.1.avsc 4 | com.linkedin.events.example.Account.1.avsc 5 | com.linkedin.events.example.Settings.1.avsc 6 | -------------------------------------------------------------------------------- /db/databus2-bootstrap/.ant-targets-build.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | create-tablespace 22 | create-user 23 | db-targets.db.reinit 24 | db.apply.patches 25 | db.recreate.schema 26 | db.reinit 27 | db.schema.create 28 | db.schema.drop 29 | db.status 30 | db.testdata.core.install 31 | db.testdata.core.load 32 | db.testdata.core.unload 33 | db.testdata.install 34 | determine-environment 35 | fullclean 36 | generate-idea-module 37 | ivy-clean-locks 38 | ivy-fullclean 39 | ivy-system-init 40 | verify.db.reinit 41 | -------------------------------------------------------------------------------- /db/databus2-bootstrap/bootstrap_create_tables.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | script_dir=`dirname $0` 22 | 23 | mysql -ubootstrap -pbootstrap < $script_dir/createSchema/schema/cdsddl.tab 24 | 25 | -------------------------------------------------------------------------------- /db/databus2-bootstrap/bootstrap_db_reinit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | script_dir=`dirname $0` 22 | $script_dir/createUser/cr_databus2.sh 23 | $script_dir/bootstrap_drop_tables.sh 24 | $script_dir/bootstrap_create_tables.sh 25 | -------------------------------------------------------------------------------- /db/databus2-bootstrap/bootstrap_drop_tables.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | script_dir=`dirname $0` 22 | 23 | $script_dir/createSchema/dropSchema.sh bootstrap/bootstrap@localhost 24 | -------------------------------------------------------------------------------- /db/databus2-bootstrap/build.gradle: -------------------------------------------------------------------------------- 1 | task reinit { 2 | doFirst { 3 | exec { 4 | commandLine('./bootstrap_db_reinit.sh') 5 | } 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /db/databus2-bootstrap/createSchema/createSchema.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | # Usage: 21 | # 22 | # createSchema.sh [user [password | --nopass [logdir]]] 23 | 24 | if [ "$#" -lt 1 ] 25 | then 26 | echo "Usage: " 27 | echo " $0 username/password@hostname [logdir]" 28 | echo "" 29 | exit 1 30 | fi 31 | 32 | DB=$1 33 | 34 | LOG_DIR=${2:-logs} 35 | 36 | HOST=`echo $DB|awk -F'@' '{print $2}'` 37 | 38 | USER_PASS=`echo $DB|awk -F'@' '{print $1}'` 39 | 40 | USER=`echo $USER_PASS|awk -F'/' '{print $1}'` 41 | 42 | PASS=`echo $USER_PASS|awk -F'/' '{print $2}'` 43 | 44 | mkdir -p $LOG_DIR 45 | 46 | mysql -h$HOST -u$USER -p$PASS < schema/cdsddl.tab > $LOG_DIR/schema.log 47 | -------------------------------------------------------------------------------- /db/databus2-bootstrap/createSchema/dropSchema.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # 4 | # Copyright 2013 LinkedIn Corp. All rights reserved 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # 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 | # Usage: 22 | # 23 | # dropSchema.sh [user [password]] 24 | 25 | if [ "$#" -lt 1 ] 26 | then 27 | echo "Usage: " 28 | echo " $0 username/password@hostname" 29 | echo "" 30 | exit 1 31 | fi 32 | 33 | DB=$1 34 | 35 | LOG_DIR=${2:-logs} 36 | 37 | HOST=`echo $DB|awk -F'@' '{print $2}'` 38 | 39 | USER_PASS=`echo $DB|awk -F'@' '{print $1}'` 40 | 41 | USER=`echo $USER_PASS|awk -F'/' '{print $1}'` 42 | 43 | PASS=`echo $USER_PASS|awk -F'/' '{print $2}'` 44 | 45 | echo "Executing Command mysql -h$HOST -u$USER -p$PASS DROP DATABASE IF EXISTS bootstrap;" 46 | 47 | mysql -h$HOST -u$USER -p$PASS << __EOF__ 48 | DROP DATABASE IF EXISTS bootstrap; 49 | __EOF__ 50 | -------------------------------------------------------------------------------- /db/databus2-bootstrap/createUser/README: -------------------------------------------------------------------------------- 1 | To create databus2 bootstrap database and user in MySQL: 2 | 3 | sh cr_databus2.sh [username (default: bootstrap)] [password(default: bootstrap)] [database(default: bootstrap)] [hostname(default: localhost)] 4 | -------------------------------------------------------------------------------- /db/databus2-bootstrap/database.properties: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Copyright 2013 LinkedIn Corp. All rights reserved 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # 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 | # 19 | 20 | database.name=bootstrap 21 | database.type=mysql 22 | database.user=bootstrap 23 | database.pass=bootstrap 24 | database.host=localhost 25 | -------------------------------------------------------------------------------- /db/databus2-bootstrap/schema/ddl/cdsddl.ind: -------------------------------------------------------------------------------- 1 | -- Create indexes for @DBNAME@ schema here 2 | -- For more information, see: 3 | -- https://iwww.corp.linkedin.com/wiki/cf/display/ENGS/Database+Framework+2.0 4 | -------------------------------------------------------------------------------- /db/oracle/fwk/schema/ddl_con.sh: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Copyright 2013 LinkedIn Corp. All rights reserved 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # 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 | # 19 | if [ "$#" -lt 2 ] 20 | then 21 | echo "Usage: $0 " 22 | exit 1 23 | fi 24 | 25 | DB=$1 26 | tbs=$2 27 | 28 | TBS_UC=`echo $tbs | tr '[A-Z]' '[a-z]'` 29 | 30 | echo "INFO: creating Primary Key contstraints on sy\$txlog" 31 | sqlplus $DB << __EOF__ 32 | -- Adding primary key constraints 33 | ALTER TABLE SY\$TXLOG 34 | ADD (CONSTRAINT SY\$TXLOG_PK PRIMARY KEY 35 | (TXN) 36 | USING INDEX 37 | INITRANS 2 38 | MAXTRANS 255 39 | PCTFREE 5 TABLESPACE ${TBS_UC}_IDX) 40 | / 41 | __EOF__ 42 | 43 | -------------------------------------------------------------------------------- /db/oracle/fwk/schema/ddl_ind.sh: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Copyright 2013 LinkedIn Corp. All rights reserved 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # 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 | # 19 | if [ "$#" -lt 2 ] 20 | then 21 | echo "Usage: $0 " 22 | exit 1 23 | fi 24 | 25 | DB=$1 26 | tbs=$2 27 | 28 | TBS_UC=`echo $tbs | tr '[A-Z]' '[a-z]'` 29 | 30 | echo "INFO: creating index on SCN" 31 | sqlplus $DB << __EOF__ 32 | PROMPT creating index on scn 33 | create index sy\$txlog_I1 on sy\$txlog(scn) 34 | INITRANS 2 35 | MAXTRANS 255 36 | PCTFREE 10 TABLESPACE ${TBS_UC}_IDX 37 | / 38 | __EOF__ 39 | -------------------------------------------------------------------------------- /db/oracle/fwk/schema/ddl_sqs.sh: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Copyright 2013 LinkedIn Corp. All rights reserved 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # 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 | # 19 | 20 | if [ "$#" -lt 1 ] 21 | then 22 | echo "Usage: $0 " 23 | exit 1 24 | fi 25 | 26 | DB=$1 27 | 28 | sqlplus $DB << __EOF__ 29 | PROMPT Creating Sequence 'vercontrol_seq' 30 | CREATE SEQUENCE vercontrol_seq 31 | INCREMENT BY 1 32 | START WITH 101 33 | MAXVALUE 999999999999999999999999999 34 | MINVALUE 1 35 | NOCYCLE 36 | NOCACHE 37 | / 38 | 39 | create sequence SY\$SCN_SEQ 40 | increment by 1 41 | start with 1000 42 | maxvalue 999999999999999999999999999 43 | minvalue 1000 44 | nocycle 45 | cache 20 46 | / 47 | __EOF__ 48 | 49 | -------------------------------------------------------------------------------- /db/oracle/fwk/schema/ddl_vw.sh: -------------------------------------------------------------------------------- 1 | # 2 | # 3 | # Copyright 2013 LinkedIn Corp. All rights reserved 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # 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 | # 19 | if [ "$#" -lt 1 ] 20 | then 21 | echo "Usage: $0 " 22 | exit 1 23 | fi 24 | 25 | DB=$1 26 | 27 | 28 | sqlplus $DB << __EOF__ 29 | PROMPT Creating Databus view 30 | 31 | create or replace force view DB_MODE 32 | as 33 | select open_mode from sys.v_\$database 34 | / 35 | 36 | show errors; 37 | __EOF__ 38 | 39 | -------------------------------------------------------------------------------- /db/templates/cdsddl.sqs: -------------------------------------------------------------------------------- 1 | create sequence SY$SCN_SEQ 2 | increment by 1 3 | start with 1000 4 | maxvalue 999999999999999999999999999 5 | minvalue 1000 6 | nocycle 7 | cache 20 8 | / 9 | 10 | -------------------------------------------------------------------------------- /defaultEnvironment.gradle: -------------------------------------------------------------------------------- 1 | repositories { 2 | // for open source we cannot user internal repo 3 | // so we add few open source ones 4 | mavenCentral() 5 | maven { 6 | url "https://repo.fusesource.com/maven2" 7 | } 8 | maven { 9 | url "https://maven.restlet.org" 10 | } 11 | 12 | // local repo for libs we have to ship with 13 | def sandBoxRepo = "${project.rootDir}/sandbox-repo" 14 | def sandBoxExists = new File(sandBoxRepo).isDirectory() 15 | if (sandBoxExists) { 16 | logger.debug "Adding repository $sandBoxRepo" 17 | project.repositories.ivy { 18 | name "sanboxRepo" 19 | url sandBoxRepo 20 | layout "pattern", { 21 | artifact "[organisation]/[module]/[revision]/[artifact]-[revision](-[classifier]).[ext]" 22 | ivy "[organisation]/[module]/[revision]/[module]-[revision].ivy" 23 | m2compatible = true 24 | } 25 | } 26 | } else { 27 | logger.debug "Not adding repository $sandBoxRepo as the directory does not exist." 28 | } 29 | } 30 | 31 | project.buildDir = new File(project.rootProject.buildDir, project.name) 32 | -------------------------------------------------------------------------------- /doc/engineering_docs/DbusEvent.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/engineering_docs/DbusEvent.pdf -------------------------------------------------------------------------------- /doc/engineering_docs/client-library-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/engineering_docs/client-library-arch.png -------------------------------------------------------------------------------- /doc/engineering_docs/relay-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/engineering_docs/relay-architecture.png -------------------------------------------------------------------------------- /doc/user_docs/DatabusExecModel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/DatabusExecModel.png -------------------------------------------------------------------------------- /doc/user_docs/DatabusV2Events.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/DatabusV2Events.png -------------------------------------------------------------------------------- /doc/user_docs/dynamic-clb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/dynamic-clb.png -------------------------------------------------------------------------------- /doc/user_docs/sm-client-bootstrap-failmode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/sm-client-bootstrap-failmode.jpg -------------------------------------------------------------------------------- /doc/user_docs/sm-client-bootstrap-overview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/sm-client-bootstrap-overview.jpg -------------------------------------------------------------------------------- /doc/user_docs/sm-client-bootstrap-stream-requested.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/sm-client-bootstrap-stream-requested.jpg -------------------------------------------------------------------------------- /doc/user_docs/sm-client-dispatcher-dataevents.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/sm-client-dispatcher-dataevents.jpg -------------------------------------------------------------------------------- /doc/user_docs/sm-client-dispatcher-overview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/sm-client-dispatcher-overview.jpg -------------------------------------------------------------------------------- /doc/user_docs/sm-client-overview-failmode.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/sm-client-overview-failmode.jpg -------------------------------------------------------------------------------- /doc/user_docs/sm-client-overview.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/sm-client-overview.jpg -------------------------------------------------------------------------------- /doc/user_docs/sm-client-stream-requested.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/sm-client-stream-requested.jpg -------------------------------------------------------------------------------- /doc/user_docs/static-clb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/static-clb.png -------------------------------------------------------------------------------- /doc/user_docs/static_relay_chaining.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/doc/user_docs/static_relay_chaining.png -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | #------------------------------------------------------------- 2 | #For details on recommended settings, see go/gradle.properties 3 | #------------------------------------------------------------- 4 | 5 | #long-running Gradle process speeds up local builds 6 | #to stop the daemon run 'ligradle --stop' 7 | org.gradle.daemon=true 8 | 9 | #configures only relevant projects to speed up the configuration of large projects 10 | #useful when specific project/task is invoked e.g: ligradle :cloud:cloud-api:build 11 | org.gradle.configureondemand=true 12 | 13 | #Gradle will run tasks from subprojects in parallel 14 | #Higher CPU usage, faster builds 15 | org.gradle.parallel=false 16 | 17 | #Allows generation of idea/eclipse metadata for a specific subproject and its upstream project dependencies 18 | ide.recursive=true -------------------------------------------------------------------------------- /javadoc/index.html: -------------------------------------------------------------------------------- 1 | 2 | Database Javadoc Documentation 3 | 4 | 5 |

Databus Module

6 | 7 | 21 | 22 | -------------------------------------------------------------------------------- /metrics-histograms/metrics-core-impl/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | dependencies { 4 | compile externalDependency.metricsCore 5 | 6 | testCompile externalDependency.commonsStats 7 | testCompile externalDependency.testng 8 | } 9 | 10 | test { 11 | useTestNG() 12 | } 13 | -------------------------------------------------------------------------------- /sandbox-repo/com/google/open-replicator/1.0.5/open-replicator-1.0.5-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/sandbox-repo/com/google/open-replicator/1.0.5/open-replicator-1.0.5-sources.jar -------------------------------------------------------------------------------- /sandbox-repo/com/google/open-replicator/1.0.5/open-replicator-1.0.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/sandbox-repo/com/google/open-replicator/1.0.5/open-replicator-1.0.5.jar -------------------------------------------------------------------------------- /sandbox-repo/com/google/open-replicator/1.0.7/open-replicator-1.0.7-sources.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/sandbox-repo/com/google/open-replicator/1.0.7/open-replicator-1.0.7-sources.jar -------------------------------------------------------------------------------- /sandbox-repo/com/google/open-replicator/1.0.7/open-replicator-1.0.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/sandbox-repo/com/google/open-replicator/1.0.7/open-replicator-1.0.7.jar -------------------------------------------------------------------------------- /sandbox-repo/com/linkedin/helix/helix-core/0.5.31/helix-core-0.5.31.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/sandbox-repo/com/linkedin/helix/helix-core/0.5.31/helix-core-0.5.31.jar -------------------------------------------------------------------------------- /sandbox-repo/com/oracle/ojdbc6/11.2.0.2.0/README: -------------------------------------------------------------------------------- 1 | Please copy the Oracle OJDBC driver jar file in this directory after accepting OTN license. Make sure the name of the jar file is ojdbc6-11.2.0.2.0.jar . 2 | -------------------------------------------------------------------------------- /sandbox-repo/net/sf/josql/gentlyweb-utils/1.5/gentlyweb-utils-1.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/sandbox-repo/net/sf/josql/gentlyweb-utils/1.5/gentlyweb-utils-1.5.jar -------------------------------------------------------------------------------- /sandbox-repo/net/sf/josql/josql/1.5/josql-1.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/linkedin/databus/001ff16e9325694e8d833283f405058eff9cb7ef/sandbox-repo/net/sf/josql/josql/1.5/josql-1.5.jar -------------------------------------------------------------------------------- /script/setup.inc: -------------------------------------------------------------------------------- 1 | root_dir=${script_dir}/.. 2 | lib_dir="${root_dir}/lib" 3 | logs_dir="${root_dir}/logs" 4 | conf_dir="${root_dir}/conf" 5 | 6 | cp="." 7 | for f in ${lib_dir}/*.jar ; do 8 | cp="${cp}:${f}" 9 | done 10 | 11 | if [ ! -e $logs_dir ] ; then 12 | mkdir ${logs_dir} 13 | fi 14 | 15 | # guess JAVA_HOME 16 | if [ -z "$JAVA_HOME" ] ; then 17 | if [ -d /Library/Java/Home ] ; then 18 | export JAVA_HOME=/Library/Java/Home 19 | elif [ -d /export/apps/jdk/latest ] ; then 20 | export JAVA_HOME=/export/apps/jdk/latest 21 | elif [ -d /export/apps/java/latest ] ; then 22 | export JAVA_HOME=/export/apps/java/latest 23 | elif [ -d /export/apps/jdk ] ; then 24 | declare -a a=($(ls -rd /export/apps/jdk/JDK*)) 25 | JAVA_HOME_CANDIDATE=${a[0]} 26 | if [ -f $JAVA_HOME_CANDIDATE/bin/java ] ; then 27 | export JAVA_HOME=$JAVA_HOME_CANDIDATE 28 | elif [ -f $JAVA_HOME_CANDIDATE/usr/java/bin/java ] ; then 29 | export JAVA_HOME=$JAVA_HOME_CANDIDATE/usr/java 30 | fi 31 | elif which java >& /dev/null ; then 32 | export JAVA_HOME=$(dirname $(dirname $(which java))) 33 | fi 34 | #echo "Using JAVA_HOME=$JAVA_HOME" 35 | fi 36 | 37 | export PATH=$JAVA_HOME/bin:$PATH -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | // If a new directory is added, that contains a test inside, please add the directory here 2 | def base_modules = [ 3 | 'databus-bootstrap-client', 4 | 'databus-bootstrap-common', 5 | 'databus-bootstrap-producer', 6 | 'databus-bootstrap-server', 7 | 'databus-bootstrap-utils', 8 | 'databus-client', 9 | 'databus-core', 10 | 'databus-cluster', 11 | 'databus-group-leader', 12 | 'databus-relay', 13 | 'databus-tools', 14 | 'databus-util-cmdline', 15 | 'databus2-example', 16 | 'databus2-relay', 17 | 'db', 18 | 'script', 19 | 'metrics-histograms' 20 | ] 21 | 22 | // add above to get hadoop artifacts uploaded 'hadoop', 23 | 24 | //TODO modules removed due to problems with their build dependencies: 25 | // 26 | // these are being worked on 27 | 28 | def nonReleaseModules = [ 29 | ] 30 | 31 | //consuming of root.dir property allows us to 'wrap' the open source project with a master gradle project if necessary 32 | String rootDir = hasProperty("root.dir") ? getProperty("root.dir") : settingsDir 33 | 34 | base_modules.each { module -> 35 | file("$rootDir/$module").eachDir { submodule -> 36 | if (!submodule.name.startsWith('.') && !nonReleaseModules.contains(submodule.name)) { 37 | def path = ":${module}:${submodule.name}" 38 | include path 39 | project(path).projectDir = file("$rootDir/$module/$submodule.name") 40 | } 41 | } 42 | } 43 | --------------------------------------------------------------------------------