Package org.apache.accumulo.server.tabletserver.log

Examples of org.apache.accumulo.server.tabletserver.log.MultiReader$Index


    return String.valueOf(characters, index++, len);
  }

  @Override
  public Index getIndex(int bookmark) {
    return new Index(bookmark, index);
  }
View Full Code Here


        } finally {
          f.close();
        }
      } else {
        // read the log entries sorted in a map file
        MultiReader input = new MultiReader(fs, conf, file);
        while (input.next(key, value)) {
          printLogEvent(key, value, row, rowMatcher, ke, tabletIds, opts.maxMutations);
        }
      }
    }
  }
View Full Code Here

          }
        }
      } else {
        try {
          // read the log entries sorted in a map file
          MultiReader input = new MultiReader(fs, conf, file);
          while (input.next(key, value)) {
            printLogEvent(key, value, row, rowMatcher, ke, tabletIds, max);
          }
        } catch (FileNotFoundException ex) {
          SequenceFile.Reader input = new SequenceFile.Reader(local, new Path(file), conf);
          while (input.next(key, value)) {
            printLogEvent(key, value, row, rowMatcher, ke, tabletIds, max);
          }
          input.close();
        }
      }
    }
  }
View Full Code Here

        } finally {
          f.close();
        }
      } else {
        // read the log entries sorted in a map file
        MultiReader input = new MultiReader(fs, conf, file);
        while (input.next(key, value)) {
          printLogEvent(key, value, row, rowMatcher, ke, tabletIds, opts.maxMutations);
        }
      }
    }
  }
View Full Code Here

          printLogEvent(key, value, row, rowMatcher, ke, tabletIds, max);
        }
      } else {
        try {
          // read the log entries sorted in a map file
          MultiReader input = new MultiReader(fs, conf, file);
          while (input.next(key, value)) {
            printLogEvent(key, value, row, rowMatcher, ke, tabletIds, max);
          }
        } catch (FileNotFoundException ex) {
          SequenceFile.Reader input = new SequenceFile.Reader(local, new Path(file), conf);
          while (input.next(key, value)) {
            printLogEvent(key, value, row, rowMatcher, ke, tabletIds, max);
          }
        }
      }
    }
View Full Code Here

    }
  }
 
  @Test
  public void testMultiReader() throws IOException {
    MultiReader reader = new MultiReader(fs, conf, "manyMaps");
    IntWritable key = new IntWritable();
    BytesWritable value = new BytesWritable();
   
    for (int i = 0; i < 1000; i++) {
      if (i == 10)
        continue;
      assertTrue(reader.next(key, value));
      assertEquals(i, key.get());
    }
    assertEquals(value.compareTo(new BytesWritable("someValue".getBytes())), 0);
    assertFalse(reader.next(key, value));
   
    key.set(500);
    assertTrue(reader.seek(key));
    scan(reader, 500);
    key.set(10);
    assertFalse(reader.seek(key));
    scan(reader, 10);
    key.set(1000);
    assertFalse(reader.seek(key));
    assertFalse(reader.next(key, value));
    key.set(-1);
    assertFalse(reader.seek(key));
    key.set(0);
    assertTrue(reader.next(key, value));
    assertEquals(0, key.get());
    reader.close();
   
    fs.delete(new Path("manyMaps/even"), true);
    reader = new MultiReader(fs, conf, "manyMaps");
    key.set(501);
    assertTrue(reader.seek(key));
    scanOdd(reader, 501);
    key.set(1000);
    assertFalse(reader.seek(key));
    assertFalse(reader.next(key, value));
    key.set(-1);
    assertFalse(reader.seek(key));
    key.set(1);
    assertTrue(reader.next(key, value));
    assertEquals(1, key.get());
    reader.close();
   
  }
View Full Code Here

        } finally {
          f.close();
        }
      } else {
        // read the log entries sorted in a map file
        MultiReader input = new MultiReader(fs, conf, file);
        while (input.next(key, value)) {
          printLogEvent(key, value, row, rowMatcher, ke, tabletIds, opts.maxMutations);
        }
      }
    }
  }
View Full Code Here

          printLogEvent(key, value, row, max);
        }
      } else {
        try {
          // read the log entries sorted in a map file
          MultiReader input = new MultiReader(fs, conf, file);
          while (input.next(key, value)) {
            printLogEvent(key, value, row, max);
          }
        } catch (FileNotFoundException ex) {
          SequenceFile.Reader input = new SequenceFile.Reader(local, new Path(file), conf);
          while (input.next(key, value)) {
            printLogEvent(key, value, row, max);
          }
        }
      }
    }
View Full Code Here

    int ni = shape[0];
    int nj = shape[1];
    int nk = shape[2];

    array = new ArrayDouble.D3(ni, nj, nk);
    Index index = array.getIndex();

    for (int i = 0; i < ni; i++) {
      for (int j = 0; j < nj; j++) {
        for (int k = 0; k < nk; k++) {
          index.set(i, j, k);
          double d = pertArray.getDouble(index)
              + baseArray.getDouble(index);
          if (isZStag) {
            d = d / 9.81//convert geopotential to height
          }
View Full Code Here

      IndexChunker.printl(" dataStrides=", dataStrides);
      IndexChunker.printa(" wantStride=", resultStrides);
      System.out.println(" indexChunks=" + Index.computeSize(shape));
    }
    dataIndex = new IndexLong(shape, dataStrides);
    resultIndex = new Index(shape, resultStrides);

    if (debugDetail) {
      System.out.println(" dataIndex="+ dataIndex.toString());
      System.out.println(" resultIndex="+ resultIndex.toStringDebug());
    }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.server.tabletserver.log.MultiReader$Index

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.