Package org.apache.accumulo.core.client.impl

Examples of org.apache.accumulo.core.client.impl.TabletLocatorImpl


   
    Text tableName = new Text("foo");
   
    // test with three tablets and a range that covers the whole table
    List<Range> ranges = nrl(nr(null, null));
    TabletLocatorImpl metaCache = createLocators("foo", nke("foo", "g", null), "l1", nke("foo", "m", "g"), "l2", nke("foo", null, "m"), "l2");
   
    Map<String,Map<KeyExtent,List<Range>>> expected = createExpectedBinnings("l1", nol(nke("foo", "g", null), nrl(nr(null, null))), "l2",
        nol(nke("foo", "m", "g"), nrl(nr(null, null)), nke("foo", null, "m"), nrl(nr(null, null)))
   
    );
View Full Code Here


 
  public void testBinRanges4() throws Exception {
    Text tableName = new Text("foo");
   
    List<Range> ranges = nrl(new Range(new Text("1")));
    TabletLocatorImpl metaCache = createLocators("foo", nke("foo", "0", null), "l1", nke("foo", "1", "0"), "l2", nke("foo", "2", "1"), "l3",
        nke("foo", "3", "2"), "l4", nke("foo", null, "3"), "l5");
   
    Map<String,Map<KeyExtent,List<Range>>> expected = createExpectedBinnings("l2", nol(nke("foo", "1", "0"), nrl(new Range(new Text("1"))))
   
    );
View Full Code Here

  public void testBinRanges5() throws Exception {
    // Test binning when there is a hole in the !METADATA information
    Text tableName = new Text("foo");
   
    List<Range> ranges = nrl(new Range(new Text("1")));
    TabletLocatorImpl metaCache = createLocators("foo", nke("foo", "0", null), "l1", nke("foo", "1", "0"), "l2", nke("foo", "3", "2"), "l4",
        nke("foo", null, "3"), "l5");
   
    Map<String,Map<KeyExtent,List<Range>>> expected1 = createExpectedBinnings("l2", nol(nke("foo", "1", "0"), nrl(new Range(new Text("1"))))
   
    );
View Full Code Here

  }
 
  public void testBinMutations1() throws Exception {
    // one tablet table
    KeyExtent ke1 = nke("foo", null, null);
    TabletLocatorImpl metaCache = createLocators("foo", ke1, "l1");
   
    List<Mutation> ml = nml(nm("a", "cf1:cq1=v1", "cf1:cq2=v2"), nm("c", "cf1:cq1=v3", "cf1:cq2=v4"));
    Map<String,Map<KeyExtent,List<String>>> emb = cemb(nol("a", "l1", ke1), nol("c", "l1", ke1));
    runTest(metaCache, ml, emb);
   
View Full Code Here

   
  }
 
  public void testBinMutations2() throws Exception {
    // no tablets for table
    TabletLocatorImpl metaCache = createLocators("foo");
   
    List<Mutation> ml = nml(nm("a", "cf1:cq1=v1", "cf1:cq2=v2"), nm("c", "cf1:cq1=v3", "cf1:cq2=v4"));
    Map<String,Map<KeyExtent,List<String>>> emb = cemb();
    runTest(metaCache, ml, emb, "a", "c");
  }
View Full Code Here

    // three tablet table
    KeyExtent ke1 = nke("foo", "h", null);
    KeyExtent ke2 = nke("foo", "t", "h");
    KeyExtent ke3 = nke("foo", null, "t");
   
    TabletLocatorImpl metaCache = createLocators("foo", ke1, "l1", ke2, "l2", ke3, "l3");
   
    List<Mutation> ml = nml(nm("a", "cf1:cq1=v1", "cf1:cq2=v2"), nm("i", "cf1:cq1=v3", "cf1:cq2=v4"));
    Map<String,Map<KeyExtent,List<String>>> emb = cemb(nol("a", "l1", ke1), nol("i", "l2", ke2));
    runTest(metaCache, ml, emb);
   
View Full Code Here

    // three table with hole
    KeyExtent ke1 = nke("foo", "h", null);
   
    KeyExtent ke3 = nke("foo", null, "t");
   
    TabletLocatorImpl metaCache = createLocators("foo", ke1, "l1", ke3, "l3");
   
    List<Mutation> ml = nml(nm("a", "cf1:cq1=v1", "cf1:cq2=v2"), nm("i", "cf1:cq1=v3", "cf1:cq2=v4"));
    Map<String,Map<KeyExtent,List<String>>> emb = cemb(nol("a", "l1", ke1));
    runTest(metaCache, ml, emb, "i");
   
View Full Code Here

      // when i == 1 only test binning ranges
      // when i == 2 test both
     
      KeyExtent ke1 = nke("foo", null, null);
      TServers tservers = new TServers();
      TabletLocatorImpl metaCache = createLocators(tservers, "tserver1", "tserver2", "foo", ke1, "l1");
     
      List<Mutation> ml = nml(nm("a", "cf1:cq1=v1", "cf1:cq2=v2"), nm("m", "cf1:cq1=v3", "cf1:cq2=v4"), nm("z", "cf1:cq1=v5"));
      Map<String,Map<KeyExtent,List<String>>> emb = cemb(nol("a", "l1", ke1), nol("m", "l1", ke1), nol("z", "l1", ke1));
      if (i == 0 || i == 2)
        runTest(metaCache, ml, emb);
     
      List<Range> ranges = nrl(new Range(new Text("a")), new Range(new Text("m")), new Range(new Text("z")));
     
      Map<String,Map<KeyExtent,List<Range>>> expected1 = createExpectedBinnings("l1", nol(nke("foo", null, null), ranges)
     
      );
     
      if (i == 1 || i == 2)
        runTest(new Text("foo"), ranges, metaCache, expected1);
     
      KeyExtent ke11 = nke("foo", "n", null);
      KeyExtent ke12 = nke("foo", null, "n");
     
      setLocation(tservers, "tserver2", MTE, ke12, "l2");
     
      metaCache.invalidateCache(ke1);
     
      emb = cemb(nol("z", "l2", ke12));
      if (i == 0 || i == 2)
        runTest(metaCache, ml, emb, "a", "m");
     
View Full Code Here

    TServers tservers = new TServers();
    TestTabletLocationObtainer ttlo = new TestTabletLocationObtainer(tservers);
    TestInstance testInstance = new TestInstance("instance1", "tserver1");
   
    RootTabletLocator rtl = new RootTabletLocator(testInstance);
    TabletLocatorImpl rootTabletCache = new TabletLocatorImpl(new Text(Constants.METADATA_TABLE_ID), rtl, ttlo);
    TabletLocatorImpl tab0TabletCache = new TabletLocatorImpl(new Text("0"), rootTabletCache, ttlo);
   
    setLocation(tservers, "tserver1", RTE, mte1, "tserver2");
    setLocation(tservers, "tserver1", RTE, mte2, "tserver3");
   
    // create two tablets that straddle a !METADATA split point
View Full Code Here

    TServers tservers = new TServers();
    TestTabletLocationObtainer ttlo = new TestTabletLocationObtainer(tservers);
    TestInstance testInstance = new TestInstance("instance1", "tserver1");
   
    RootTabletLocator rtl = new RootTabletLocator(testInstance);
    TabletLocatorImpl rootTabletCache = new TabletLocatorImpl(new Text(Constants.METADATA_TABLE_ID), rtl, ttlo);
    TabletLocatorImpl tab0TabletCache = new TabletLocatorImpl(new Text("0"), rootTabletCache, ttlo);
   
    setLocation(tservers, "tserver1", RTE, mte1, "tserver2");
    setLocation(tservers, "tserver1", RTE, mte2, "tserver3");
   
    // create the ~ tablet so it exists
    Map<KeyExtent,SortedMap<Key,Value>> ts3 = new HashMap<KeyExtent,SortedMap<Key,Value>>();
    ts3.put(mte2, new TreeMap<Key,Value>());
    tservers.tservers.put("tserver3", ts3);
   
    assertNull(tab0TabletCache.locateTablet(new Text("row_0000000000"), false, false));
   
  }
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.impl.TabletLocatorImpl

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.