use of net.ripe.hadoop.pcap.io.reader.PcapRecordReader in project hadoop-pcap by RIPE-NCC.
the class PcapInputFormat method initPcapRecordReader.
public static PcapRecordReader initPcapRecordReader(Path path, long start, long length, TaskAttemptContext context) throws IOException {
Configuration conf = context.getConfiguration();
FileSystem fs = path.getFileSystem(conf);
FSDataInputStream baseStream = fs.open(path);
DataInputStream stream = baseStream;
CompressionCodecFactory compressionCodecs = new CompressionCodecFactory(conf);
final CompressionCodec codec = compressionCodecs.getCodec(path);
if (codec != null)
stream = new DataInputStream(codec.createInputStream(stream));
PcapReader reader = initPcapReader(stream, conf);
return new PcapRecordReader(reader, start, length, baseStream, stream, context);
}
use of net.ripe.hadoop.pcap.io.reader.PcapRecordReader in project hadoop-pcap by RIPE-NCC.
the class PcapRecordReaderTest method startup.
@Before
public void startup() throws IOException {
JobConf config = new JobConf();
FileSystem fs = FileSystem.get(config);
FSDataInputStream is = fs.open(new Path(TEST_FILE.getParent(), TEST_FILE.getName()));
recordReader = new PcapRecordReader(new PcapReader(is), 0L, TEST_FILE.length(), is, is, new TestableTaskAttemptContext(config));
}
use of net.ripe.hadoop.pcap.io.reader.PcapRecordReader in project hadoop-pcap by RIPE-NCC.
the class PcapIPv6RecordReaderTest method startup.
@Before
public void startup() throws IOException {
JobConf config = new JobConf();
FileSystem fs = FileSystem.get(config);
FSDataInputStream is = fs.open(new Path(TEST_FILE.getParent(), TEST_FILE.getName()));
recordReader = new PcapRecordReader(new PcapReader(is), 0L, TEST_FILE.length(), is, is, new TestableTaskAttemptContext(config));
}
use of net.ripe.hadoop.pcap.io.reader.PcapRecordReader in project hadoop-pcap by RIPE-NCC.
the class PcapReversedHeaderRecordReaderTest method startup.
@Before
public void startup() throws IOException {
JobConf config = new JobConf();
FileSystem fs = FileSystem.get(config);
FSDataInputStream is = fs.open(new Path(TEST_FILE.getParent(), TEST_FILE.getName()));
recordReader = new PcapRecordReader(new PcapReader(is), 0L, TEST_FILE.length(), is, is, new TestableTaskAttemptContext(config));
}
Aggregations