use of org.apache.asterix.external.input.record.converter.DCPMessageToRecordConverter in project asterixdb by apache.
the class DCPGeneratorTest method runTest.
@Test
public void runTest() throws Exception {
try (KVTestReader cbreader = new KVTestReader(0, "TestBucket", new int[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, 150, 0, 0, 0)) {
final UTF8StringPointable pointable = new UTF8StringPointable();
final DCPMessageToRecordConverter converter = new DCPMessageToRecordConverter();
while (cbreader.hasNext()) {
final IRawRecord<DCPRequest> dcp = cbreader.next();
final RecordWithMetadataAndPK<char[]> record = converter.convert(dcp);
if (record.getRecord().size() == 0) {
pointable.set(record.getMetadata(0).getByteArray(), 1, record.getMetadata(0).getLength());
} else {
pointable.set(record.getMetadata(0).getByteArray(), 1, record.getMetadata(0).getLength());
}
}
} catch (final Throwable th) {
System.err.println("TEST FAILED");
th.printStackTrace();
throw th;
}
System.err.println("TEST PASSED.");
}
Aggregations