Examples of MemoryIterator


Examples of org.apache.accumulo.server.tabletserver.InMemoryMap.MemoryIterator

  }
 
  public void test2() throws Exception {
    InMemoryMap imm = new InMemoryMap(false, System.getProperty("user.dir") + "/target");
   
    MemoryIterator ski1 = imm.skvIterator();
    mutate(imm, "r1", "foo:cq1", 3, "bar1");
    MemoryIterator ski2 = imm.skvIterator();
   
    ski1.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
    assertFalse(ski1.hasTop());
   
    ski2.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
    assertTrue(ski2.hasTop());
    ae(ski2, "r1", "foo:cq1", 3, "bar1");
    assertFalse(ski2.hasTop());
   
  }
View Full Code Here

Examples of org.apache.accumulo.server.tabletserver.InMemoryMap.MemoryIterator

  public void test3() throws Exception {
    InMemoryMap imm = new InMemoryMap(false, System.getProperty("user.dir") + "/target");
   
    mutate(imm, "r1", "foo:cq1", 3, "bar1");
    mutate(imm, "r1", "foo:cq1", 3, "bar2");
    MemoryIterator ski1 = imm.skvIterator();
    mutate(imm, "r1", "foo:cq1", 3, "bar3");
   
    mutate(imm, "r3", "foo:cq1", 3, "bar9");
    mutate(imm, "r3", "foo:cq1", 3, "bara");
   
    MemoryIterator ski2 = imm.skvIterator();
   
    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(ski1, "r1", "foo:cq1", 3, "bar2");
    ae(ski1, "r1", "foo:cq1", 3, "bar1");
    assertFalse(ski1.hasTop());
   
    ski2.seek(new Range(new Text("r3")), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(ski2, "r3", "foo:cq1", 3, "bara");
    ae(ski2, "r3", "foo:cq1", 3, "bar9");
    assertFalse(ski1.hasTop());
   
  }
View Full Code Here

Examples of org.apache.accumulo.server.tabletserver.InMemoryMap.MemoryIterator

  public void test4() throws Exception {
    InMemoryMap imm = new InMemoryMap(false, System.getProperty("user.dir") + "/target");
   
    mutate(imm, "r1", "foo:cq1", 3, "bar1");
    mutate(imm, "r1", "foo:cq1", 3, "bar2");
    MemoryIterator ski1 = imm.skvIterator();
    mutate(imm, "r1", "foo:cq1", 3, "bar3");
   
    imm.delete(0);
   
    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(ski1, "r1", "foo:cq1", 3, "bar2");
    ae(ski1, "r1", "foo:cq1", 3, "bar1");
    assertFalse(ski1.hasTop());
   
    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(ski1, "r1", "foo:cq1", 3, "bar2");
    ae(ski1, "r1", "foo:cq1", 3, "bar1");
    assertFalse(ski1.hasTop());
   
    ski1.seek(new Range(new Text("r2")), LocalityGroupUtil.EMPTY_CF_SET, false);
    assertFalse(ski1.hasTop());
   
    ski1.seek(new Range(nk("r1", "foo:cq1", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(ski1, "r1", "foo:cq1", 3, "bar2");
    ae(ski1, "r1", "foo:cq1", 3, "bar1");
    assertFalse(ski1.hasTop());
   
    ski1.close();
  }
View Full Code Here

Examples of org.apache.accumulo.server.tabletserver.InMemoryMap.MemoryIterator

   
    mutate(imm, "r1", "foo:cq1", 3, "bar1");
    mutate(imm, "r1", "foo:cq1", 3, "bar2");
    mutate(imm, "r1", "foo:cq1", 3, "bar3");
   
    MemoryIterator ski1 = imm.skvIterator();
    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(ski1, "r1", "foo:cq1", 3, "bar3");
   
    imm.delete(0);
   
    ae(ski1, "r1", "foo:cq1", 3, "bar2");
    ae(ski1, "r1", "foo:cq1", 3, "bar1");
    assertFalse(ski1.hasTop());
   
    ski1.close();
   
    imm = new InMemoryMap(false, System.getProperty("user.dir") + "/target");
   
    mutate(imm, "r1", "foo:cq1", 3, "bar1");
    mutate(imm, "r1", "foo:cq2", 3, "bar2");
    mutate(imm, "r1", "foo:cq3", 3, "bar3");
   
    ski1 = imm.skvIterator();
    ski1.seek(new Range(new Text("r1")), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(ski1, "r1", "foo:cq1", 3, "bar1");
   
    imm.delete(0);
   
    ae(ski1, "r1", "foo:cq2", 3, "bar2");
    ae(ski1, "r1", "foo:cq3", 3, "bar3");
    assertFalse(ski1.hasTop());
   
    ski1.close();
  }
View Full Code Here

Examples of org.apache.accumulo.server.tabletserver.InMemoryMap.MemoryIterator

    mutate(imm, "r1", "foo:cq1", 3, "bar1");
    mutate(imm, "r1", "foo:cq2", 3, "bar2");
    mutate(imm, "r1", "foo:cq3", 3, "bar3");
    mutate(imm, "r1", "foo:cq4", 3, "bar4");
   
    MemoryIterator ski1 = imm.skvIterator();
   
    mutate(imm, "r1", "foo:cq5", 3, "bar5");
   
    SortedKeyValueIterator<Key,Value> dc = ski1.deepCopy(null);
   
    ski1.seek(new Range(nk("r1", "foo:cq1", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(ski1, "r1", "foo:cq1", 3, "bar1");
   
    dc.seek(new Range(nk("r1", "foo:cq2", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(dc, "r1", "foo:cq2", 3, "bar2");
   
    imm.delete(0);
   
    ae(ski1, "r1", "foo:cq2", 3, "bar2");
    ae(dc, "r1", "foo:cq3", 3, "bar3");
    ae(ski1, "r1", "foo:cq3", 3, "bar3");
    ae(dc, "r1", "foo:cq4", 3, "bar4");
    ae(ski1, "r1", "foo:cq4", 3, "bar4");
    assertFalse(ski1.hasTop());
    assertFalse(dc.hasTop());
   
    ski1.seek(new Range(nk("r1", "foo:cq3", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
   
    dc.seek(new Range(nk("r1", "foo:cq4", 3), null), LocalityGroupUtil.EMPTY_CF_SET, false);
    ae(dc, "r1", "foo:cq4", 3, "bar4");
    assertFalse(dc.hasTop());
   
    ae(ski1, "r1", "foo:cq3", 3, "bar3");
    ae(ski1, "r1", "foo:cq4", 3, "bar4");
    assertFalse(ski1.hasTop());
    assertFalse(dc.hasTop());
   
    ski1.close();
  }
View Full Code Here

Examples of org.apache.accumulo.server.tabletserver.InMemoryMap.MemoryIterator

    InMemoryMap imm = new InMemoryMap(false, System.getProperty("user.dir") + "/target");
   
    mutate(imm, "r1", "foo:cq1", 3, "bar1");
    mutate(imm, "r1", "foo:cq2", 3, "bar2");
   
    MemoryIterator ski1 = imm.skvIterator();
   
    AtomicBoolean iflag = new AtomicBoolean(false);
    ski1.setInterruptFlag(iflag);

    if (interleaving == 1) {
      imm.delete(0);
      if (interrupt)
        iflag.set(true);
    }
   
    SortedKeyValueIterator<Key,Value> dc = ski1.deepCopy(null);

    if (interleaving == 2) {
      imm.delete(0);
      if (interrupt)
        iflag.set(true);
    }

    dc.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
    ski1.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);

    if (interleaving == 3) {
      imm.delete(0);
      if (interrupt)
        iflag.set(true);
    }

    ae(dc, "r1", "foo:cq1", 3, "bar1");
    ae(ski1, "r1", "foo:cq1", 3, "bar1");
    dc.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);

    if (interleaving == 4) {
      imm.delete(0);
      if (interrupt)
        iflag.set(true);
    }

    ae(ski1, "r1", "foo:cq2", 3, "bar2");
    ae(dc, "r1", "foo:cq1", 3, "bar1");
    ae(dc, "r1", "foo:cq2", 3, "bar2");
    assertFalse(dc.hasTop());
    assertFalse(ski1.hasTop());

    if (interrupt)
      dc.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
  }
View Full Code Here

Examples of org.apache.accumulo.server.tabletserver.InMemoryMap.MemoryIterator

   
    for (int i = 0; i < 20; i++) {
      mutate(imm, "r2", "foo:cq" + i, 3, "bar" + i);
    }
   
    MemoryIterator ski1 = imm.skvIterator();
    ColumnFamilySkippingIterator cfsi = new ColumnFamilySkippingIterator(ski1);
   
    imm.delete(0);
   
    ArrayList<ByteSequence> columns = new ArrayList<ByteSequence>();
    columns.add(new ArrayByteSequence("bar"));
   
    // this seek resulted in an infinite loop before a bug was fixed
    cfsi.seek(new Range("r1"), columns, true);
   
    assertFalse(cfsi.hasTop());
   
    ski1.close();
  }
View Full Code Here

Examples of org.apache.accumulo.server.tabletserver.InMemoryMap.MemoryIterator

    mutate(imm, "r1", "foo:cq1", 3, "bar1");
    mutate(imm, "r1", "foo:cq2", 3, "bar2");
    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

Examples of org.apache.accumulo.server.tabletserver.InMemoryMap.MemoryIterator

    Mutation m = new Mutation(new Text("r1"));
    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

Examples of org.apache.accumulo.server.tabletserver.InMemoryMap.MemoryIterator

  }
 
  public void test2() throws Exception {
    InMemoryMap imm = new InMemoryMap(false, "/tmp");
   
    MemoryIterator ski1 = imm.skvIterator();
    mutate(imm, "r1", "foo:cq1", 3, "bar1");
    MemoryIterator ski2 = imm.skvIterator();
   
    ski1.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
    assertFalse(ski1.hasTop());
   
    ski2.seek(new Range(), LocalityGroupUtil.EMPTY_CF_SET, false);
    assertTrue(ski2.hasTop());
    ae(ski2, "r1", "foo:cq1", 3, "bar1");
    assertFalse(ski2.hasTop());
   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.