Skip to content

Commit

Permalink
ACCUMULO-822 update to thrift 0.9.0
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/accumulo/trunk@1399806 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Eric C. Newton committed Oct 18, 2012
1 parent b13d442 commit 3dbd878
Show file tree
Hide file tree
Showing 70 changed files with 1,862 additions and 865 deletions.
Expand Up @@ -30,7 +30,7 @@ public class BatchWriterImpl implements BatchWriter {
private TabletServerBatchWriter bw;

public BatchWriterImpl(Instance instance, AuthInfo credentials, String table, BatchWriterConfig config) {
ArgumentChecker.notNull(instance, credentials, table);
ArgumentChecker.notNull(instance, credentials, table, config);
this.table = table;
this.bw = new TabletServerBatchWriter(instance, credentials, config);
}
Expand Down
Expand Up @@ -706,12 +706,12 @@ static void doLookup(String server, Map<KeyExtent,List<Range>> requested, Map<Ke
} catch (TApplicationException e) {
log.debug("Server : " + server + " msg : " + e.getMessage(), e);
throw new AccumuloServerException(server, e);
} catch (TException e) {
} catch (NoSuchScanIDException e) {
log.debug("Server : " + server + " msg : " + e.getMessage(), e);
timeoutTracker.errorOccured(e);
throw new IOException(e);
} catch (NoSuchScanIDException e) {
} catch (TException e) {
log.debug("Server : " + server + " msg : " + e.getMessage(), e);
timeoutTracker.errorOccured(e);
throw new IOException(e);
} finally {
ThriftTransportPool.getInstance().returnTransport(transport);
Expand Down
Expand Up @@ -909,10 +909,10 @@ private MutationSet sendMutationsToTabletServer(String location, Map<KeyExtent,L
} catch (ThriftSecurityException e) {
updateAuthorizationFailures(tabMuts.keySet());
throw new AccumuloSecurityException(e.user, e.code, e);
} catch (TException e) {
throw new IOException(e);
} catch (NoSuchScanIDException e) {
throw new IOException(e);
} catch (TException e) {
throw new IOException(e);
} finally {
ThriftTransportPool.getInstance().returnTransport(transport);
}
Expand Down
Expand Up @@ -149,12 +149,12 @@ static boolean getBatchFromServer(AuthInfo credentials, Range range, KeyExtent e
throw new AccumuloServerException(server, tae);
} catch (TooManyFilesException e) {
log.debug("Tablet (" + extent + ") has too many files " + server + " : " + e);
} catch (TException e) {
log.debug("Error getting transport to " + server + " : " + e);
} catch (ThriftSecurityException e) {
log.warn("Security Violation in scan request to " + server + ": " + e);
throw new AccumuloSecurityException(e.user, e.code, e);
}
} catch (TException e) {
log.debug("Error getting transport to " + server + " : " + e);
}

throw new AccumuloException("getBatchFromServer: failed");
}
Expand Down Expand Up @@ -317,24 +317,6 @@ else if (log.isTraceEnabled())
// no need to try the current scan id somewhere else
scanState.scanID = null;

if (scanState.isolated)
throw new IsolationException();

UtilWaitThread.sleep(100);
} catch (TException e) {
TabletLocator.getInstance(instance, credentials, scanState.tableName).invalidateCache(loc.tablet_location);
error = "Scan failed, thrift error " + e.getClass().getName() + " " + e.getMessage() + " " + loc;
if (!error.equals(lastError))
log.debug(error);
else if (log.isTraceEnabled())
log.trace(error);
lastError = error;
loc = null;

// do not want to continue using the same scan id, if a timeout occurred could cause a batch to be skipped
// because a thread on the server side may still be processing the timed out continue scan
scanState.scanID = null;

if (scanState.isolated)
throw new IsolationException();

Expand Down Expand Up @@ -370,6 +352,24 @@ else if (log.isTraceEnabled())
// scan session
scanState.scanID = null;

if (scanState.isolated)
throw new IsolationException();

UtilWaitThread.sleep(100);
} catch (TException e) {
TabletLocator.getInstance(instance, credentials, scanState.tableName).invalidateCache(loc.tablet_location);
error = "Scan failed, thrift error " + e.getClass().getName() + " " + e.getMessage() + " " + loc;
if (!error.equals(lastError))
log.debug(error);
else if (log.isTraceEnabled())
log.trace(error);
lastError = error;
loc = null;

// do not want to continue using the same scan id, if a timeout occurred could cause a batch to be skipped
// because a thread on the server side may still be processing the timed out continue scan
scanState.scanID = null;

if (scanState.isolated)
throw new IsolationException();

Expand Down
Expand Up @@ -95,13 +95,13 @@ public void update(Mutation m) throws AccumuloException, AccumuloSecurityExcepti
try {
updateServer(m, tabLoc.tablet_extent, tabLoc.tablet_location, credentials, instance.getConfiguration());
return;
} catch (TException e) {
log.trace("server = " + tabLoc.tablet_location, e);
TabletLocator.getInstance(instance, credentials, table).invalidateCache(tabLoc.tablet_extent);
} catch (NotServingTabletException e) {
log.trace("Not serving tablet, server = " + tabLoc.tablet_location);
TabletLocator.getInstance(instance, credentials, table).invalidateCache(tabLoc.tablet_extent);
}
} catch (TException e) {
log.trace("server = " + tabLoc.tablet_location, e);
TabletLocator.getInstance(instance, credentials, table).invalidateCache(tabLoc.tablet_extent);
}

UtilWaitThread.sleep(500);
}
Expand Down

0 comments on commit 3dbd878

Please sign in to comment.