public StreamCutHelper(Controller controller, ConnectionFactory connectionFactory) { this.controller = controller; this.segmentMetadataClientFactory = new SegmentMetadataClientFactoryImpl(controller, connectionFactory); this.latestDelegationToken = new AtomicReference<>(); }
public ByteStreamClientImpl(String scope, Controller controller, ConnectionFactory connectionFactory) { this.scope = Preconditions.checkNotNull(scope); this.controller = Preconditions.checkNotNull(controller); this.connectionFactory = Preconditions.checkNotNull(connectionFactory); this.inputStreamFactory = new SegmentInputStreamFactoryImpl(controller, connectionFactory); this.outputStreamFactory = new SegmentOutputStreamFactoryImpl(controller, connectionFactory); this.metaStreamFactory = new SegmentMetadataClientFactoryImpl(controller, connectionFactory); }
public BatchClientFactoryImpl(Controller controller, ConnectionFactory connectionFactory) { this.controller = controller; this.connectionFactory = connectionFactory; this.inputStreamFactory = new SegmentInputStreamFactoryImpl(controller, connectionFactory); this.segmentMetadataClientFactory = new SegmentMetadataClientFactoryImpl(controller, connectionFactory); this.streamCutHelper = new StreamCutHelper(controller, connectionFactory); this.latestDelegationToken = new AtomicReference<>(); }
public ReaderGroupImpl(String scope, String groupName, SynchronizerConfig synchronizerConfig, Serializer<InitialUpdate<ReaderGroupState>> initSerializer, Serializer<Update<ReaderGroupState>> updateSerializer, SynchronizerClientFactory clientFactory, Controller controller, ConnectionFactory connectionFactory) { Preconditions.checkNotNull(synchronizerConfig); Preconditions.checkNotNull(initSerializer); Preconditions.checkNotNull(updateSerializer); Preconditions.checkNotNull(clientFactory); Preconditions.checkNotNull(connectionFactory); this.scope = Preconditions.checkNotNull(scope); this.groupName = Preconditions.checkNotNull(groupName); this.controller = Preconditions.checkNotNull(controller); this.metaFactory = new SegmentMetadataClientFactoryImpl(controller, connectionFactory); this.synchronizer = clientFactory.createStateSynchronizer(NameUtils.getStreamForReaderGroup(groupName), updateSerializer, initSerializer, synchronizerConfig); this.notifierFactory = new NotifierFactory(new NotificationSystem(), synchronizer); }
/** * Creates a new instance of the ClientFactory class. * Note: ConnectionFactory and Controller is closed when {@link ClientFactoryImpl#close()} is invoked. * * @param scope The scope string. * @param controller The reference to Controller. * @param connectionFactory The reference to Connection Factory impl. */ @VisibleForTesting public ClientFactoryImpl(String scope, Controller controller, ConnectionFactory connectionFactory) { this(scope, controller, connectionFactory, new SegmentInputStreamFactoryImpl(controller, connectionFactory), new SegmentOutputStreamFactoryImpl(controller, connectionFactory), new ConditionalOutputStreamFactoryImpl(controller, connectionFactory), new SegmentMetadataClientFactoryImpl(controller, connectionFactory)); }
/** * Creates a new instance of ClientFactory class. * Note: Controller is closed when {@link ClientFactoryImpl#close()} is invoked. * * @param scope The scope string. * @param controller The reference to Controller. */ public ClientFactoryImpl(String scope, Controller controller) { Preconditions.checkNotNull(scope); Preconditions.checkNotNull(controller); this.scope = scope; this.controller = controller; this.connectionFactory = new ConnectionFactoryImpl(ClientConfig.builder().build()); this.inFactory = new SegmentInputStreamFactoryImpl(controller, connectionFactory); this.outFactory = new SegmentOutputStreamFactoryImpl(controller, connectionFactory); this.condFactory = new ConditionalOutputStreamFactoryImpl(controller, connectionFactory); this.metaFactory = new SegmentMetadataClientFactoryImpl(controller, connectionFactory); }
ack.get(5, TimeUnit.SECONDS); ack2.get(5, TimeUnit.SECONDS); SegmentMetadataClient metadataClient = new SegmentMetadataClientFactoryImpl(controller, clientCF).createSegmentMetadataClient(segment, ""); assertEquals(payload.length * 2, metadataClient.fetchCurrentSegmentLength());
SegmentMetadataClient metadataClient = new SegmentMetadataClientFactoryImpl(controller, clientCF).createSegmentMetadataClient(segment, ""); assertEquals((payload.length + WireCommands.TYPE_PLUS_LENGTH_SIZE) * 2, metadataClient.fetchCurrentSegmentLength());
SegmentMetadataClientFactory metadataClientFactory = new SegmentMetadataClientFactoryImpl(controller, streamManager.getConnectionFactory()); Segment segment = new Segment(scope, streamName, 0);