Package org.apache.accumulo.server.logger

Examples of org.apache.accumulo.server.logger.LogFileKey


      }
  }

  public synchronized void defineTablet(int seq, int tid, KeyExtent tablet) throws IOException {
    // write this log to the METADATA table
    final LogFileKey key = new LogFileKey();
    key.event = DEFINE_TABLET;
    key.seq = seq;
    key.tid = tid;
    key.tablet = tablet;
    try {
View Full Code Here


  }

  public LoggerOperation logManyTablets(List<TabletMutations> mutations) throws IOException {
    List<Pair<LogFileKey, LogFileValue>> data = new ArrayList<Pair<LogFileKey, LogFileValue>>();
    for (TabletMutations tabletMutations : mutations) {
      LogFileKey key = new LogFileKey();
      key.event = MANY_MUTATIONS;
      key.seq = tabletMutations.getSeq();
      key.tid = tabletMutations.getTid();
      LogFileValue value = new LogFileValue();
      value.mutations = tabletMutations.getMutations();
View Full Code Here

    }
    return logFileData(data);
  }

  public LoggerOperation minorCompactionFinished(int seq, int tid, String fqfn) throws IOException {
    LogFileKey key = new LogFileKey();
    key.event = COMPACTION_FINISH;
    key.seq = seq;
    key.tid = tid;
    return logFileData(Collections.singletonList(new Pair<LogFileKey, LogFileValue>(key, EMPTY)));
  }
View Full Code Here

    key.tid = tid;
    return logFileData(Collections.singletonList(new Pair<LogFileKey, LogFileValue>(key, EMPTY)));
  }

  public LoggerOperation minorCompactionStarted(int seq, int tid, String fqfn) throws IOException {
    LogFileKey key = new LogFileKey();
    key.event = COMPACTION_START;
    key.seq = seq;
    key.tid = tid;
    key.filename = fqfn;
    return logFileData(Collections.singletonList(new Pair<LogFileKey, LogFileValue>(key, EMPTY)));
View Full Code Here

 
  private SequenceFile.Reader readOpen(LogFile logFile) throws Exception {
    String path = "./target/" + logFile.name;
    assertTrue(fs.exists(new Path(path)));
    SequenceFile.Reader result = new SequenceFile.Reader(fs, new Path(path), conf);
    LogFileKey key = new LogFileKey();
    LogFileValue value = new LogFileValue();
    assertTrue(result.next(key, value));
    assertTrue(key.event == LogEvents.OPEN);
    assertTrue(key.tid == LogFileKey.VERSION);
    return result;
View Full Code Here

    Mutation m = new Mutation(new Text("somerow"));
    m.put(new Text("cf1"), new Text("cq1"), new Value("value1".getBytes()));
    writer.log(null, logFile.id, 2, 42, m.toThrift());
    writer.close(null, logFile.id);
    SequenceFile.Reader dis = readOpen(logFile);
    LogFileKey key = new LogFileKey();
    LogFileValue value = new LogFileValue();
    assertTrue(dis.next(key, value));
    assertTrue(key.event == MUTATION);
    assertEquals(key.seq, 2);
    assertEquals(key.tid, 42);
View Full Code Here

    List<TabletMutations> updates = new ArrayList<TabletMutations>();
    updates.add(new TabletMutations(13, 3, all));
    writer.logManyTablets(null, logFile.id, updates);
    writer.close(null, logFile.id);
    SequenceFile.Reader dis = readOpen(logFile);
    LogFileKey key = new LogFileKey();
    LogFileValue value = new LogFileValue();
    assertTrue(dis.next(key, value));
    assertTrue(key.event == MANY_MUTATIONS);
    assertEquals(key.seq, 3);
    assertEquals(key.tid, 13);
View Full Code Here

    LogFile logFile = writer.create(null, CREDENTIALS, "");
    String fqfn = "/foo/bar";
    writer.minorCompactionFinished(null, logFile.id, 4, 17, fqfn);
    writer.close(null, logFile.id);
    SequenceFile.Reader dis = readOpen(logFile);
    LogFileKey key = new LogFileKey();
    LogFileValue value = new LogFileValue();
    assertTrue(dis.next(key, value));
    assertTrue(key.event == COMPACTION_FINISH);
    assertEquals(key.seq, 4);
    assertEquals(key.tid, 17);
View Full Code Here

    LogFile logFile = writer.create(null, CREDENTIALS, "");
    String fqfn = "/foo/bar";
    writer.minorCompactionStarted(null, logFile.id, 5, 23, fqfn);
    writer.close(null, logFile.id);
    SequenceFile.Reader dis = readOpen(logFile);
    LogFileKey key = new LogFileKey();
    LogFileValue value = new LogFileValue();
    assertTrue(dis.next(key, value));
    assertTrue(key.event == COMPACTION_START);
    assertEquals(key.seq, 5);
    assertEquals(key.tid, 23);
View Full Code Here

    LogFile logFile = writer.create(null, CREDENTIALS, "");
    KeyExtent ke = new KeyExtent(new Text("table1"), new Text("zzzz"), new Text("aaaaa"));
    writer.defineTablet(null, logFile.id, 6, 31, ke.toThrift());
    writer.close(null, logFile.id);
    SequenceFile.Reader dis = readOpen(logFile);
    LogFileKey key = new LogFileKey();
    LogFileValue value = new LogFileValue();
    assertTrue(dis.next(key, value));
    assertTrue(key.event == DEFINE_TABLET);
    assertEquals(key.seq, 6);
    assertEquals(key.tid, 31);
View Full Code Here

TOP

Related Classes of org.apache.accumulo.server.logger.LogFileKey

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.