Package org.apache.hadoop.chukwa.datacollection.writer.hbase.Annotation

Examples of org.apache.hadoop.chukwa.datacollection.writer.hbase.Annotation.Table


              schemaVerified = false;
              log.warn("Validation failed - table: "+table.name()+" column family: "+table.columnFamily()+" does not exist.");             
            }
          }
        } else if(x.isAnnotationPresent(Table.class)) {
          Table table = x.getAnnotation(Table.class);
          if(!verifyHbaseTable(admin, table)) {
            schemaVerified = false;
            log.warn("Validation failed - table: "+table.name()+" column family: "+table.columnFamily()+" does not exist.");
          }
        }
      }
    } catch (Exception e) {
      schemaVerified = false;
View Full Code Here


        String processorClass = conf.get(chunk.getDataType(),
                defaultProcessor);
        synchronized (this) {
          MapProcessor processor = MapProcessorFactory.getProcessor(processorClass);
          try {
            Table table = null;
            if(processor.getClass().isAnnotationPresent(Table.class)) {
              table = processor.getClass().getAnnotation(Table.class);
            } else if(processor.getClass().isAnnotationPresent(Tables.class)) {
              Tables tables = processor.getClass().getAnnotation(Tables.class);
              for(Table t : tables.annotations()) {
                table = t;
              }
            }
            if(table!=null) {
              HTableInterface hbase = pool.getTable(table.name().getBytes())
              processor.process(new ChukwaArchiveKey(), chunk, output, reporter);
              hbase.put(output.getKeyValues());
              pool.putTable(hbase);
            }
          } catch (Exception e) {
View Full Code Here

              schemaVerified = false;
              log.warn("Validation failed - table: "+table.name()+" column family: "+table.columnFamily()+" does not exist.");             
            }
          }
        } else if(x.isAnnotationPresent(Table.class)) {
          Table table = x.getAnnotation(Table.class);
          if(!verifyHbaseTable(admin, table)) {
            schemaVerified = false;
            log.warn("Validation failed - table: "+table.name()+" column family: "+table.columnFamily()+" does not exist.");
          }
        }
      }
    } catch (Exception e) {
      schemaVerified = false;
View Full Code Here

    CommitStatus rv = ChukwaWriter.COMMIT_OK;
    try {
      for(Chunk chunk : chunks) {
        synchronized (this) {
          try {
            Table table = findHBaseTable(chunk.getDataType());

            if(table!=null) {
              HTableInterface hbase = pool.getTable(table.name().getBytes());
              MapProcessor processor = getProcessor(chunk.getDataType());
              processor.process(new ChukwaArchiveKey(), chunk, output, reporter);

              hbase.put(output.getKeyValues());
              pool.putTable(hbase);
View Full Code Here

  }

  public Table findHBaseTable(String dataType) throws UnknownRecordTypeException {
    MapProcessor processor = getProcessor(dataType);

    Table table = null;
    if(processor.getClass().isAnnotationPresent(Table.class)) {
      return processor.getClass().getAnnotation(Table.class);
    } else if(processor.getClass().isAnnotationPresent(Tables.class)) {
      Tables tables = processor.getClass().getAnnotation(Tables.class);
      for(Table t : tables.annotations()) {
View Full Code Here

    return table;
  }

  public String findHBaseColumnFamilyName(String dataType)
          throws UnknownRecordTypeException {
    Table table = findHBaseTable(dataType);
    return table.columnFamily();
  }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.chukwa.datacollection.writer.hbase.Annotation.Table

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.