@Override public boolean isSpeculativeAttemptSafe() { if (this.writer instanceof SpeculativeAttemptAwareConstruct) { return ((SpeculativeAttemptAwareConstruct)this.writer).isSpeculativeAttemptSafe(); } return false; }
private boolean isDataWriterForPartitionSafe(DataWriter dataWriter) { return dataWriter instanceof SpeculativeAttemptAwareConstruct && ((SpeculativeAttemptAwareConstruct) dataWriter).isSpeculativeAttemptSafe(); }
public boolean isSpeculativeExecutionSafe() { if (!this.writer.isPresent()) { return true; } if (!(this.writer.get() instanceof SpeculativeAttemptAwareConstruct)) { this.logger.info("Writer is not speculative safe: " + this.writer.get().getClass().toString()); return false; } return ((SpeculativeAttemptAwareConstruct) this.writer.get()).isSpeculativeAttemptSafe(); }
/** * @return true if the current {@link Task} is safe to have duplicate attempts; false, otherwise. */ public boolean isSpeculativeExecutionSafe() { if (this.extractor instanceof SpeculativeAttemptAwareConstruct) { if (!((SpeculativeAttemptAwareConstruct) this.extractor).isSpeculativeAttemptSafe()) { return false; } } if (this.converter instanceof SpeculativeAttemptAwareConstruct) { if (!((SpeculativeAttemptAwareConstruct) this.converter).isSpeculativeAttemptSafe()) { return false; } } for (Optional<Fork> fork : this.forks.keySet()) { if (fork.isPresent() && !fork.get().isSpeculativeExecutionSafe()) { return false; } } return true; }
private boolean isDataWriterForPartitionSafe(DataWriter dataWriter) { return dataWriter instanceof SpeculativeAttemptAwareConstruct && ((SpeculativeAttemptAwareConstruct) dataWriter).isSpeculativeAttemptSafe(); }
@Override public boolean isSpeculativeAttemptSafe() { if (this.writer instanceof SpeculativeAttemptAwareConstruct) { return ((SpeculativeAttemptAwareConstruct)this.writer).isSpeculativeAttemptSafe(); } return false; }
public boolean isSpeculativeExecutionSafe() { if (!this.writer.isPresent()) { return true; } if (!(this.writer.get() instanceof SpeculativeAttemptAwareConstruct)) { this.logger.info("Writer is not speculative safe: " + this.writer.get().getClass().toString()); return false; } return ((SpeculativeAttemptAwareConstruct) this.writer.get()).isSpeculativeAttemptSafe(); }
/** * @return true if the current {@link Task} is safe to have duplicate attempts; false, otherwise. */ public boolean isSpeculativeExecutionSafe() { if (this.extractor instanceof SpeculativeAttemptAwareConstruct) { if (!((SpeculativeAttemptAwareConstruct) this.extractor).isSpeculativeAttemptSafe()) { return false; } } if (this.converter instanceof SpeculativeAttemptAwareConstruct) { if (!((SpeculativeAttemptAwareConstruct) this.converter).isSpeculativeAttemptSafe()) { return false; } } for (Optional<Fork> fork : this.forks.keySet()) { if (fork.isPresent() && !fork.get().isSpeculativeExecutionSafe()) { return false; } } return true; }