@Override public boolean visitRelationshipTypeTokenCommand(Command.RelationshipTypeTokenCommand command) throws IOException { // id+in_use(byte)+type_blockId(int)+nr_type_records(int) int id = channel.getInt(); byte inUseFlag = channel.get(); boolean inUse = false; if ((inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue()) { inUse = true; } else if (inUseFlag != Record.NOT_IN_USE.byteValue()) { throw new IOException("Illegal in use flag: " + inUseFlag); } RelationshipTypeTokenRecord record = new RelationshipTypeTokenRecord(id); record.setInUse(inUse); record.setNameId(channel.getInt()); int nrTypeRecords = channel.getInt(); for (int i = 0; i < nrTypeRecords; i++) { DynamicRecord dr = readDynamicRecord(); if (dr == null) { return true; } record.addNameRecord(dr); } command.init(record); return false; }
@Override public boolean visitRelationshipTypeTokenCommand(Command.RelationshipTypeTokenCommand command) throws IOException { RelationshipTypeTokenRecord record = command.getRecord(); // id+in_use(byte)+type_blockId(int)+nr_type_records(int) byte inUse = record.inUse() ? Record.IN_USE.byteValue() : Record.NOT_IN_USE.byteValue(); channel.put(NeoCommandType.REL_TYPE_COMMAND); channel.putInt(record.getId()).put(inUse).putInt(record.getNameId()); writeDynamicRecords(record.getNameRecords()); return false; }