Package org.apache.hadoop.hdfs.tools.offlineEditsViewer.Tokenizer

Examples of org.apache.hadoop.hdfs.tools.offlineEditsViewer.Tokenizer.IntToken


    try {
      v.start();
      v.visitEnclosingElement(EditsElement.EDITS);

      IntToken editsVersionToken = v.visitInt(EditsElement.EDITS_VERSION);
      editsVersion = editsVersionToken.value;
      if(!canLoadVersion(editsVersion)) {
        throw new IOException("Cannot process editLog version " +
          editsVersionToken.value);
      }
View Full Code Here


  /**
   * Convenience shortcut method to parse a specific token type
   */
  public IntToken visitInt(EditsElement e) throws IOException {
    return (IntToken)visit(tokenizer.read(new IntToken(e)));
  }
View Full Code Here

  private void visit_OP_CLOSE() throws IOException {
    visit_OP_ADD_or_OP_CLOSE(FSEditLogOpCodes.OP_CLOSE);
  }
 
  private void visit_Blocks() throws IOException {
    IntToken numBlocksToken = v.visitInt(EditsElement.NUMBLOCKS);
    for (int i = 0; i < numBlocksToken.value; i++) {
      v.visitEnclosingElement(EditsElement.BLOCK);

      v.visitLong(EditsElement.BLOCK_ID);
      v.visitLong(EditsElement.BLOCK_NUM_BYTES);
View Full Code Here

   */
  private void visit_OP_ADD_or_OP_CLOSE(FSEditLogOpCodes editsOpCode)
      throws IOException {
      visitTxId();
      if (!LayoutVersion.supports(Feature.EDITLOG_OP_OPTIMIZATION, editsVersion)) {
        IntToken opAddLength = v.visitInt(EditsElement.LENGTH);
        // this happens if the edits is not properly ended (-1 op code),
        // it is padded at the end with all zeros, OP_ADD is zero so
        // without this check we would treat all zeros as empty OP_ADD)
        if (opAddLength.value == 0) {
          throw new IOException("OpCode " + editsOpCode
View Full Code Here

   */
  private void visit_OP_CONCAT_DELETE() throws IOException {
    visitTxId();
    int sourceCount = 0;
    if (!LayoutVersion.supports(Feature.EDITLOG_OP_OPTIMIZATION, editsVersion)) {
      IntToken lengthToken = v.visitInt(EditsElement.LENGTH);
      sourceCount = lengthToken.value - 2;
      Log.info("------------------------- does not support");
    }
    v.visitStringUTF8(EditsElement.CONCAT_TARGET);
    // all except of CONCAT_TARGET and TIMESTAMP
    if (LayoutVersion.supports(Feature.EDITLOG_OP_OPTIMIZATION, editsVersion)) {
      IntToken lengthToken = v.visitInt(EditsElement.LENGTH);
      sourceCount = lengthToken.value;
      Log.info("------------------------- does support");
    }
    for(int i = 0; i < sourceCount; i++) {
      v.visitStringUTF8(EditsElement.CONCAT_SOURCE);
View Full Code Here

    try {
      v.start();
      v.visitEnclosingElement(EditsElement.EDITS);

      IntToken editsVersionToken = v.visitInt(EditsElement.EDITS_VERSION);
      editsVersion = editsVersionToken.value;
      if(!canLoadVersion(editsVersion)) {
        throw new IOException("Cannot process editLog version " +
          editsVersionToken.value);
      }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hdfs.tools.offlineEditsViewer.Tokenizer.IntToken

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.