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 (updateAction.equals(SchemaAction.REINDEX)) { indexJobClass = IndexRepairJob.class; mapperClass = HadoopVertexScanMapper.class; } else if (updateAction.equals(SchemaAction.REMOVE_INDEX)) { indexJobClass = IndexRemoveJob.class; mapperClass = HadoopScanMapper.class; } else { JanusGraphIndex graphIndex = (JanusGraphIndex)index; if (graphIndex.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
if (index instanceof RelationTypeIndex) { dependentTypes = ImmutableSet.of((JanusGraphSchemaVertex) ((InternalRelationType) schemaVertex).getBaseType()); if (!updateAction.isApplicableStatus(schemaVertex.getStatus())) return null; } else if (index instanceof JanusGraphIndex) { dependentTypes = Sets.newHashSet(); if (indexType.isCompositeIndex()) { if (!updateAction.isApplicableStatus(schemaVertex.getStatus())) return null; for (PropertyKey key : ((JanusGraphIndex) index).getFieldKeys()) { keySubset = Sets.newHashSet(); MixedIndexType mixedIndexType = (MixedIndexType) indexType; Set<SchemaStatus> applicableStatus = updateAction.getApplicableStatus(); for (ParameterIndexField field : mixedIndexType.getFieldKeys()) { if (applicableStatus.contains(field.getStatus()))
protected void validateIndexStatus() { JanusGraphSchemaVertex schemaVertex = managementSystem.getSchemaVertex(index); Set<SchemaStatus> acceptableStatuses = SchemaAction.REINDEX.getApplicableStatus(); boolean isValidIndex = true; String invalidIndexHint;
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 { JanusGraphIndex graphIndex = (JanusGraphIndex)index; if (graphIndex.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