Search in sources :

Example 6 with SegmentMetadata

use of com.linkedin.pinot.common.segment.SegmentMetadata in project pinot by linkedin.

the class ValidationManager method computeRealtimeTotalDocumentInSegments.

public static long computeRealtimeTotalDocumentInSegments(List<SegmentMetadata> segmentMetadataList, boolean countHLCSegments) {
    long totalDocumentCount = 0;
    String groupId = "";
    for (SegmentMetadata segmentMetadata : segmentMetadataList) {
        String segmentName = segmentMetadata.getName();
        if (SegmentName.isHighLevelConsumerSegmentName(segmentName)) {
            if (countHLCSegments) {
                HLCSegmentName hlcSegmentName = new HLCSegmentName(segmentName);
                String segmentGroupIdName = hlcSegmentName.getGroupId();
                if (groupId.isEmpty()) {
                    groupId = segmentGroupIdName;
                }
                // Discard all segments with different groupids as they are replicas
                if (groupId.equals(segmentGroupIdName) && segmentMetadata.getTotalRawDocs() >= 0) {
                    totalDocumentCount += segmentMetadata.getTotalRawDocs();
                }
            }
        } else {
            // Low level segments
            if (!countHLCSegments) {
                totalDocumentCount += segmentMetadata.getTotalRawDocs();
            }
        }
    }
    return totalDocumentCount;
}
Also used : SegmentMetadata(com.linkedin.pinot.common.segment.SegmentMetadata) HLCSegmentName(com.linkedin.pinot.common.utils.HLCSegmentName)

Example 7 with SegmentMetadata

use of com.linkedin.pinot.common.segment.SegmentMetadata in project pinot by linkedin.

the class TableViewsTest method addOneSegment.

private void addOneSegment(String tableName) {
    SegmentMetadata metadata = new SimpleSegmentMetadata(tableName);
    pinotHelixResourceManager.addSegment(metadata, "someurl");
}
Also used : SimpleSegmentMetadata(com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata) SegmentMetadata(com.linkedin.pinot.common.segment.SegmentMetadata) SimpleSegmentMetadata(com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata)

Example 8 with SegmentMetadata

use of com.linkedin.pinot.common.segment.SegmentMetadata in project pinot by linkedin.

the class ControllerInstanceToggleTest method addOneOfflineSegment.

private void addOneOfflineSegment(String resourceName) {
    final SegmentMetadata segmentMetadata = new SimpleSegmentMetadata(resourceName);
    _pinotResourceManager.addSegment(segmentMetadata, "downloadUrl");
}
Also used : SegmentMetadata(com.linkedin.pinot.common.segment.SegmentMetadata) SimpleSegmentMetadata(com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata) SimpleSegmentMetadata(com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata)

Example 9 with SegmentMetadata

use of com.linkedin.pinot.common.segment.SegmentMetadata in project pinot by linkedin.

the class PinotResourceManagerTest method addOneSegment.

private void addOneSegment(String resourceName) {
    final SegmentMetadata segmentMetadata = new SimpleSegmentMetadata(resourceName);
    LOGGER.info("Trying to add IndexSegment : " + segmentMetadata.getName());
    _pinotHelixResourceManager.addSegment(segmentMetadata, "downloadUrl");
}
Also used : SimpleSegmentMetadata(com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata) SegmentMetadata(com.linkedin.pinot.common.segment.SegmentMetadata) SimpleSegmentMetadata(com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata)

Example 10 with SegmentMetadata

use of com.linkedin.pinot.common.segment.SegmentMetadata in project pinot by linkedin.

the class ControllerSentinelTestV2 method addOneOfflineSegment.

private void addOneOfflineSegment(String resourceName) {
    final SegmentMetadata segmentMetadata = new SimpleSegmentMetadata(resourceName);
    _pinotResourceManager.addSegment(segmentMetadata, "downloadUrl");
}
Also used : SegmentMetadata(com.linkedin.pinot.common.segment.SegmentMetadata) SimpleSegmentMetadata(com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata) SimpleSegmentMetadata(com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata)

Aggregations

SegmentMetadata (com.linkedin.pinot.common.segment.SegmentMetadata)33 Test (org.testng.annotations.Test)10 SegmentMetadataImpl (com.linkedin.pinot.core.segment.index.SegmentMetadataImpl)8 SimpleSegmentMetadata (com.linkedin.pinot.core.query.utils.SimpleSegmentMetadata)7 File (java.io.File)6 AfterTest (org.testng.annotations.AfterTest)6 BeforeTest (org.testng.annotations.BeforeTest)6 RetentionManager (com.linkedin.pinot.controller.helix.core.retention.RetentionManager)5 ArrayList (java.util.ArrayList)5 OfflineSegmentZKMetadata (com.linkedin.pinot.common.metadata.segment.OfflineSegmentZKMetadata)4 IndexSegment (com.linkedin.pinot.core.indexsegment.IndexSegment)4 BrokerRequest (com.linkedin.pinot.common.request.BrokerRequest)3 Pql2Compiler (com.linkedin.pinot.pql.parsers.Pql2Compiler)3 HashMap (java.util.HashMap)3 AbstractTableConfig (com.linkedin.pinot.common.config.AbstractTableConfig)2 HLCSegmentName (com.linkedin.pinot.common.utils.HLCSegmentName)2 FilterQueryTree (com.linkedin.pinot.common.utils.request.FilterQueryTree)2 TransformExpressionOperator (com.linkedin.pinot.core.operator.transform.TransformExpressionOperator)2 Interval (org.joda.time.Interval)2 Matchers.anyString (org.mockito.Matchers.anyString)2