failedReasonMap.put(dve.dataset.getUrn(), ExceptionUtils.getFullStackTrace(dve.cause)); } else { VerifiedDataset vd = ((Either.Left<VerifiedDataset, ExecutionException>) either).getLeft(); if (!vd.verifiedResult.allVerificationPassed) { if (vd.verifiedResult.shouldRetry) {
failedReasonMap.put(dve.dataset.getUrn(), ExceptionUtils.getFullStackTrace(dve.cause)); } else { VerifiedDataset vd = ((Either.Left<VerifiedDataset, ExecutionException>) either).getLeft(); if (!vd.verifiedResult.allVerificationPassed) { if (vd.verifiedResult.shouldRetry) {
Collection<Either<JobSpec, URI>> parsedCollection = parseJobSpec(message.message()); for (Either<JobSpec, URI> parsedMessage : parsedCollection) { JobSpec jobSpec = ((Either.Left<JobSpec, URI>)parsedMessage).getLeft(); if (jobSpec.getMetadata().get(JobSpec.VERB_KEY).equalsIgnoreCase(SpecExecutor.Verb.DELETE.name())) { this.removedSpecs.inc();
@Override protected void processMessage(MessageAndMetadata<byte[], byte[]> message) { try { Collection<Either<JobSpec, URI>> parsedCollection = parseJobSpec(message.message()); for (Either<JobSpec, URI> parsedMessage : parsedCollection) { if (parsedMessage instanceof Either.Left) { this.newSpecs.inc(); this.jobCatalog.put(((Either.Left<JobSpec, URI>) parsedMessage).getLeft()); } else if (parsedMessage instanceof Either.Right) { this.removedSpecs.inc(); this.jobCatalog.remove(((Either.Right<JobSpec, URI>) parsedMessage).getRight()); } } } catch (IOException ioe) { String messageStr = new String(message.message(), Charsets.UTF_8); log.error(String.format("Failed to parse kafka message with offset %d: %s.", message.offset(), messageStr), ioe); } }
private CredentialsProvider getCredentialsProvider() { return (this.providerSessionFactoryEither instanceof Either.Right)? null : ((Either.Left<CredentialsProvider, SshSessionFactory>) this.providerSessionFactoryEither).getLeft(); }
/** * Create an instance of {@link Either} with value of type {@link S}. * @param left value of this instance. * @return an instance of {@link Left}. */ public static <S, T> Either<S, T> left(S left) { return new Left<>(left); }
Collection<Either<JobSpec, URI>> parsedCollection = parseJobSpec(message.message()); for (Either<JobSpec, URI> parsedMessage : parsedCollection) { JobSpec jobSpec = ((Either.Left<JobSpec, URI>)parsedMessage).getLeft(); if (jobSpec.getMetadata().get(JobSpec.VERB_KEY).equalsIgnoreCase(SpecExecutor.Verb.DELETE.name())) { this.removedSpecs.inc();
@Override protected void processMessage(MessageAndMetadata<byte[], byte[]> message) { try { Collection<Either<JobSpec, URI>> parsedCollection = parseJobSpec(message.message()); for (Either<JobSpec, URI> parsedMessage : parsedCollection) { if (parsedMessage instanceof Either.Left) { this.newSpecs.inc(); this.jobCatalog.put(((Either.Left<JobSpec, URI>) parsedMessage).getLeft()); } else if (parsedMessage instanceof Either.Right) { this.removedSpecs.inc(); this.jobCatalog.remove(((Either.Right<JobSpec, URI>) parsedMessage).getRight()); } } } catch (IOException ioe) { String messageStr = new String(message.message(), Charsets.UTF_8); log.error(String.format("Failed to parse kafka message with offset %d: %s.", message.offset(), messageStr), ioe); } }
@Override public T call() throws Exception { this.queue.put(false); if (this.toReturn instanceof Either.Left) { return ((Either.Left<T, Exception>) this.toReturn).getLeft(); } else { throw ((Either.Right<T, Exception>) this.toReturn).getRight(); } } }
private CredentialsProvider getCredentialsProvider() { return (this.providerSessionFactoryEither instanceof Either.Right)? null : ((Either.Left<CredentialsProvider, SshSessionFactory>) this.providerSessionFactoryEither).getLeft(); }
/** * Create an instance of {@link Either} with value of type {@link S}. * @param left value of this instance. * @return an instance of {@link Left}. */ public static <S, T> Either<S, T> left(S left) { return new Left<>(left); }