if (updateAction.equals(SchemaAction.REINDEX)) { indexJobClass = IndexRepairJob.class; mapperClass = HadoopVertexScanMapper.class; } else if (updateAction.equals(SchemaAction.REMOVE_INDEX)) { indexJobClass = IndexRemoveJob.class; mapperClass = HadoopScanMapper.class; } else { TitanGraphIndex gindex = (TitanGraphIndex)index; if (gindex.isMixedIndex() && !updateAction.equals(SchemaAction.REINDEX)) throw new UnsupportedOperationException("External mixed indexes must be removed in the indexing system directly."); if (updateAction.equals(SchemaAction.REMOVE_INDEX)) readCF = Backend.INDEXSTORE_NAME; else
public boolean isApplicableStatus(SchemaStatus status) { if (getFailureStatus().contains(status)) throw new IllegalArgumentException(String.format("Update action [%s] cannot be invoked for index with status [%s]",this,status)); return getApplicableStatus().contains(status); }
if (index instanceof RelationTypeIndex) { dependentTypes = ImmutableSet.of((TitanSchemaVertex) ((InternalRelationType) schemaVertex).getBaseType()); if (!updateAction.isApplicableStatus(schemaVertex.getStatus())) return null; } else if (index instanceof TitanGraphIndex) { dependentTypes = Sets.newHashSet(); if (indexType.isCompositeIndex()) { if (!updateAction.isApplicableStatus(schemaVertex.getStatus())) return null; for (PropertyKey key : ((TitanGraphIndex) index).getFieldKeys()) { keySubset = Sets.newHashSet(); MixedIndexType cindexType = (MixedIndexType) indexType; Set<SchemaStatus> applicableStatus = updateAction.getApplicableStatus(); for (ParameterIndexField field : cindexType.getFieldKeys()) { if (applicableStatus.contains(field.getStatus()))
protected void validateIndexStatus() { TitanSchemaVertex schemaVertex = mgmt.getSchemaVertex(index); Set<SchemaStatus> acceptableStatuses = SchemaAction.REINDEX.getApplicableStatus(); boolean isValidIndex = true; String invalidIndexHint;
if (index instanceof RelationTypeIndex) { dependentTypes = ImmutableSet.of((TitanSchemaVertex) ((InternalRelationType) schemaVertex).getBaseType()); if (!updateAction.isApplicableStatus(schemaVertex.getStatus())) return null; } else if (index instanceof TitanGraphIndex) { dependentTypes = Sets.newHashSet(); if (indexType.isCompositeIndex()) { if (!updateAction.isApplicableStatus(schemaVertex.getStatus())) return null; for (PropertyKey key : ((TitanGraphIndex) index).getFieldKeys()) { keySubset = Sets.newHashSet(); MixedIndexType cindexType = (MixedIndexType) indexType; Set<SchemaStatus> applicableStatus = updateAction.getApplicableStatus(); for (ParameterIndexField field : cindexType.getFieldKeys()) { if (applicableStatus.contains(field.getStatus()))
protected void validateIndexStatus() { TitanSchemaVertex schemaVertex = mgmt.getSchemaVertex(index); Set<SchemaStatus> acceptableStatuses = SchemaAction.REINDEX.getApplicableStatus(); boolean isValidIndex = true; String invalidIndexHint;
public boolean isApplicableStatus(SchemaStatus status) { if (getFailureStatus().contains(status)) throw new IllegalArgumentException(String.format("Update action [%s] cannot be invoked for index with status [%s]",this,status)); return getApplicableStatus().contains(status); }
if (index instanceof RelationTypeIndex) { dependentTypes = ImmutableSet.of((TitanSchemaVertex)((InternalRelationType)schemaVertex).getBaseType()); Preconditions.checkArgument(updateAction.getApplicableStatus().contains(schemaVertex.getStatus()), "Update action [%s] does not apply for index with status [%s]",updateAction,schemaVertex.getStatus()); } else if (index instanceof TitanGraphIndex) { dependentTypes = Sets.newHashSet(); if (indexType.isCompositeIndex()) { Preconditions.checkArgument(updateAction.getApplicableStatus().contains(schemaVertex.getStatus()), "Update action [%s] does not apply for index with status [%s]",updateAction,schemaVertex.getStatus()); for (PropertyKey key : ((TitanGraphIndex)index).getFieldKeys()) { keySubset = Sets.newHashSet(); MixedIndexType cindexType = (MixedIndexType)indexType; Set<SchemaStatus> applicableStatus = updateAction.getApplicableStatus(); for (ParameterIndexField field : cindexType.getFieldKeys()) { if (applicableStatus.contains(field.getStatus())) keySubset.add((PropertyKeyVertex)field.getFieldKey());
if (updateAction.equals(SchemaAction.REINDEX)) { indexJobClass = IndexRepairJob.class; mapperClass = HadoopVertexScanMapper.class; } else if (updateAction.equals(SchemaAction.REMOVE_INDEX)) { indexJobClass = IndexRemoveJob.class; mapperClass = HadoopScanMapper.class; } else { TitanGraphIndex gindex = (TitanGraphIndex)index; if (gindex.isMixedIndex() && !updateAction.equals(SchemaAction.REINDEX)) throw new UnsupportedOperationException("External mixed indexes must be removed in the indexing system directly."); if (updateAction.equals(SchemaAction.REMOVE_INDEX)) readCF = Backend.INDEXSTORE_NAME; else