public void updateBlobTypeMetrics(Status status, HollowProducer.Blob blob) { HollowProducer.Blob.Type blobType = blob.getType(); switch (blobType) { case SNAPSHOT: if(status.getType() == Status.StatusType.SUCCESS) snapshotsCompleted++; else snapshotsFailed++; break; case DELTA: if(status.getType() == Status.StatusType.SUCCESS) deltasCompleted++; else deltasFailed++; break; case REVERSE_DELTA: if(status.getType() == Status.StatusType.SUCCESS) reverseDeltasCompleted++; else reverseDeltasFailed++; break; } }
ProducerStatus(com.netflix.hollow.api.producer.Status s, ReadState readState, long version) { this.status = Status.of(s.getType()); this.throwable = s.getCause(); this.readState = readState; this.version = version; }
PublishStatus(com.netflix.hollow.api.producer.Status s, HollowProducer.Blob blob) { this.status = Status.of(s.getType()); this.throwable = s.getCause(); this.blob = blob; }
RestoreStatus(com.netflix.hollow.api.producer.Status s, long versionDesired, long versionReached) { this.status = Status.of(s.getType()); this.throwable = s.getCause(); this.versionDesired = versionDesired; this.versionReached = versionReached; }
/** * Updates the producer metrics: * cycles completed, version and type's footprint and ordinals. * @param status the status * @param readState the read state * @param version the version */ public void updateCycleMetrics(Status status, HollowProducer.ReadState readState, long version) { cyclesCompleted++; if(status.getType() == Status.StatusType.FAIL) { cycleFailed++; return; } cyclesSucceeded++; if(readState != null) { HollowReadStateEngine hollowReadStateEngine = readState.getStateEngine(); super.update(hollowReadStateEngine, version); } else { super.update(version); } }