@Test public void testReuseOfBuiltSegment() throws Exception { FakeLLRealtimeSegmentDataManager segmentDataManager = createFakeSegmentManager(); SegmentCompletionProtocol.Response.Params params = new SegmentCompletionProtocol.Response.Params(); params.withStatus(SegmentCompletionProtocol.ControllerResponseStatus.COMMIT_SUCCESS); SegmentCompletionProtocol.Response commitSuccess = new SegmentCompletionProtocol.Response(params); params.withStatus(SegmentCompletionProtocol.ControllerResponseStatus.FAILED); SegmentCompletionProtocol.Response commitFailed = new SegmentCompletionProtocol.Response(params); segmentDataManager._responses.add(commitFailed); segmentDataManager._responses.add(commitSuccess); final long leaseTime = 50000L; File segmentTarFile = segmentDataManager.invokeBuildForCommit(leaseTime).getSegmentTarFile(); Assert.assertNotNull(segmentTarFile); Assert.assertTrue(segmentDataManager._buildSegmentCalled); Assert.assertFalse(segmentDataManager.invokeCommit()); Assert.assertTrue(segmentTarFile.exists()); segmentDataManager._buildSegmentCalled = false; File segmentTarFile1 = segmentDataManager.invokeBuildForCommit(leaseTime).getSegmentTarFile(); Assert.assertFalse(segmentDataManager._buildSegmentCalled); Assert.assertEquals(segmentTarFile1, segmentTarFile); Assert.assertTrue(segmentTarFile.exists()); Assert.assertTrue(segmentDataManager.invokeCommit()); Assert.assertFalse(segmentTarFile.exists()); segmentDataManager.destroy(); }
public void destroy() { try { stop(); } catch (InterruptedException e) { segmentLogger.error("Could not stop consumer thread"); } _realtimeSegment.destroy(); closeKafkaConsumers(); }
LLRealtimeSegmentDataManager extends RealtimeSegmentDataManager { public void destroy() { try { stop(); } catch (InterruptedException e) { segmentLogger.error("Could not stop consumer thread"); } _realtimeSegment.destroy(); closeKafkaConsumers(); } }
LLRealtimeSegmentDataManager extends RealtimeSegmentDataManager { public void destroy() { try { stop(); } catch (InterruptedException e) { segmentLogger.error("Could not stop consumer thread"); } _realtimeSegment.destroy(); closeKafkaConsumers(); } LLRealtimeSegmentDataManager(RealtimeSegmentZKMetadata segmentZKMetadata, TableConfig tableConfig,
      RealtimeTableDataManager realtimeTableDataManager, String resourceDataDir, IndexLoadingConfig indexLoadingConfig,
      Schema schema, LLCSegmentName llcSegmentName, Semaphore partitionConsumerSemaphore, ServerMetrics serverMetrics); }
LLRealtimeSegmentDataManager extends RealtimeSegmentDataManager { public void destroy() { try { stop(); } catch (InterruptedException e) { segmentLogger.error("Could not stop consumer thread"); } _realtimeSegment.destroy(); closeKafkaConsumers(); } LLRealtimeSegmentDataManager(RealtimeSegmentZKMetadata segmentZKMetadata, TableConfig tableConfig,
      RealtimeTableDataManager realtimeTableDataManager, String resourceDataDir, IndexLoadingConfig indexLoadingConfig,
      Schema schema, LLCSegmentName llcSegmentName, Semaphore partitionConsumerSemaphore, ServerMetrics serverMetrics); void goOnlineFromConsuming(RealtimeSegmentZKMetadata metadata); void destroy(); void stop(); @Override MutableSegment getSegment(); @Override String getSegmentName(); }
LLRealtimeSegmentDataManager extends RealtimeSegmentDataManager { public void destroy() { try { stop(); } catch (InterruptedException e) { segmentLogger.error("Could not stop consumer thread"); } _realtimeSegment.destroy(); closeKafkaConsumers(); } LLRealtimeSegmentDataManager(RealtimeSegmentZKMetadata segmentZKMetadata, TableConfig tableConfig,
      RealtimeTableDataManager realtimeTableDataManager, String resourceDataDir, IndexLoadingConfig indexLoadingConfig,
      Schema schema, LLCSegmentName llcSegmentName, Semaphore partitionConsumerSemaphore, ServerMetrics serverMetrics); void goOnlineFromConsuming(RealtimeSegmentZKMetadata metadata); void destroy(); void stop(); @Override MutableSegment getSegment(); @Override String getSegmentName();  }