Examples of invalidateCache()


Examples of org.apache.accumulo.core.client.impl.TabletLocator.invalidateCache()

   */
  @Override
  public void clearLocatorCache(String tableName) throws TableNotFoundException {
    ArgumentChecker.notNull(tableName);
    TabletLocator tabLocator = TabletLocator.getInstance(instance, new Text(Tables.getTableId(instance, tableName)));
    tabLocator.invalidateCache();
  }
 
  /**
   * Get a mapping of table name to internal table id.
   *
 
View Full Code Here

Examples of org.apache.accumulo.core.client.impl.TabletLocator.invalidateCache()

      } else {
        Instance instance = getInstance(context);
        String tableId = null;
        tl = getTabletLocator(context);
        // its possible that the cache could contain complete, but old information about a tables tablets... so clear it
        tl.invalidateCache();
        while (!tl.binRanges(ranges, binnedRanges,
            new TCredentials(getPrincipal(context), getTokenClass(context), ByteBuffer.wrap(getToken(context)), getInstance(context).getInstanceID()))
            .isEmpty()) {
          if (!(instance instanceof MockInstance)) {
            if (tableId == null)
View Full Code Here

Examples of org.apache.accumulo.core.client.impl.TabletLocator.invalidateCache()

              throw new TableOfflineException(instance, tableId);
          }
          binnedRanges.clear();
          log.warn("Unable to locate bins for specified ranges. Retrying.");
          UtilWaitThread.sleep(100 + (int) (Math.random() * 100)); // sleep randomly between 100 and 200 ms
          tl.invalidateCache();
        }
      }
    } catch (Exception e) {
      throw new IOException(e);
    }
View Full Code Here

Examples of org.apache.accumulo.core.client.impl.TabletLocator.invalidateCache()

      else
        tl = TabletLocator.getInstance(conn.getInstance(), new Text(Tables.getTableId(conn.getInstance(), mapping.tableName)));

      Map<String,Map<KeyExtent,List<Range>>> binnedRanges = new HashMap<String,Map<KeyExtent,List<Range>>>();

      tl.invalidateCache();
      while (tl.binRanges(Collections.singletonList(createRange(query)), binnedRanges, credentials).size() > 0) {
        // TODO log?
        if (!Tables.exists(conn.getInstance(), Tables.getTableId(conn.getInstance(), mapping.tableName)))
          throw new TableDeletedException(Tables.getTableId(conn.getInstance(), mapping.tableName));
        else if (Tables.getTableState(conn.getInstance(), Tables.getTableId(conn.getInstance(), mapping.tableName)) == TableState.OFFLINE)
View Full Code Here

Examples of org.apache.accumulo.core.client.impl.TabletLocator.invalidateCache()

        if (!Tables.exists(conn.getInstance(), Tables.getTableId(conn.getInstance(), mapping.tableName)))
          throw new TableDeletedException(Tables.getTableId(conn.getInstance(), mapping.tableName));
        else if (Tables.getTableState(conn.getInstance(), Tables.getTableId(conn.getInstance(), mapping.tableName)) == TableState.OFFLINE)
          throw new TableOfflineException(conn.getInstance(), Tables.getTableId(conn.getInstance(), mapping.tableName));
        UtilWaitThread.sleep(100);
        tl.invalidateCache();
      }

      List<PartitionQuery<K,T>> ret = new ArrayList<PartitionQuery<K,T>>();

      Text startRow = null;
View Full Code Here

Examples of org.apache.accumulo.core.client.impl.TabletLocator.invalidateCache()

      } else {
        Instance instance = getInstance(job.getConfiguration());
        String tableId = null;
        tl = getTabletLocator(job.getConfiguration());
        // its possible that the cache could contain complete, but old information about a tables tablets... so clear it
        tl.invalidateCache();
        while (!tl.binRanges(ranges, binnedRanges).isEmpty()) {
          if (!(instance instanceof MockInstance)) {
            if (tableId == null)
              tableId = Tables.getTableId(instance, tableName);
            if (!Tables.exists(instance, tableId))
View Full Code Here

Examples of org.apache.accumulo.core.client.impl.TabletLocator.invalidateCache()

              throw new TableOfflineException(instance, tableId);
          }
          binnedRanges.clear();
          log.warn("Unable to locate bins for specified ranges. Retrying.");
          UtilWaitThread.sleep(100 + (int) (Math.random() * 100)); // sleep randomly between 100 and 200 ms
          tl.invalidateCache();
        }
      }
    } catch (Exception e) {
      throw new IOException(e);
    }
View Full Code Here

Examples of org.apache.accumulo.core.client.impl.TabletLocator.invalidateCache()

              opTimer = new OpTimer(log, Level.TRACE).start("Splitting tablet " + tl.tablet_extent + " on " + tl.tablet_location + " at " + split);
           
            client.splitTablet(null, credentials, tl.tablet_extent.toThrift(), TextUtil.getBytes(split));
           
            // just split it, might as well invalidate it in the cache
            tabLocator.invalidateCache(tl.tablet_extent);
           
            if (opTimer != null)
              opTimer.stop("Split tablet in %DURATION%");
          } finally {
            ThriftUtil.returnClient((TServiceClient) client);
View Full Code Here

Examples of org.apache.accumulo.core.client.impl.TabletLocator.invalidateCache()

          }
         
        } catch (TApplicationException tae) {
          throw new AccumuloServerException(tl.tablet_location, tae);
        } catch (TTransportException e) {
          tabLocator.invalidateCache(tl.tablet_location);
          continue;
        } catch (ThriftSecurityException e) {
          throw new AccumuloSecurityException(e.user, e.code, e);
        } catch (NotServingTabletException e) {
          tabLocator.invalidateCache(tl.tablet_extent);
View Full Code Here

Examples of org.apache.accumulo.core.client.impl.TabletLocator.invalidateCache()

          tabLocator.invalidateCache(tl.tablet_location);
          continue;
        } catch (ThriftSecurityException e) {
          throw new AccumuloSecurityException(e.user, e.code, e);
        } catch (NotServingTabletException e) {
          tabLocator.invalidateCache(tl.tablet_extent);
          continue;
        } catch (TException e) {
          tabLocator.invalidateCache(tl.tablet_location);
          continue;
        }
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.