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

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


    // 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

   
    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 tab1TabletCache = new TabletLocatorImpl(new Text(table), rootTabletCache, ttlo);
   
    setLocation(tservers, rootTabLoc, RTE, MTE, metaTabLoc);
   
    for (Entry<KeyExtent,TabletLocation> entry : mcke.entrySet()) {
      setLocation(tservers, metaTabLoc, MTE, entry.getKey(), entry.getValue().tablet_location);
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 tab1TabletCache = new TabletLocatorImpl(new Text("tab1"), rootTabletCache, ttlo);
   
    locateTabletTest(tab1TabletCache, "r1", null, null);
   
    KeyExtent tab1e = nke("tab1", null, null);
   
    setLocation(tservers, "tserver1", RTE, MTE, "tserver2");
    setLocation(tservers, "tserver2", MTE, tab1e, "tserver3");
   
    locateTabletTest(tab1TabletCache, "r1", tab1e, "tserver3");
    locateTabletTest(tab1TabletCache, "r2", tab1e, "tserver3");
   
    // simulate a split
    KeyExtent tab1e1 = nke("tab1", "g", null);
    KeyExtent tab1e2 = nke("tab1", null, "g");
   
    setLocation(tservers, "tserver2", MTE, tab1e1, "tserver4");
    setLocation(tservers, "tserver2", MTE, tab1e2, "tserver5");
   
    locateTabletTest(tab1TabletCache, "r1", tab1e, "tserver3");
    tab1TabletCache.invalidateCache(tab1e);
    locateTabletTest(tab1TabletCache, "r1", tab1e2, "tserver5");
    locateTabletTest(tab1TabletCache, "a", tab1e1, "tserver4");
    locateTabletTest(tab1TabletCache, "a", true, tab1e1, "tserver4");
    locateTabletTest(tab1TabletCache, "g", tab1e1, "tserver4");
    locateTabletTest(tab1TabletCache, "g", true, tab1e2, "tserver5");
   
    // simulate a partial split
    KeyExtent tab1e22 = nke("tab1", null, "m");
    setLocation(tservers, "tserver2", MTE, tab1e22, "tserver6");
    locateTabletTest(tab1TabletCache, "r1", tab1e2, "tserver5");
    tab1TabletCache.invalidateCache(tab1e2);
    locateTabletTest(tab1TabletCache, "r1", tab1e22, "tserver6");
    locateTabletTest(tab1TabletCache, "h", null, null);
    locateTabletTest(tab1TabletCache, "a", tab1e1, "tserver4");
    KeyExtent tab1e21 = nke("tab1", "m", "g");
    setLocation(tservers, "tserver2", MTE, tab1e21, "tserver7");
    locateTabletTest(tab1TabletCache, "r1", tab1e22, "tserver6");
    locateTabletTest(tab1TabletCache, "h", tab1e21, "tserver7");
    locateTabletTest(tab1TabletCache, "a", tab1e1, "tserver4");
   
    // simulate a migration
    setLocation(tservers, "tserver2", MTE, tab1e21, "tserver8");
    tab1TabletCache.invalidateCache(tab1e21);
    locateTabletTest(tab1TabletCache, "r1", tab1e22, "tserver6");
    locateTabletTest(tab1TabletCache, "h", tab1e21, "tserver8");
    locateTabletTest(tab1TabletCache, "a", tab1e1, "tserver4");
   
    // simulate a server failure
    setLocation(tservers, "tserver2", MTE, tab1e21, "tserver9");
    tab1TabletCache.invalidateCache("tserver8");
    locateTabletTest(tab1TabletCache, "r1", tab1e22, "tserver6");
    locateTabletTest(tab1TabletCache, "h", tab1e21, "tserver9");
    locateTabletTest(tab1TabletCache, "a", tab1e1, "tserver4");
   
    // simulate all servers failing
    deleteServer(tservers, "tserver1");
    deleteServer(tservers, "tserver2");
    tab1TabletCache.invalidateCache("tserver4");
    tab1TabletCache.invalidateCache("tserver6");
    tab1TabletCache.invalidateCache("tserver9");
   
    locateTabletTest(tab1TabletCache, "r1", null, null);
    locateTabletTest(tab1TabletCache, "h", null, null);
    locateTabletTest(tab1TabletCache, "a", null, null);
   
    testInstance.setRootTabletLocation("tserver4");
    setLocation(tservers, "tserver4", RTE, MTE, "tserver5");
    setLocation(tservers, "tserver5", MTE, tab1e1, "tserver1");
    setLocation(tservers, "tserver5", MTE, tab1e21, "tserver2");
    setLocation(tservers, "tserver5", MTE, tab1e22, "tserver3");
   
    locateTabletTest(tab1TabletCache, "a", tab1e1, "tserver1");
    locateTabletTest(tab1TabletCache, "h", tab1e21, "tserver2");
    locateTabletTest(tab1TabletCache, "r", tab1e22, "tserver3");
   
    // simulate the !METADATA table splitting
    KeyExtent mte1 = new KeyExtent(new Text(Constants.METADATA_TABLE_ID), tab1e21.getMetadataEntry(), RTE.getEndRow());
    KeyExtent mte2 = new KeyExtent(new Text(Constants.METADATA_TABLE_ID), null, tab1e21.getMetadataEntry());
   
    setLocation(tservers, "tserver4", RTE, mte1, "tserver5");
    setLocation(tservers, "tserver4", RTE, mte2, "tserver6");
    deleteServer(tservers, "tserver5");
    setLocation(tservers, "tserver5", mte1, tab1e1, "tserver7");
    setLocation(tservers, "tserver5", mte1, tab1e21, "tserver8");
    setLocation(tservers, "tserver6", mte2, tab1e22, "tserver9");
   
    tab1TabletCache.invalidateCache(tab1e1);
    tab1TabletCache.invalidateCache(tab1e21);
    tab1TabletCache.invalidateCache(tab1e22);
   
    locateTabletTest(tab1TabletCache, "a", tab1e1, "tserver7");
    locateTabletTest(tab1TabletCache, "h", tab1e21, "tserver8");
    locateTabletTest(tab1TabletCache, "r", tab1e22, "tserver9");
   
    // simulate metadata and regular server down and the reassigned
    deleteServer(tservers, "tserver5");
    tab1TabletCache.invalidateCache("tserver7");
    locateTabletTest(tab1TabletCache, "a", null, null);
    locateTabletTest(tab1TabletCache, "h", tab1e21, "tserver8");
    locateTabletTest(tab1TabletCache, "r", tab1e22, "tserver9");
   
    setLocation(tservers, "tserver4", RTE, mte1, "tserver10");
    setLocation(tservers, "tserver10", mte1, tab1e1, "tserver7");
    setLocation(tservers, "tserver10", mte1, tab1e21, "tserver8");
   
    locateTabletTest(tab1TabletCache, "a", tab1e1, "tserver7");
    locateTabletTest(tab1TabletCache, "h", tab1e21, "tserver8");
    locateTabletTest(tab1TabletCache, "r", tab1e22, "tserver9");
    tab1TabletCache.invalidateCache("tserver7");
    setLocation(tservers, "tserver10", mte1, tab1e1, "tserver2");
    locateTabletTest(tab1TabletCache, "a", tab1e1, "tserver2");
    locateTabletTest(tab1TabletCache, "h", tab1e21, "tserver8");
    locateTabletTest(tab1TabletCache, "r", tab1e22, "tserver9");
   
    // simulate a hole in the !METADATA table, caused by a partial split
    KeyExtent mte11 = new KeyExtent(new Text(Constants.METADATA_TABLE_ID), tab1e1.getMetadataEntry(), RTE.getEndRow());
    KeyExtent mte12 = new KeyExtent(new Text(Constants.METADATA_TABLE_ID), tab1e21.getMetadataEntry(), tab1e1.getMetadataEntry());
    deleteServer(tservers, "tserver10");
    setLocation(tservers, "tserver4", RTE, mte12, "tserver10");
    setLocation(tservers, "tserver10", mte12, tab1e21, "tserver12");
   
    // at this point should be no info in !METADATA about tab1e1
    tab1TabletCache.invalidateCache(tab1e1);
    tab1TabletCache.invalidateCache(tab1e21);
    locateTabletTest(tab1TabletCache, "a", null, null);
    locateTabletTest(tab1TabletCache, "h", tab1e21, "tserver12");
    locateTabletTest(tab1TabletCache, "r", tab1e22, "tserver9");
   
    setLocation(tservers, "tserver4", RTE, mte11, "tserver5");
View Full Code Here

    locateTabletTest(tab1TabletCache, "r", tab1e22, "tserver9");
  }
 
  public void test2() throws Exception {
    TServers tservers = new TServers();
    TabletLocatorImpl metaCache = createLocators(tservers, "tserver1", "tserver2", "foo");
   
    KeyExtent ke1 = nke("foo", "m", null);
    KeyExtent ke2 = nke("foo", null, "m");
   
    setLocation(tservers, "tserver2", MTE, ke1, null);
View Full Code Here

  }
 
  public void testBinRanges1() throws Exception {
    Text tableName = new Text("foo");
   
    TabletLocatorImpl metaCache = createLocators("foo", nke("foo", null, null), "l1");
   
    List<Range> ranges = nrl(nr(null, null));
    Map<String,Map<KeyExtent,List<Range>>> expected = createExpectedBinnings("l1", nol(nke("foo", null, null), nrl(nr(null, null)))
   
    );
View Full Code Here

  public void testBinRanges2() throws Exception {
   
    Text tableName = new Text("foo");
   
    List<Range> ranges = nrl(nr(null, null));
    TabletLocatorImpl metaCache = createLocators("foo", nke("foo", "g", null), "l1", nke("foo", null, "g"), "l2");
   
    Map<String,Map<KeyExtent,List<Range>>> expected = createExpectedBinnings("l1", nol(nke("foo", "g", null), nrl(nr(null, null))), "l2",
        nol(nke("foo", null, "g"), nrl(nr(null, null)))
   
    );
View Full Code Here

TOP

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

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.