public synchronized MatTableInfo getMatTableInfo(final String tableName) { MatTableInfo info = matTables.get(tableName); if (info == null) { info = new MatTableInfo(); matTables.put(tableName, info); } return info; }
@Override public void droppedMembers(Collection<Serializable> addresses) { for (MatTableInfo info : this.matTables.values()) { synchronized (info) { if (info.getState() == MatState.LOADING && addresses.contains(info.loadingAddress)) { info.setState(MatState.FAILED_LOAD, null); } } } }
private void sendTable(String stateId, ObjectOutputStream oos, boolean writeName) throws IOException, TeiidComponentException { TempTable tempTable = this.tableStore.getTempTable(stateId); if (tempTable == null) { return; } MatTableInfo info = getMatTableInfo(stateId); if (!info.isValid()) { return; } if (writeName) { oos.writeObject(stateId); } oos.writeLong(info.updateTime); oos.writeObject(info.loadingAddress); oos.writeObject(info.state); tempTable.writeTo(oos); }
final String matTableName = RelationalPlanner.MAT_PREFIX+matViewName.toUpperCase(); MatTableInfo info = globalStore.getMatTableInfo(matTableName); if (!info.isValid()) { return CollectionTupleSource.createUpdateCountTupleSource(-1);
final String matTableName = RelationalPlanner.MAT_PREFIX+matViewName.toUpperCase(); MatTableInfo info = globalStore.getMatTableInfo(matTableName); if (!info.isValid()) { return CollectionTupleSource.createUpdateCountTupleSource(-1);
final String matTableName = RelationalPlanner.MAT_PREFIX+matViewName.toUpperCase(); MatTableInfo info = globalStore.getMatTableInfo(matTableName); if (!info.isValid()) { return CollectionTupleSource.createUpdateCountTupleSource(-1);
LogManager.logDetail(LogConstants.CTX_MATVIEWS, "processing refreshmatview for", matViewName); //$NON-NLS-1$ boolean invalidate = Boolean.TRUE.equals(((Constant)proc.getParameter(3).getExpression()).getValue()); boolean needsLoading = globalStore.getMatTableInfo(matTableName).getAndClearAsynch(); if (!needsLoading) { needsLoading = globalStore.needsLoading(matTableName, globalStore.getAddress(), true, true, invalidate);
LogManager.logDetail(LogConstants.CTX_MATVIEWS, "processing refreshmatview for", matViewName); //$NON-NLS-1$ boolean invalidate = Boolean.TRUE.equals(((Constant)proc.getParameter(3).getExpression()).getValue()); boolean needsLoading = globalStore.getMatTableInfo(matTableName).getAndClearAsynch(); if (!needsLoading) { needsLoading = globalStore.needsLoading(matTableName, globalStore.getAddress(), true, true, invalidate);
LogManager.logDetail(LogConstants.CTX_MATVIEWS, "processing refreshmatview for", matViewName); //$NON-NLS-1$ boolean invalidate = Boolean.TRUE.equals(((Constant)proc.getParameter(3).getExpression()).getValue()); boolean needsLoading = globalStore.getMatTableInfo(matTableName).getAndClearAsynch(); if (!needsLoading) { needsLoading = globalStore.needsLoading(matTableName, globalStore.getAddress(), true, true, invalidate);
} else { boolean load = false; if (!info.isUpToDate()) { boolean invalidate = shouldInvalidate(context.getVdb()); load = globalStore.needsLoading(tableName, globalStore.getAddress(), true, false, info.isValid() && invalidate); if (load) { load = globalStore.needsLoading(tableName, globalStore.getAddress(), false, false, info.isValid() && invalidate); if (!info.isUpToDate()) { RequestWorkItem workItem = context.getWorkItem(); info.addWaiter(workItem); if (moreWork != null) { moreWork.cancel(false); if (!info.isValid() || executor == null) { if (info.getVdbMetaData() != null && context.getDQPWorkContext() != null && !info.getVdbMetaData().getFullName().equals(context.getDQPWorkContext().getVDB().getFullName())) { assert executor != null; newWorkContext = createWorkContext(context, info.getVdbMetaData()); CommandContext newContext = context.clone(); newContext.setNewVDBState(newWorkContext);
} else { boolean load = false; if (!info.isUpToDate()) { boolean invalidate = shouldInvalidate(context.getVdb()); load = globalStore.needsLoading(tableName, globalStore.getAddress(), true, false, info.isValid() && invalidate); if (load) { load = globalStore.needsLoading(tableName, globalStore.getAddress(), false, false, info.isValid() && invalidate); if (!info.isUpToDate()) { RequestWorkItem workItem = context.getWorkItem(); info.addWaiter(workItem); if (moreWork != null) { moreWork.cancel(false); if (!info.isValid() || executor == null) { if (info.getVdbMetaData() != null && context.getDQPWorkContext() != null && !info.getVdbMetaData().getFullName().equals(context.getDQPWorkContext().getVDB().getFullName())) { assert executor != null; newWorkContext = createWorkContext(context, info.getVdbMetaData()); CommandContext newContext = context.clone(); newContext.setNewVDBState(newWorkContext);
} else { boolean load = false; if (!info.isUpToDate()) { boolean invalidate = shouldInvalidate(context.getVdb()); load = globalStore.needsLoading(tableName, globalStore.getAddress(), true, false, info.isValid() && invalidate); if (load) { load = globalStore.needsLoading(tableName, globalStore.getAddress(), false, false, info.isValid() && invalidate); if (!info.isUpToDate()) { RequestWorkItem workItem = context.getWorkItem(); info.addWaiter(workItem); if (moreWork != null) { moreWork.cancel(false); if (!info.isValid() || executor == null) { if (info.getVdbMetaData() != null && context.getDQPWorkContext() != null && !info.getVdbMetaData().getFullName().equals(context.getDQPWorkContext().getVDB().getFullName())) { assert executor != null; newWorkContext = createWorkContext(context, info.getVdbMetaData()); CommandContext newContext = context.clone(); newContext.setNewVDBState(newWorkContext);
valid = info.isValid(); state = info.getState().name(); updated = info.getUpdateTime()==-1?null:new Timestamp(info.getUpdateTime()); if (id != null) { cardinaltity = (int)Math.min(Integer.MAX_VALUE, id.getCardinality());
if (!firstPass) { this.loadingAddress = possibleLoadingAddress; setState(MatState.LOADING, null); || (ttl >= 0 && System.currentTimeMillis() - updateTime - ttl > 0)) { if (firstPass) { setState(MatState.NEEDS_LOADING, null); } else { this.loadingAddress = possibleLoadingAddress; setState(MatState.LOADING, null);
if (!firstPass) { this.loadingAddress = possibleLoadingAddress; setState(MatState.LOADING, null); || (ttl >= 0 && System.currentTimeMillis() - updateTime - ttl > 0)) { if (firstPass) { setState(MatState.NEEDS_LOADING, null); } else { this.loadingAddress = possibleLoadingAddress; setState(MatState.LOADING, null);
TempMetadataID id = globalStore.getGlobalTempTableMetadataId(matTableName); MatTableInfo info = globalStore.getMatTableInfo(matTableName); valid = info.isValid(); state = info.getState().name(); updated = info.getUpdateTime()==-1?null:new Timestamp(info.getUpdateTime()); if (id != null) { cardinaltity = (int)Math.min(Integer.MAX_VALUE, id.getCardinality());
TempMetadataID id = globalStore.getGlobalTempTableMetadataId(matTableName); MatTableInfo info = globalStore.getMatTableInfo(matTableName); valid = info.isValid(); state = info.getState().name(); updated = info.getUpdateTime()==-1?null:new Timestamp(info.getUpdateTime()); if (id != null) { cardinaltity = (int)Math.min(Integer.MAX_VALUE, id.getCardinality());
if (!firstPass) { this.loadingAddress = possibleLoadingAddress; setState(MatState.LOADING, null); || (ttl >= 0 && System.currentTimeMillis() - updateTime - ttl > 0)) { if (firstPass) { setState(MatState.NEEDS_LOADING, null); } else { this.loadingAddress = possibleLoadingAddress; setState(MatState.LOADING, null);
private void sendTable(String stateId, ObjectOutputStream oos, boolean writeName) throws IOException, TeiidComponentException { TempTable tempTable = this.tableStore.getTempTable(stateId); if (tempTable == null) { return; } MatTableInfo info = getMatTableInfo(stateId); if (!info.isValid()) { return; } if (writeName) { oos.writeObject(stateId); } oos.writeLong(info.updateTime); oos.writeObject(info.loadingAddress); oos.writeObject(info.state); tempTable.writeTo(oos); }
private void sendTable(String stateId, ObjectOutputStream oos, boolean writeName) throws IOException, TeiidComponentException { TempTable tempTable = this.tableStore.getTempTable(stateId); if (tempTable == null) { return; } MatTableInfo info = getMatTableInfo(stateId); if (!info.isValid()) { return; } if (writeName) { oos.writeObject(stateId); } oos.writeLong(info.updateTime); oos.writeObject(info.loadingAddress); oos.writeObject(info.state); tempTable.writeTo(oos); }