use of com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata in project pinot by linkedin.
the class PinotResourceManagerTest method testDeletingTheSameSegmentInSegmentDeletionManager.
@Test
public void testDeletingTheSameSegmentInSegmentDeletionManager() throws Exception {
final SegmentMetadata segmentMetadata = new SimpleSegmentMetadata(TABLE_NAME);
final String segmentName = segmentMetadata.getName();
File segmentFile = new File(LOCAL_DISK_DIR + "/" + TABLE_NAME + "/" + segmentName);
for (int i = 0; i < 2; i++) {
addOneSegment(TABLE_NAME);
// Waiting for the external view to update
Thread.sleep(2000);
final ExternalView externalView = _helixAdmin.getResourceExternalView(HELIX_CLUSTER_NAME, TableNameBuilder.OFFLINE_TABLE_NAME_BUILDER.forTable(TABLE_NAME));
List<String> segmentsList = new ArrayList<>(externalView.getPartitionSet().size());
segmentsList.addAll(externalView.getPartitionSet());
_pinotHelixResourceManager.deleteSegments(TableNameBuilder.OFFLINE_TABLE_NAME_BUILDER.forTable(TABLE_NAME), segmentsList);
}
assert (!segmentFile.exists());
}
use of com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata in project pinot by linkedin.
the class HelixBrokerStarterTest method addOneSegment.
private void addOneSegment(String tableName) {
final SegmentMetadata segmentMetadata = new SimpleSegmentMetadata(tableName);
LOGGER.info("Trying to add IndexSegment : " + segmentMetadata.getName());
_pinotResourceManager.addSegment(segmentMetadata, "http://localhost:something");
}
Aggregations