Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ public Map<String,String> modifyProperties(ResourceGroupId group,
"Unable to modify resource group properties for because of concurrent modification");
retry.waitForNextAttempt(log, "Modify resource group properties");
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
} finally {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ private List<KeyValue> getNextBatch() {
throw new IllegalStateException(ee);
} catch (AccumuloException | AccumuloSecurityException | TableNotFoundException
| ScanTimedOutException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(e);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ private SplitsToTablets mapSplitsToTablets(String tableName, TableId tableId,
try {
retry.waitForNextAttempt(log, "Find tablet in " + tableId + " containing " + split);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
tablet = tabLocator.findTablet(context, split, false, LocationNeed.NOT_REQUIRED);
Expand Down Expand Up @@ -2007,6 +2008,7 @@ public Locations locate(String tableName, Collection<Range> ranges)
String.format("locating tablets in table %s(%s) for %d ranges", tableName, tableId,
rangeList.size()));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException(e);
}

Expand Down
1 change: 1 addition & 0 deletions core/src/main/java/org/apache/accumulo/core/fate/Fate.java
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ public void shutdown(long timeout, TimeUnit timeUnit) {
anyFateExecutorIsAlive(), deadResCleanerIsAlive());
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ public void run() {
break;
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ public long addEntry(FateLockEntry entry) {
}
}
} catch (KeeperException | InterruptedException ex) {
if (ex instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(ex);
}
}
Expand All @@ -233,6 +236,9 @@ public long addEntry(FateLockEntry entry) {
}
}
} catch (KeeperException | InterruptedException ex) {
if (ex instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(ex);
}
return result;
Expand All @@ -252,6 +258,9 @@ public void removeEntry(FateLockEntry data, long entry) {
// the path had other lock nodes, no big deal
}
} catch (KeeperException | InterruptedException ex) {
if (ex instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(ex);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ public FateId create() {
} catch (NodeExistsException nee) {
// exist, so just try another random #
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(e);
}
}
Expand Down Expand Up @@ -184,6 +187,9 @@ private Optional<FateTxStore<T>> createAndReserve(FateKey fateKey) {
return Optional.empty();
}
} catch (InterruptedException | KeeperException | AcceptableThriftTableOperationException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(e);
}
}
Expand Down Expand Up @@ -461,6 +467,9 @@ private void _delete(Set<TStatus> requiredStatus) {
"Deletion of ZK node fate data for {} was not able to be completed atomically... Retrying",
fateId);
} catch (InterruptedException | KeeperException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(e);
}
}
Expand Down Expand Up @@ -562,6 +571,9 @@ private FateData<T> getFateData(FateId fateId) {
return new FateData<>(TStatus.UNKNOWN, null, null, createEmptyRepoDeque(),
createEmptyTxInfo());
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(e);
}
}
Expand All @@ -573,6 +585,9 @@ private FateData<T> getFateData(FateId fateId, Stat stat) {
return new FateData<>(TStatus.UNKNOWN, null, null, createEmptyRepoDeque(),
createEmptyTxInfo());
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(e);
}
}
Expand Down Expand Up @@ -616,6 +631,9 @@ public Optional<Fate.FateOperation> getFateOperation() {
}
return stream.filter(s -> statuses.contains(s.getStatus()));
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(e);
}
}
Expand Down Expand Up @@ -667,6 +685,9 @@ private byte[] mutate(FateId fateId, UnaryOperator<FateData<T>> fateDataOp)
}
});
} catch (InterruptedException | AcceptableThriftTableOperationException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ public ServiceLock(ZooSession zookeeper, ServiceLockPath path, UUID uuid) {
watchingBasePath = true;
this.vmLockPrefix = new Prefix(ZLOCK_PREFIX + uuid.toString() + "#");
} catch (KeeperException | InterruptedException ex) {
if (ex instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
LOG.error("Error setting initial watch", ex);
throw new IllegalStateException(ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,9 @@ private Set<ServiceLockPath> get(final String serverType,
try {
future.get();
} catch (InterruptedException | ExecutionException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ public static RootTabletMetadata read(ClientContext ctx) {
byte[] bytes = zooReader.getData(RootTable.ZROOT_TABLET);
return new RootTabletMetadata(new String(bytes, UTF_8));
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,9 @@ synchronized boolean setupWatchers() {
zkClientTracker.get());
return true;
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new RuntimeException("Error setting up persistent recursive watcher", e);
}

Expand Down Expand Up @@ -316,13 +319,17 @@ public T retry() {
log.warn("Zookeeper error, will retry", e);
}
} catch (InterruptedException | ZcInterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
log.info("Zookeeper error, will retry", e);
}

try {
// do not hold lock while sleeping
Thread.sleep(sleepTime);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.debug("Wait in retry() was interrupted.", e);
}
if (sleepTime < 10_000) {
Expand Down Expand Up @@ -389,6 +396,7 @@ public List<String> run() throws KeeperException, InterruptedException {
} catch (KeeperException e) {
throw new ZcException(e);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ZcInterruptedException(e);
}
});
Expand Down Expand Up @@ -454,6 +462,7 @@ public byte[] run() throws KeeperException, InterruptedException {
log.trace("{} zookeeper did not contain {}", cacheId, zPath);
return ZcNode.NON_EXISTENT;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new ZcInterruptedException(e);
}
if (log.isTraceEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1960,6 +1960,7 @@ public void testMultithreadedLookups() throws Exception {
}
}
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
} finally {
activeLookups.decrementAndGet();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ protected Stream<KeyExtent> lookupExtents(Text row) {
try {
Thread.sleep(3);
} catch (InterruptedException ex) {
// ignore exception
Thread.currentThread().interrupt();
}
return extents.subList(index, extents.size()).stream().limit(73);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public void testConcurrency() throws Exception {
// If only one thread executes per key, then set1 and set2 should always be true
return set1 && set2;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new IllegalStateException(e);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ public static InputSplit[] getSplits(JobConf job, Class<?> callingClass) throws
String.format("locating tablets in table %s(%s) for %d ranges", tableName,
tableId, ranges.size()));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
unhostedRanges.get("").clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ public static List<InputSplit> getSplits(JobContext context, Class<?> callingCla
String.format("locating tablets in table %s(%s) for %d ranges", tableName,
tableId, ranges.size()));
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
throw new RuntimeException(e);
}
unhostedRanges.get("").clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ public synchronized void start(ServerType server, Map<String,String> configOverr
ResourceGroupPropKey.of(ResourceGroupId.of(rg))
.createZNode(cluster.getServerContext().getZooSession().asReaderWriter());
} catch (KeeperException | InterruptedException e1) {
if (e1 instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(
"Unable to create resource group configuration node for " + rg);
}
Expand Down Expand Up @@ -215,6 +218,9 @@ public synchronized void start(ServerType server, Map<String,String> configOverr
ResourceGroupPropKey.of(ResourceGroupId.of(rg))
.createZNode(cluster.getServerContext().getZooSession().asReaderWriter());
} catch (KeeperException | InterruptedException e1) {
if (e1 instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(
"Unable to create resource group configuration node for " + rg);
}
Expand Down Expand Up @@ -242,6 +248,9 @@ public synchronized void start(ServerType server, Map<String,String> configOverr
ResourceGroupPropKey.of(ResourceGroupId.of(rg))
.createZNode(cluster.getServerContext().getZooSession().asReaderWriter());
} catch (KeeperException | InterruptedException e1) {
if (e1 instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException(
"Unable to create resource group configuration node for " + rg);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,9 @@ public void failedToAcquireLock(Exception e) {
zrw.putPersistentData(miniZDirPath, new byte[0], NodeExistsPolicy.SKIP);
zrw.putPersistentData(miniZInstancePath, new byte[0], NodeExistsPolicy.SKIP);
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException("Error creating path in ZooKeeper", e);
}
ServiceLockData sld =
Expand Down Expand Up @@ -1000,6 +1003,9 @@ public synchronized void stop() throws IOException, InterruptedException {
try {
miniLock.unlock();
} catch (InterruptedException | KeeperException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
log.error("Error unlocking ServiceLock for MiniAccumuloClusterImpl", e);
}
miniLock = null;
Expand Down Expand Up @@ -1151,6 +1157,9 @@ public void stopProcessesWithTimeout(final ServerType type, final List<Process>
try {
f.get();
} catch (ExecutionException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
log.warn("{} did not fully stop after {} seconds", type, unit.toSeconds(timeout), e);
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ private static boolean addResourceGroups(InitialConfiguration initConfig,
ResourceGroupPropKey.of(rgid).createZNode(zrw);
log.info("Added resource group {}", trimmed);
} catch (IllegalStateException | KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
log.error("Error creating resource group: " + trimmed, e);
return false;
}
Expand Down Expand Up @@ -489,6 +492,9 @@ private static boolean removeResourceGroups(InitialConfiguration initConfig,
ResourceGroupPropKey.of(rgid).removeZNode(zs);
log.info("Removed resource group {}", trimmed);
} catch (IllegalStateException | KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
log.error("Error removing resource group: " + trimmed, e);
return false;
}
Expand Down Expand Up @@ -625,6 +631,7 @@ public void execute(final String[] args) {
log.error("Problem trying to get Volume configuration", e);
success = false;
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.error("Thread was interrupted when trying to get Volume configuration", e);
success = false;
} catch (KeeperException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@ public void initScanRefTableState(ServerContext context) {
Namespace.ACCUMULO.id(), SystemTables.SCAN_REF.tableName(), TableState.ONLINE,
ZooUtil.NodeExistsPolicy.FAIL);
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new RuntimeException(e);
}
}
Expand All @@ -231,6 +234,9 @@ public void initFateTableState(ServerContext context) {
Namespace.ACCUMULO.id(), SystemTables.FATE.tableName(), TableState.ONLINE,
ZooUtil.NodeExistsPolicy.FAIL);
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new RuntimeException(e);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ public static void storeLocations(ZooReaderWriter zoo,
zoo.putPersistentData(Constants.ZMANAGER_FATE_ASSIGNMENTS, serialize(assignments),
nodeExistsPolicy);
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException("Unable to set fate locations in zookeeper", e);
}
}
Expand All @@ -100,6 +103,9 @@ public static void storeLocations(ServerContext context,
context.getZooSession().setData(Constants.ZMANAGER_FATE_ASSIGNMENTS, serialize(assignments),
-1);
} catch (KeeperException | InterruptedException e) {
if (e instanceof InterruptedException) {
Thread.currentThread().interrupt();
}
throw new IllegalStateException("Unable to set fate locations in zookeeper", e);
}
}
Expand Down
Loading