public static void update(ServerContext context, Writer t, ZooLock zooLock, Mutation m) { if (zooLock != null) putLockID(context, zooLock, m); while (true) { try { t.update(m); return; } catch (AccumuloException | TableNotFoundException | AccumuloSecurityException e) { log.error("{}", e.getMessage(), e); } catch (ConstraintViolationException e) { log.error("{}", e.getMessage(), e); // retrying when a CVE occurs is probably futile and can cause problems, see ACCUMULO-3096 throw new RuntimeException(e); } sleepUninterruptibly(1, TimeUnit.SECONDS); } }
private void writeSplitsToMetadataTable(ServerContext ctx, Table.ID tableId, SortedSet<Text> splits, Map<Text,Text> data, char timeType, ZooLock lock, BatchWriter bw) throws MutationsRejectedException { Text prevSplit = null; Value dirValue; for (Text split : Iterables.concat(splits, Collections.singleton(null))) { Mutation mut = new KeyExtent(tableId, split, prevSplit).getPrevRowUpdateMutation(); dirValue = (split == null) ? new Value(tableInfo.defaultTabletDir) : new Value(data.get(split)); MetadataSchema.TabletsSection.ServerColumnFamily.DIRECTORY_COLUMN.put(mut, dirValue); MetadataSchema.TabletsSection.ServerColumnFamily.TIME_COLUMN.put(mut, new Value(timeType + "0")); MetadataTableUtil.putLockID(ctx, lock, mut); prevSplit = split; bw.addMutation(mut); } }
public static void update(Writer t, ZooLock zooLock, Mutation m) { if (zooLock != null) putLockID(zooLock, m); while (true) { try { t.update(m); return; } catch (AccumuloException e) { log.error("{}", e.getMessage(), e); } catch (AccumuloSecurityException e) { log.error("{}", e.getMessage(), e); } catch (ConstraintViolationException e) { log.error("{}", e.getMessage(), e); // retrying when a CVE occurs is probably futile and can cause problems, see ACCUMULO-3096 throw new RuntimeException(e); } catch (TableNotFoundException e) { log.error("{}", e.getMessage(), e); } sleepUninterruptibly(1, TimeUnit.SECONDS); } }