Search in sources :

Example 1 with DatePartitionedLogger

use of org.apache.tez.dag.history.logging.proto.DatePartitionedLogger in project hive by apache.

the class TestHiveProtoLoggingHook method getTestReader.

public static ProtoMessageReader<HiveHookEventProto> getTestReader(HiveConf conf, String tmpFolder) throws IOException {
    Path path = new Path(tmpFolder);
    FileSystem fs = path.getFileSystem(conf);
    FileStatus[] status = fs.listStatus(path);
    Assert.assertEquals(1, status.length);
    status = fs.listStatus(status[0].getPath());
    Assert.assertEquals(1, status.length);
    DatePartitionedLogger<HiveHookEventProto> logger = new DatePartitionedLogger<>(HiveHookEventProto.PARSER, path, conf, SystemClock.getInstance());
    return logger.getReader(status[0].getPath());
}
Also used : Path(org.apache.hadoop.fs.Path) FileStatus(org.apache.hadoop.fs.FileStatus) FileSystem(org.apache.hadoop.fs.FileSystem) HiveHookEventProto(org.apache.hadoop.hive.ql.hooks.proto.HiveHookEvents.HiveHookEventProto) DatePartitionedLogger(org.apache.tez.dag.history.logging.proto.DatePartitionedLogger)

Aggregations

FileStatus (org.apache.hadoop.fs.FileStatus)1 FileSystem (org.apache.hadoop.fs.FileSystem)1 Path (org.apache.hadoop.fs.Path)1 HiveHookEventProto (org.apache.hadoop.hive.ql.hooks.proto.HiveHookEvents.HiveHookEventProto)1 DatePartitionedLogger (org.apache.tez.dag.history.logging.proto.DatePartitionedLogger)1