@Override public boolean equals(Object obj) { if (obj instanceof TServerInstance) { return compareTo((TServerInstance) obj) == 0; } return false; }
@Override public boolean equals(Object o) { if (o instanceof TserverGroupInfo) { TserverGroupInfo otgi = (TserverGroupInfo) o; return tsi.equals(otgi.tsi); } return false; }
@Override public void unassign(Collection<TabletLocationState> tablets, Map<TServerInstance,List<Path>> logsForDeadServers) throws DistributedStoreException { suspend(tablets, logsForDeadServers, -1); }
protected static TabletStateStore getStoreForTablet(KeyExtent extent, ServerContext context) { if (extent.isRootTablet()) { return new ZooTabletStateStore(context); } else if (extent.isMeta()) { return new RootTabletStateStore(context); } else { return new MetaDataStateStore(context); } } }
public TServerInstance(HostAndPort address, String session) { this.location = address; this.session = session; this.cachedStringRepresentation = hostPort() + "[" + session + "]"; }
@Override public byte[] get(String path) throws DistributedStoreException { try { return cache.get(relative(path)); } catch (Exception ex) { throw new DistributedStoreException(ex); } }
@Override protected void finalize() { close(); }
@Override public String toString() { if (!state.equals(MergeState.NONE)) return "Merge " + operation + " of " + extent + " State: " + state; return "No Merge in progress"; } }
public ZooTabletStateStore(ServerContext context) { store = new ZooStore(context); }
public int suspended() { return counts[TabletState.SUSPENDED.ordinal()]; } }
@Override public TabletLocationState next() { return fetch(); }
@Override public void suspend(Collection<TabletLocationState> tablets, Map<TServerInstance,List<Path>> logsForDeadServers, long suspensionTimestamp) throws DistributedStoreException { // No support for suspending root tablet. unassign(tablets, logsForDeadServers); }
@Override public int hashCode() { return tsi.hashCode(); }
@Override public boolean equals(Object o) { if (o instanceof Location) { Location ol = ((Location) o); if (tserverInstance == ol.tserverInstance) { return true; } return tserverInstance.equals(ol.tserverInstance); } return false; } }
@Override public List<String> getChildren(String path) throws DistributedStoreException { try { return cache.getChildren(relative(path)); } catch (Exception ex) { throw new DistributedStoreException(ex); } }
public int unassigned() { return counts[TabletState.UNASSIGNED.ordinal()]; }
@Override public int compareTo(ServerCounts obj) { int result = count - obj.count; if (result == 0) return server.compareTo(obj.server); return result; } }
public int hosted() { return counts[TabletState.HOSTED.ordinal()]; }