use of org.apache.drill.exec.store.pcap.plugin.PcapFormatConfig in project drill by apache.
the class TestSessionizePCAP method setup.
@BeforeClass
public static void setup() throws Exception {
ClusterTest.startCluster(ClusterFixture.builder(dirTestWatcher));
PcapFormatConfig sampleConfig = new PcapFormatConfig(null, true, true);
cluster.defineFormat("cp", "pcap", sampleConfig);
dirTestWatcher.copyResourceToRoot(Paths.get("pcap/"));
}
use of org.apache.drill.exec.store.pcap.plugin.PcapFormatConfig in project drill by apache.
the class TestPcapWithPersistentStore method pcapPluginBackwardCompatabilityTest.
/**
* DRILL-7828
* Note: If this test breaks you are probably breaking backward and forward compatibility. Verify with the community
* that breaking compatibility is acceptable and planned for.
*/
@Test
public void pcapPluginBackwardCompatabilityTest() throws Exception {
final String oldPlugin = "oldFormatPlugin";
try (CuratorFramework curator = createCurator()) {
curator.start();
ObjectMapper objectMapper = new ObjectMapper();
objectMapper.registerSubtypes(PcapFormatConfig.class, PcapngFormatConfig.class);
PersistentStoreConfig<FileSystemConfig> storeConfig = PersistentStoreConfig.newJacksonBuilder(objectMapper, FileSystemConfig.class).name("type").build();
try (ZookeeperClient zkClient = new ZookeeperClient(curator, PathUtils.join("/", storeConfig.getName()), CreateMode.PERSISTENT)) {
zkClient.start();
String oldFormatPlugin = DrillFileUtils.getResourceAsString("/config/oldPcapPlugins.json");
zkClient.put(oldPlugin, oldFormatPlugin.getBytes(), null);
}
try (ZookeeperPersistentStoreProvider provider = new ZookeeperPersistentStoreProvider(zkHelper.getConfig(), curator)) {
PersistentStore<FileSystemConfig> store = provider.getOrCreateStore(storeConfig);
assertTrue(store instanceof ZookeeperPersistentStore);
FileSystemConfig oldPluginConfig = ((ZookeeperPersistentStore<FileSystemConfig>) store).get(oldPlugin, null);
Map<String, FormatPluginConfig> formats = oldPluginConfig.getFormats();
Assert.assertEquals(formats.keySet(), ImmutableSet.of("pcap", "pcapng"));
PcapFormatConfig pcap = (PcapFormatConfig) formats.get("pcap");
PcapngFormatConfig pcapng = (PcapngFormatConfig) formats.get("pcapng");
Assert.assertEquals(pcap.getExtensions(), ImmutableList.of("pcap"));
assertTrue(pcapng.getStat());
}
}
}
use of org.apache.drill.exec.store.pcap.plugin.PcapFormatConfig in project drill by apache.
the class TestPcapEVFReader method setup.
@BeforeClass
public static void setup() throws Exception {
ClusterTest.startCluster(ClusterFixture.builder(dirTestWatcher));
cluster.defineFormat("cp", "sample", new PcapFormatConfig(null, true, false));
}
use of org.apache.drill.exec.store.pcap.plugin.PcapFormatConfig in project drill by apache.
the class TestPcapngStatRecordReader method setup.
@BeforeClass
public static void setup() throws Exception {
ClusterTest.startCluster(ClusterFixture.builder(dirTestWatcher));
cluster.defineFormat("dfs", "pcapng", new PcapFormatConfig(ImmutableList.of("pcapng"), true, false));
dirTestWatcher.copyResourceToRoot(Paths.get("pcapng/"));
}
Aggregations