private static boolean isIncremental(RefreshDecision decision) { return decision.getAccelerationSettings().getMethod() == RefreshMethod.INCREMENTAL; }
public RefreshSettings(AccelerationSettings settings) { refreshField = settings.getRefreshField(); method = settings.getMethod(); refreshPeriodMs = settings.getRefreshPeriod(); gracePeriodMs = settings.getGracePeriod(); }
AccelerationSettingsUI(AccelerationSettings settings) { this(settings.getMethod(), settings.getRefreshField(), settings.getGracePeriod(), settings.getGracePeriod()); }
@Override public RelNode visit(TableScan tableScan) { List<String> tablePath = tableScan.getTable().getQualifiedName(); final AccelerationSettings settings = reflectionSettings.getReflectionSettings(new NamespaceKey(tablePath)); isIncremental = settings.getMethod() == RefreshMethod.INCREMENTAL; return tableScan; }
.setAccelerationRefreshPeriod(settings.getRefreshPeriod()) .setAccelerationGracePeriod(settings.getGracePeriod()) .setMethod(settings.getMethod()) .setRefreshField(settings.getRefreshField()) .setAccelerationNeverExpire(settings.getNeverExpire())
private void createAndSaveRefresh(final JobDetails details, final RefreshDecision decision) { final boolean isFull = decision.getAccelerationSettings().getMethod() == RefreshMethod.FULL; final long updateId = isFull ? -1L : getUpdateId(job.getJobId(), job.getData()); final MaterializationMetrics metrics = ReflectionUtils.computeMetrics(job); final List<DataPartition> dataPartitions = ReflectionUtils.computeDataPartitions(job.getJobAttempt().getInfo()); final List<String> refreshPath = ReflectionUtils.getRefreshPath(job.getJobId(), job.getData(), accelerationBasePath); final Refresh refresh = ReflectionUtils.createRefresh(reflection.getId(), refreshPath, decision.getSeriesId(), decision.getSeriesOrdinal(), updateId, details, metrics, dataPartitions); logger.trace("Refresh created: {}", refresh); materializationStore.save(refresh); logger.debug("materialization {} was written to {}", ReflectionUtils.getId(materialization), PathUtils.constructFullPath(refreshPath)); }
decision.setLogicalPlanStrippedHash(PlanHasher.hash(strippedPlan)); if(settings.getMethod() == RefreshMethod.FULL) { logger.trace("Incremental either not set or not supported for this query."); return decision.setInitialRefresh(true) if (entry.getRefreshMethod() != settings.getMethod() || !Objects.equal(entry.getRefreshField(), settings.getRefreshField())) { logger.trace("Change in refresh method, doing an initial refresh."); return decision.setInitialRefresh(true)
entry.setRefreshMethod(decision.getAccelerationSettings().getMethod()) .setRefreshField(decision.getAccelerationSettings().getRefreshField()) .setDatasetHash(decision.getDatasetHash())
Preconditions.checkState(decision.getAccelerationSettings().getMethod() == RefreshMethod.INCREMENTAL, "non initial refresh only allowed for INCREMENTAL refreshes"); final Materialization lastDone = Preconditions.checkNotNull(