protected void writeIndexCommandHeader( WritableChannel channel ) throws IOException { writeIndexCommandHeader( channel, getValueType(), getEntityType(), needsLong( getEntityId() ), startNodeNeedsLong(), endNodeNeedsLong(), getIndexNameId(), getKeyId() ); }
private boolean visitIndexAddCommand( IndexCommand command, EntityId entityId ) { try { CommitContext context = commitContext( command ); String key = definitions.getKey( command.getKeyId() ); Object value = command.getValue(); // Below is a check for a null value where such a value is ignored. This may look strange, but the // reason is that there was this bug where adding a null value to an index would be fine and written // into the log as a command, to later fail during application of that command, i.e. here. // There was a fix introduced to throw IllegalArgumentException out to user right away if passing in // null or object that had toString() produce null. Although databases already affected by this would // not be able to recover, which is why this check is here. if ( value != null ) { context.ensureWriterInstantiated(); context.indexType.addToDocument( context.getDocument( entityId, true ).document, key, value ); } } catch ( ExplicitIndexNotFoundKernelException ignore ) { // Pretend the index never existed. } return false; }
protected void writeIndexCommandHeader( WritableChannel channel ) throws IOException { writeIndexCommandHeader( channel, getValueType(), getEntityType(), needsLong( getEntityId() ), startNodeNeedsLong(), endNodeNeedsLong(), getIndexNameId(), getKeyId() ); }