Search in sources :

Example 11 with SegmentDataManager

use of com.linkedin.pinot.core.data.manager.offline.SegmentDataManager in project pinot by linkedin.

the class HelixInstanceDataManager method getSegmentMetadata.

@Override
public SegmentMetadata getSegmentMetadata(String table, String segmentName) {
    SegmentDataManager segmentDataManager = null;
    TableDataManager tableDataManager = _tableDataManagerMap.get(table);
    try {
        if (tableDataManager != null) {
            segmentDataManager = tableDataManager.acquireSegment(segmentName);
            if (segmentDataManager != null) {
                return segmentDataManager.getSegment().getSegmentMetadata();
            }
        }
        return null;
    } finally {
        if (segmentDataManager != null) {
            tableDataManager.releaseSegment(segmentDataManager);
        }
    }
}
Also used : SegmentDataManager(com.linkedin.pinot.core.data.manager.offline.SegmentDataManager) TableDataManager(com.linkedin.pinot.core.data.manager.offline.TableDataManager)

Aggregations

SegmentDataManager (com.linkedin.pinot.core.data.manager.offline.SegmentDataManager)11 TableDataManager (com.linkedin.pinot.core.data.manager.offline.TableDataManager)5 IndexSegment (com.linkedin.pinot.core.indexsegment.IndexSegment)5 ApiOperation (io.swagger.annotations.ApiOperation)3 ApiResponses (io.swagger.annotations.ApiResponses)3 ArrayList (java.util.ArrayList)3 GET (javax.ws.rs.GET)3 Path (javax.ws.rs.Path)3 Produces (javax.ws.rs.Produces)3 OfflineSegmentDataManager (com.linkedin.pinot.core.data.manager.offline.OfflineSegmentDataManager)2 WebApplicationException (javax.ws.rs.WebApplicationException)2 Schema (com.linkedin.pinot.common.data.Schema)1 QueryException (com.linkedin.pinot.common.exception.QueryException)1 LLCRealtimeSegmentZKMetadata (com.linkedin.pinot.common.metadata.segment.LLCRealtimeSegmentZKMetadata)1 RealtimeSegmentZKMetadata (com.linkedin.pinot.common.metadata.segment.RealtimeSegmentZKMetadata)1 TimerContext (com.linkedin.pinot.common.query.context.TimerContext)1 BrokerRequest (com.linkedin.pinot.common.request.BrokerRequest)1 InstanceRequest (com.linkedin.pinot.common.request.InstanceRequest)1 SegmentSizeInfo (com.linkedin.pinot.common.restlet.resources.SegmentSizeInfo)1 TableSegments (com.linkedin.pinot.common.restlet.resources.TableSegments)1