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

Examples of org.apache.accumulo.core.client.impl.TabletLocator.TabletLocation


    TreeMap<KeyExtent,TabletLocation> mcke = new TreeMap<KeyExtent,TabletLocation>();
   
    for (int i = 0; i < data.length; i += 2) {
      KeyExtent ke = (KeyExtent) data[i];
      String loc = (String) data[i + 1];
      mcke.put(ke, new TabletLocation(ke, loc));
    }
   
    return mcke;
  }
View Full Code Here


   
  }
 
  private void locateTabletTest(TabletLocatorImpl cache, String row, boolean skipRow, KeyExtent expected, String server, TCredentials credentials)
      throws Exception {
    TabletLocation tl = cache.locateTablet(new Text(row), skipRow, false, credentials);
   
    if (expected == null) {
      if (tl != null)
        System.out.println("tl = " + tl);
      assertNull(tl);
View Full Code Here

      SortedMap<Key,Value> results = tabletData.tailMap(startKey).headMap(stopKey);
     
      Pair<SortedMap<KeyExtent,Text>,List<KeyExtent>> metadata = MetadataTable.getMetadataLocationEntries(results);
     
      for (Entry<KeyExtent,Text> entry : metadata.getFirst().entrySet()) {
        list.add(new TabletLocation(entry.getKey(), entry.getValue().toString()));
      }
     
      return new TabletLocations(list, metadata.getSecond());
    }
View Full Code Here

        parent.invalidateCache(failures);
     
      SortedMap<KeyExtent,Text> metadata = MetadataTable.getMetadataLocationEntries(results).getFirst();
     
      for (Entry<KeyExtent,Text> entry : metadata.entrySet()) {
        list.add(new TabletLocation(entry.getKey(), entry.getValue().toString()));
      }
     
      return list;
     
    }
View Full Code Here

   
    ExecutorService threadPool = Executors.newFixedThreadPool(numThreads, new NamingThreadFactory("estimateSizes"));
   
    for (final Entry<Path,List<TabletLocation>> entry : assignments.entrySet()) {
      if (entry.getValue().size() == 1) {
        TabletLocation tabletLocation = entry.getValue().get(0);
       
        // if the tablet completely contains the map file, there is no
        // need to estimate its
        // size
        ais.put(entry.getKey(), Collections.singletonList(new AssignmentInfo(tabletLocation.tablet_extent, mapFileSizes.get(entry.getKey()))));
View Full Code Here

        if (!reader.hasTop()) {
          // log.debug(filename + " not found");
          break;
        }
        row = reader.getTopKey().getRow();
        TabletLocation tabletLocation = locator.locateTablet(row, false, true, credentials);
        // log.debug(filename + " found row " + row + " at location " + tabletLocation);
        result.add(tabletLocation);
        row = tabletLocation.tablet_extent.getEndRow();
        if (row != null && (endRow == null || row.compareTo(endRow) < 0)) {
          row = new Text(row);
View Full Code Here

        if (attempt > 0)
          UtilWaitThread.sleep(100);
       
        attempt++;
       
        TabletLocation tl = tabLocator.locateTablet(split, false, false, credentials);
       
        if (tl == null) {
          if (!Tables.exists(instance, tableId))
            throw new TableNotFoundException(tableId, tableName, null);
          else if (Tables.getTableState(instance, tableId) == TableState.OFFLINE)
View Full Code Here

  class MockTabletLocator extends TabletLocator {
    int invalidated = 0;
   
    @Override
    public TabletLocation locateTablet(Text row, boolean skipRow, boolean retry, TCredentials credentials) throws AccumuloException, AccumuloSecurityException, TableNotFoundException {
      return new TabletLocation(fakeMetaData.tailSet(new KeyExtent(tableId, row, null)).first(), "localhost");
    }
View Full Code Here

   
    if (m.size() == 0)
      throw new IllegalArgumentException("Can not add empty mutations");
   
    while (true) {
      TabletLocation tabLoc = TabletLocator.getLocator(instance, table).locateTablet(credentials, new Text(m.getRow()), false, true);
     
      if (tabLoc == null) {
        log.trace("No tablet location found for row " + new String(m.getRow(), Constants.UTF8));
        UtilWaitThread.sleep(500);
        continue;
View Full Code Here

        if (attempt > 0)
          UtilWaitThread.sleep(100);

        attempt++;

        TabletLocation tl = tabLocator.locateTablet(credentials, split, false, false);

        if (tl == null) {
          if (!Tables.exists(instance, tableId))
            throw new TableNotFoundException(tableId, tableName, null);
          else if (Tables.getTableState(instance, tableId) == TableState.OFFLINE)
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.client.impl.TabletLocator.TabletLocation

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.