Package org.apache.accumulo.core.data

Examples of org.apache.accumulo.core.data.Range


    mutate(imm, "r1", "foo:cq3", 3, "bar3");
    mutate(imm, "r1", "foo:cq4", 3, "bar4");
   
    MemoryIterator skvi1 = imm.skvIterator();
   
    skvi1.seek(new Range(nk("r1", "foo:cq3", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(skvi1, "r1", "foo:cq3", 3, "bar3");
   
    skvi1.seek(new Range(nk("r1", "foo:cq1", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(skvi1, "r1", "foo:cq1", 3, "bar1");
   
  }
View Full Code Here


    m.put(new Text("foo"), new Text("cq"), 3, new Value("v1".getBytes()));
    m.put(new Text("foo"), new Text("cq"), 3, new Value("v2".getBytes()));
    imm.mutate(Collections.singletonList(m));
   
    MemoryIterator skvi1 = imm.skvIterator();
    skvi1.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(skvi1, "r1", "foo:cq", 3, "v2");
    ae(skvi1, "r1", "foo:cq", 3, "v1");
  }
View Full Code Here

        newConf.setInt("io.seqfile.compress.blocksize", 100000);
       
        FileSKVWriter out = new RFileOperations().openWriter(tmpFile, fs, newConf, ServerConfiguration.getSiteConfiguration());
        out.startDefaultLocalityGroup();
        InterruptibleIterator iter = map.skvIterator();
        iter.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
       
        while (iter.hasTop() && activeIters.size() > 0) {
          // RFile does not support MemKey, so we move the kv count into the value only for the RFile.
          // There is no need to change the MemKey to a normal key because the kvCount info gets lost when it is written
          Value newValue = new MemValue(iter.getTopValue(), ((MemKey) iter.getTopKey()).kvCount);
View Full Code Here

      removeInvalidCandidates(candidates);
      return candidates;
    }

    checkForBulkProcessingFiles = false;
    Range range = Constants.METADATA_DELETES_FOR_METADATA_KEYSPACE;
    candidates.addAll(getBatch(Constants.METADATA_DELETE_FLAG_FOR_METADATA_PREFIX, range));
    if (candidateMemExceeded)
      return candidates;
   
    range = Constants.METADATA_DELETES_KEYSPACE;
View Full Code Here

    if (continueKey != null) {
      if (!range.contains(continueKey)) {
        // continue key is for some other range
        return Collections.emptyList();
      }
      range = new Range(continueKey, true, range.getEndKey(), range.isEndKeyInclusive());
      continueKey = null;
    }
   
    Scanner scanner = instance.getConnector(credentials.getPrincipal(), CredentialHelper.extractToken(credentials)).createScanner(Constants.METADATA_TABLE_NAME, Constants.NO_AUTHS);
    scanner.setRange(range);
View Full Code Here

  }
 
  private static void printEvents(Connector conn, String tableId, String endRow, Long time) throws Exception {
    Scanner scanner = conn.createScanner("tabletEvents", new Authorizations());
    String metaRow = tableId + (endRow == null ? "<" : ";" + endRow);
    scanner.setRange(new Range(new Key(metaRow, String.format("%020d", time)), true, new Key(metaRow).followingKey(PartialKey.ROW), false));
    int count = 0;
   
    String lastLog = null;

    loop1: for (Entry<Key,Value> entry : scanner) {
View Full Code Here

   
    findContainingTablets(opts);
  }

  private static void findContainingTablets(Opts opts) throws Exception {
    Range range = new KeyExtent(new Text(opts.tableId), null, null).toMetadataRange();

    Scanner scanner = opts.getConnector().createScanner("createEvents", opts.auths);
    scanner.setRange(range);

    Text row = new Text(opts.row);
View Full Code Here

public class RangeInputSplitTest {

  @Test
  public void testSimpleWritable() throws IOException {
    RangeInputSplit split = new RangeInputSplit(new Range(new Key("a"), new Key("b")), new String[]{"localhost"});
   
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    DataOutputStream dos = new DataOutputStream(baos);
    split.write(dos);
   
View Full Code Here

    Assert.assertTrue(Arrays.equals(split.getLocations(), newSplit.getLocations()));
  }

  @Test
  public void testAllFieldsWritable() throws IOException {
    RangeInputSplit split = new RangeInputSplit(new Range(new Key("a"), new Key("b")), new String[]{"localhost"});
   
    Set<Pair<Text,Text>> fetchedColumns = new HashSet<Pair<Text,Text>>();
   
    fetchedColumns.add(new Pair<Text,Text>(new Text("colf1"), new Text("colq1")));
    fetchedColumns.add(new Pair<Text,Text>(new Text("colf2"), new Text("colq2")));
View Full Code Here

    public void testBasic() throws IOException {
        ColumnSliceFilter.setSlice(is, "20080202", "20080204");

        assertTrue(columnSliceFilter.validateOptions(is.getOptions()));
        columnSliceFilter.init(new SortedMapIterator(TEST_DATA), is.getOptions(), iteratorEnvironment);
        columnSliceFilter.seek(new Range(), EMPTY_COL_FAMS, true);

        assertTrue(columnSliceFilter.hasTop());
        assertTrue(columnSliceFilter.getTopKey().equals(KEY_2));
        columnSliceFilter.next();
        assertTrue(columnSliceFilter.hasTop());
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.data.Range

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.