use of org.testng.annotations.BeforeClass in project pinot by linkedin.
the class ControllerTenantTest method setup.
@BeforeClass
public void setup() throws Exception {
startZk();
_zkClient = new ZkClient(ZkStarter.DEFAULT_ZK_STR);
startController();
ZKMetadataProvider.setClusterTenantIsolationEnabled(_propertyStore, false);
ControllerRequestBuilderUtil.addFakeBrokerInstancesToAutoJoinHelixCluster(HELIX_CLUSTER_NAME, ZkStarter.DEFAULT_ZK_STR, 20);
ControllerRequestBuilderUtil.addFakeDataInstancesToAutoJoinHelixCluster(HELIX_CLUSTER_NAME, ZkStarter.DEFAULT_ZK_STR, 20);
}
use of org.testng.annotations.BeforeClass in project pinot by linkedin.
the class PinotSegmentRecordReaderTest method setup.
@BeforeClass
public void setup() throws Exception {
segmentName = "pinotSegmentRecordReaderTest";
schema = createPinotSchema();
segmentOutputDir = Files.createTempDir().toString();
segmentIndexDir = new File(segmentOutputDir, segmentName);
rows = createTestData();
recordReader = new TestRecordReader(rows, schema);
createSegment();
}
use of org.testng.annotations.BeforeClass in project pinot by linkedin.
the class RealtimeSegmentTest method before.
@BeforeClass
public static void before() throws Exception {
filePath = RealtimeFileBasedReaderTest.class.getClassLoader().getResource(AVRO_DATA).getFile();
fieldTypeMap = new HashMap<String, FieldSpec.FieldType>();
fieldTypeMap.put("column1", FieldType.DIMENSION);
fieldTypeMap.put("column2", FieldType.DIMENSION);
fieldTypeMap.put("column3", FieldType.DIMENSION);
fieldTypeMap.put("column4", FieldType.DIMENSION);
fieldTypeMap.put("column5", FieldType.DIMENSION);
fieldTypeMap.put("column6", FieldType.DIMENSION);
fieldTypeMap.put("column7", FieldType.DIMENSION);
fieldTypeMap.put("column8", FieldType.DIMENSION);
fieldTypeMap.put("column9", FieldType.DIMENSION);
fieldTypeMap.put("column10", FieldType.DIMENSION);
fieldTypeMap.put("weeksSinceEpochSunday", FieldType.DIMENSION);
fieldTypeMap.put("daysSinceEpoch", FieldType.DIMENSION);
fieldTypeMap.put("column13", FieldType.TIME);
fieldTypeMap.put("count", FieldType.METRIC);
schema = SegmentTestUtils.extractSchemaFromAvro(new File(filePath), fieldTypeMap, TimeUnit.MINUTES);
StreamProviderConfig config = new FileBasedStreamProviderConfig(FileFormat.AVRO, filePath, schema);
// System.out.println(config);
StreamProvider provider = new FileBasedStreamProviderImpl();
final String tableName = RealtimeSegmentTest.class.getSimpleName() + ".noTable";
provider.init(config, tableName, new ServerMetrics(new MetricsRegistry()));
List<String> invertedIdxCols = new ArrayList<>();
invertedIdxCols.add("count");
segmentWithInvIdx = new RealtimeSegmentImpl(schema, 100000, tableName, "noSegment", AVRO_DATA, new ServerMetrics(new MetricsRegistry()), invertedIdxCols, 2);
segmentWithoutInvIdx = RealtimeSegmentImplTest.createRealtimeSegmentImpl(schema, 100000, tableName, "noSegment", AVRO_DATA, new ServerMetrics(new MetricsRegistry()));
GenericRow row = provider.next(new GenericRow());
while (row != null) {
segmentWithInvIdx.index(row);
segmentWithoutInvIdx.index(row);
row = GenericRow.createOrReuseRow(row);
row = provider.next(row);
}
provider.shutdown();
}
use of org.testng.annotations.BeforeClass in project pinot by linkedin.
the class SegmentPreProcessorTest method setUp.
@BeforeClass
public void setUp() throws Exception {
// For indexLoadingConfigMetadata, we specify two columns without inverted index ('column1', 'column13'), one
// non-existing column ('noSuchColumn') and one column with existed inverted index ('column7').
_indexLoadingConfigMetadata = new IndexLoadingConfigMetadata(new PropertiesConfiguration());
_indexLoadingConfigMetadata.initLoadingInvertedIndexColumnSet(new String[] { COLUMN1_NAME, COLUMN7_NAME, COLUMN13_NAME, NO_SUCH_COLUMN_NAME });
_indexLoadingConfigMetadata.setEnableDefaultColumns(true);
// For newColumnsSchema, we add 4 different data type metric columns with one user-defined default null value, and
// 3 different data type dimension columns with one user-defined default null value and one multi-value column.
ClassLoader classLoader = getClass().getClassLoader();
URL resourceUrl = classLoader.getResource(SCHEMA);
Preconditions.checkNotNull(resourceUrl);
_schema = Schema.fromFile(new File(resourceUrl.getFile()));
resourceUrl = classLoader.getResource(NEW_COLUMNS_SCHEMA1);
Preconditions.checkNotNull(resourceUrl);
_newColumnsSchema1 = Schema.fromFile(new File(resourceUrl.getFile()));
resourceUrl = classLoader.getResource(NEW_COLUMNS_SCHEMA2);
Preconditions.checkNotNull(resourceUrl);
_newColumnsSchema2 = Schema.fromFile(new File(resourceUrl.getFile()));
resourceUrl = classLoader.getResource(NEW_COLUMNS_SCHEMA3);
Preconditions.checkNotNull(resourceUrl);
_newColumnsSchema3 = Schema.fromFile(new File(resourceUrl.getFile()));
}
use of org.testng.annotations.BeforeClass in project pinot by linkedin.
the class RawIndexCreatorTest method setup.
/**
* Setup to build a segment with raw indexes (no-dictionary) of various data types.
*
* @throws Exception
*/
@BeforeClass
public void setup() throws Exception {
Schema schema = new Schema();
schema.addField(new DimensionFieldSpec(INT_COLUMN, FieldSpec.DataType.INT, true));
schema.addField(new DimensionFieldSpec(LONG_COLUMN, FieldSpec.DataType.LONG, true));
schema.addField(new DimensionFieldSpec(FLOAT_COLUMN, FieldSpec.DataType.FLOAT, true));
schema.addField(new DimensionFieldSpec(DOUBLE_COLUMN, FieldSpec.DataType.DOUBLE, true));
schema.addField(new DimensionFieldSpec(STRING_COLUMN, FieldSpec.DataType.STRING, true));
_random = new Random(System.nanoTime());
_recordReader = buildIndex(schema);
}
Aggregations