protected String get(Commit<String> commit) { return map.get(commit.value()); }
protected String get(Commit<String> commit) { return map.get(commit.value()); }
protected long remove(Commit<String> commit) { map.remove(commit.value()); return commit.index(); }
protected long remove(Commit<String> commit) { map.remove(commit.value()); return commit.index(); }
@Override public boolean equals(Object object) { if (object instanceof Commit) { Commit commit = (Commit) object; return commit.index() == index && commit.session().equals(session) && commit.operation().equals(operation) && Objects.equals(commit.value(), value); } return false; }
/** * Applies an {@link PrimaryElectorOperations.GetTerm} commit. * * @param commit GetLeadership commit * @return leader */ protected PrimaryTerm getTerm(Commit<? extends PrimaryElectorOperations.GetTerm> commit) { PartitionId partitionId = commit.value().partitionId(); try { return term(partitionId); } catch (Exception e) { getLogger().error("State machine operation failed", e); throw Throwables.propagate(e); } }
executor.register(operationId, args -> { try { method.invoke(this, (Object[]) args.value()); } catch (IllegalAccessException | InvocationTargetException e) { throw new PrimitiveException.ServiceException(e); executor.register(operationId, args -> { try { return method.invoke(this, (Object[]) args.value()); } catch (IllegalAccessException | InvocationTargetException e) { throw new PrimitiveException.ServiceException(e);