//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void serialize(org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public override void Serialize(WritableChannel channel) { channel.Put(NeoCommandType_Fields.RelGroupCommand); channel.PutLong(AfterConflict.Id); WriteRelationshipGroupRecord(channel, BeforeConflict); WriteRelationshipGroupRecord(channel, AfterConflict); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void marshal(GlobalSessionTrackerState target, org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException //JAVA TO C# CONVERTER NOTE: Members cannot have the same name as their enclosing type: public override void MarshalConflict(GlobalSessionTrackerState target, WritableChannel channel) { //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.Map<org.neo4j.causalclustering.identity.MemberId, LocalSessionTracker> sessionTrackers = target.sessionTrackers; IDictionary <MemberId, LocalSessionTracker> sessionTrackers = target.sessionTrackers; channel.PutLong(target._logIndex); channel.PutInt(sessionTrackers.Count); foreach (KeyValuePair <MemberId, LocalSessionTracker> entry in sessionTrackers.SetOfKeyValuePairs()) { MemberMarshal.marshal(entry.Key, channel); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final LocalSessionTracker localSessionTracker = entry.getValue(); LocalSessionTracker localSessionTracker = entry.Value; //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.UUID uuid = localSessionTracker.globalSessionId; System.Guid uuid = localSessionTracker.GlobalSessionId; channel.PutLong(uuid.MostSignificantBits); channel.PutLong(uuid.LeastSignificantBits); //JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final': //ORIGINAL LINE: final java.util.Map<long, long> map = localSessionTracker.lastSequenceNumberPerSession; IDictionary <long, long> map = localSessionTracker.LastSequenceNumberPerSession; channel.PutInt(map.Count); foreach (KeyValuePair <long, long> sessionSequence in map.SetOfKeyValuePairs()) { channel.PutLong(sessionSequence.Key); channel.PutLong(sessionSequence.Value); } } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void serialize(org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public override void Serialize(WritableChannel channel) { channel.Put(NeoCommandType_Fields.SchemaRuleCommand); WriteDynamicRecords(channel, RecordsBeforeConflict, RecordsBeforeConflict.size()); WriteDynamicRecords(channel, RecordsAfterConflict, RecordsAfterConflict.size()); channel.Put(Iterables.first(RecordsAfterConflict).Created ? ( sbyte )1 : 0); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void writePropertyRecord(org.neo4j.storageengine.api.WritableChannel channel, org.neo4j.kernel.impl.store.record.PropertyRecord record) throws java.io.IOException internal virtual void WritePropertyRecord(WritableChannel channel, PropertyRecord record) { sbyte flags = bitFlags(bitFlag(record.InUse(), Record.IN_USE.byteValue()), bitFlag(record.RelId != -1, Record.REL_PROPERTY.byteValue()), bitFlag(record.RequiresSecondaryUnit(), Record.REQUIRE_SECONDARY_UNIT), bitFlag(record.HasSecondaryUnitId(), Record.HAS_SECONDARY_UNIT), bitFlag(record.UseFixedReferences, Record.USES_FIXED_REFERENCE_FORMAT)); channel.Put(flags); // 1 channel.PutLong(record.NextProp).putLong(record.PrevProp); // 8 + 8 long nodeId = record.NodeId; long relId = record.RelId; if (nodeId != -1) { channel.PutLong(nodeId); // 8 or } else if (relId != -1) { channel.PutLong(relId); // 8 or } else { // means this records value has not changed, only place in // prop chain channel.PutLong(-1); // 8 } if (record.HasSecondaryUnitId()) { channel.PutLong(record.SecondaryUnitId); } channel.Put(( sbyte )record.NumberOfProperties()); // 1 foreach (PropertyBlock block in record) { Debug.Assert(block.Size > 0, record + " seems kinda broken"); WritePropertyBlock(channel, block); } outerInstance.writeDynamicRecords(channel, record.DeletedRecords); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void serialize(org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public override void Serialize(WritableChannel channel) { channel.Put(Org.Neo4j.Kernel.impl.transaction.command.NeoCommandType_Fields.IndexAddRelationshipCommand); WriteToFile(channel); PutIntOrLong(channel, StartNode); PutIntOrLong(channel, EndNode); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void serialize(org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public override void Serialize(WritableChannel channel) { channel.Put(NeoCommandType_Fields.PropIndexCommand); channel.PutInt(after.IntId); WritePropertyKeyTokenRecord(channel, before); WritePropertyKeyTokenRecord(channel, after); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void serialize(org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public override void Serialize(WritableChannel channel) { channel.Put(NeoCommandType_Fields.RelTypeCommand); channel.PutInt(after.IntId); WriteRelationshipTypeTokenRecord(channel, before); WriteRelationshipTypeTokenRecord(channel, after); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: protected static void writeIndexCommandHeader(org.neo4j.storageengine.api.WritableChannel channel, byte valueType, byte entityType, byte entityIdNeedsLong, byte startNodeNeedsLong, byte endNodeNeedsLong, int indexNameId, int keyId) throws java.io.IOException protected internal static void WriteIndexCommandHeader(WritableChannel channel, sbyte valueType, sbyte entityType, sbyte entityIdNeedsLong, sbyte startNodeNeedsLong, sbyte endNodeNeedsLong, int indexNameId, int keyId) { channel.Put(( sbyte )((valueType << 2) | (entityType << 1) | entityIdNeedsLong)); channel.Put(( sbyte )((startNodeNeedsLong << 7) | (endNodeNeedsLong << 6))); channel.PutShort(( short )indexNameId); channel.PutShort(( short )keyId); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void serialize(org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public override void Serialize(WritableChannel channel) { channel.Put(NeoCommandType_Fields.LabelKeyCommand); channel.PutInt(after.IntId); WriteLabelTokenRecord(channel, before); WriteLabelTokenRecord(channel, after); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void serialize(org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public override void Serialize(WritableChannel channel) { channel.Put(NeoCommandType_Fields.PropCommand); channel.PutLong(AfterConflict.Id); WritePropertyRecord(channel, BeforeConflict); WritePropertyRecord(channel, AfterConflict); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void writePropertyBlock(org.neo4j.storageengine.api.WritableChannel channel, org.neo4j.kernel.impl.store.record.PropertyBlock block) throws java.io.IOException internal virtual void WritePropertyBlock(WritableChannel channel, PropertyBlock block) { sbyte blockSize = ( sbyte )block.Size; Debug.Assert(blockSize > 0, blockSize + " is not a valid block size value"); channel.Put(blockSize); // 1 long[] propBlockValues = block.ValueBlocks; foreach (long propBlockValue in propBlockValues) { channel.PutLong(propBlockValue); } /* * For each block we need to keep its dynamic record chain if * it is just created. Deleted dynamic records are in the property * record and dynamic records are never modified. Also, they are * assigned as a whole, so just checking the first should be enough. */ if (block.Light) { /* * This has to be int. If this record is not light * then we have the number of DynamicRecords that follow, * which is an int. We do not currently want/have a flag bit so * we simplify by putting an int here always */ channel.PutInt(0); // 4 or } else { outerInstance.writeDynamicRecords(channel, block.ValueRecords); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: void writeDynamicRecords(org.neo4j.storageengine.api.WritableChannel channel, Iterable<org.neo4j.kernel.impl.store.record.DynamicRecord> records, int size) throws java.io.IOException internal virtual void WriteDynamicRecords(WritableChannel channel, IEnumerable <DynamicRecord> records, int size) { channel.PutInt(size); // 4 foreach (DynamicRecord record in records) { WriteDynamicRecord(channel, record); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void writeLabelTokenRecord(org.neo4j.storageengine.api.WritableChannel channel, org.neo4j.kernel.impl.store.record.LabelTokenRecord record) throws java.io.IOException internal virtual void WriteLabelTokenRecord(WritableChannel channel, LabelTokenRecord record) { // id+in_use(byte)+type_blockId(int)+nr_type_records(int) sbyte inUse = record.InUse() ? Record.IN_USE.byteValue() : Record.NOT_IN_USE.byteValue(); channel.Put(inUse).putInt(record.NameId); outerInstance.writeDynamicRecords(channel, record.NameRecords); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public static void marshal(ReplicatedTokenRequest content, org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public static void Marshal(ReplicatedTokenRequest content, WritableChannel channel) { channel.PutInt(content.Type().ordinal()); StringMarshal.marshal(channel, content.TokenName()); channel.PutInt(content.CommandBytes().Length); channel.Put(content.CommandBytes(), content.CommandBytes().Length); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private static void marshalFiles(org.neo4j.storageengine.api.WritableChannel buffer, java.io.File[] files) throws java.io.IOException internal static void MarshalFiles(WritableChannel buffer, File[] files) { buffer.PutInt(Files.Length); foreach (File file in files) { PutBytes(buffer, file.Name); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: protected void writeToFile(org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException protected internal virtual void WriteToFile(WritableChannel channel) { /* c: commandType * e: entityType * n: indexNameId * k: keyId * i: entityId * v: value type * u: value * x: 0=entityId needs 4b, 1=entityId needs 8b * y: 0=startNode needs 4b, 1=startNode needs 8b * z: 0=endNode needs 4b, 1=endNode needs 8b * * [cccv,vvex][yznn,nnnn][kkkk,kkkk] * [iiii,iiii] x 4 or 8 * (either string value) * [llll,llll][llll,llll][llll,llll][string chars...] * (numeric value) * [uuuu,uuuu] x 2-8 (depending on value type) */ WriteIndexCommandHeader(channel); PutIntOrLong(channel, EntityId); // Value object value = Value; switch (ValueType) { case IndexCommand.ValueTypeString: write3bLengthAndString(channel, value.ToString()); break; case IndexCommand.ValueTypeShort: channel.PutShort((( Number )value).shortValue()); break; case IndexCommand.ValueTypeInt: channel.PutInt((( Number )value).intValue()); break; case IndexCommand.ValueTypeLong: channel.PutLong((( Number )value).longValue()); break; case IndexCommand.ValueTypeFloat: channel.PutFloat((( Number )value).floatValue()); break; case IndexCommand.ValueTypeDouble: channel.PutDouble((( Number )value).doubleValue()); break; case IndexCommand.ValueTypeNull: break; default: throw new Exception("Unknown value type " + ValueType); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public static void write3bLengthAndString(org.neo4j.storageengine.api.WritableChannel channel, String string) throws java.io.IOException public static void Write3bLengthAndString(WritableChannel channel, string @string) { sbyte[] chars = UTF8.encode(@string); // 3 bytes to represent the length (4 is a bit overkill)... maybe // this space optimization is a bit overkill also :) channel.PutShort(( short )chars.Length); channel.Put(( sbyte )(chars.Length >> 16)); channel.Put(chars, chars.Length); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void marshal(GetStoreFileRequest getStoreFileRequest, org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public override void Marshal(GetStoreFileRequest getStoreFileRequest, WritableChannel channel) { StoreIdMarshal.INSTANCE.marshal(getStoreFileRequest.ExpectedStoreId(), channel); channel.PutLong(getStoreFileRequest.RequiredTransactionId()); string name = getStoreFileRequest.File().Name; channel.PutInt(name.Length); channel.Put(UTF8.encode(name), name.Length); }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: protected void putIntOrLong(org.neo4j.storageengine.api.WritableChannel channel, long id) throws java.io.IOException protected internal virtual void PutIntOrLong(WritableChannel channel, long id) { if (NeedsLong(id) == 1) { channel.PutLong(id); } else { channel.PutInt(( int )id); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void serialize(org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public override void Serialize(WritableChannel channel) { channel.Put(Org.Neo4j.Kernel.impl.transaction.command.NeoCommandType_Fields.IndexCreateCommand); WriteIndexCommandHeader(channel); channel.PutShort(( short )Config.Count); foreach (KeyValuePair <string, string> entry in Config.SetOfKeyValuePairs()) { write2bLengthAndString(channel, entry.Key); write2bLengthAndString(channel, entry.Value); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void marshalIndexIds(org.neo4j.storageengine.api.WritableChannel buffer, org.eclipse.collections.api.set.primitive.LongSet indexIds) throws java.io.IOException internal virtual void MarshalIndexIds(WritableChannel buffer, LongSet indexIds) { buffer.PutInt(indexIds.size()); LongIterator itr = indexIds.longIterator(); while (itr.hasNext()) { long indexId = itr.next(); buffer.PutLong(indexId); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void marshal(org.neo4j.causalclustering.core.replication.ReplicatedContent content, org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public override void marshal(ReplicatedContent content, WritableChannel channel) { if (content is ReplicatedInteger) { channel.Put(( sbyte )1); channel.PutInt((( ReplicatedInteger )content).get()); } else { throw new System.ArgumentException("Unknown content type " + content.GetType()); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void marshal(CoreSnapshot coreSnapshot, org.neo4j.storageengine.api.WritableChannel buffer) throws java.io.IOException //JAVA TO C# CONVERTER NOTE: Members cannot have the same name as their enclosing type: public override void MarshalConflict(CoreSnapshot coreSnapshot, WritableChannel buffer) { buffer.PutLong(coreSnapshot._prevIndex); buffer.PutLong(coreSnapshot._prevTerm); buffer.PutInt(coreSnapshot.Size()); foreach (CoreStateType type in coreSnapshot.Types()) { buffer.PutInt(type.ordinal()); type.marshal.marshal(coreSnapshot.Get(type), buffer); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public static void marshal(MemberIdSet memberSet, org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public static void Marshal(MemberIdSet memberSet, WritableChannel channel) { ISet <MemberId> members = memberSet.Members; channel.PutInt(members.Count); MemberId.Marshal memberIdMarshal = new MemberId.Marshal(); foreach (MemberId member in members) { memberIdMarshal.MarshalConflict(member, channel); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void marshal(MemberId memberId, org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException //JAVA TO C# CONVERTER NOTE: Members cannot have the same name as their enclosing type: public override void MarshalConflict(MemberId memberId, WritableChannel channel) { if (memberId == null) { channel.Put(( sbyte )0); } else { channel.Put(( sbyte )1); channel.PutLong(memberId._uuid.MostSignificantBits); channel.PutLong(memberId._uuid.LeastSignificantBits); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: void write(org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException internal virtual void Write(WritableChannel channel) { NextJob.accept(channel); //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: if (Commands.hasNext()) { //JAVA TO C# CONVERTER TODO TASK: Java iterators are only converted within the context of 'while' and 'for' loops: StorageCommand storageCommand = Commands.next(); NextJob = c => (new StorageCommandSerializer(c)).visit(storageCommand); } else { NextJob = null; } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void writeRelationshipGroupRecord(org.neo4j.storageengine.api.WritableChannel channel, org.neo4j.kernel.impl.store.record.RelationshipGroupRecord record) throws java.io.IOException internal virtual void WriteRelationshipGroupRecord(WritableChannel channel, RelationshipGroupRecord record) { sbyte flags = bitFlags(bitFlag(record.InUse(), Record.IN_USE.byteValue()), bitFlag(record.RequiresSecondaryUnit(), Record.REQUIRE_SECONDARY_UNIT), bitFlag(record.HasSecondaryUnitId(), Record.HAS_SECONDARY_UNIT), bitFlag(record.UseFixedReferences, Record.USES_FIXED_REFERENCE_FORMAT)); channel.Put(flags); channel.PutShort(( short )record.Type); channel.PutLong(record.Next); channel.PutLong(record.FirstOut); channel.PutLong(record.FirstIn); channel.PutLong(record.FirstLoop); channel.PutLong(record.OwningNode); if (record.HasSecondaryUnitId()) { channel.PutLong(record.SecondaryUnitId); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: public void serialize(org.neo4j.storageengine.api.WritableChannel channel) throws java.io.IOException public override void Serialize(WritableChannel channel) { channel.Put(Org.Neo4j.Kernel.impl.transaction.command.NeoCommandType_Fields.IndexDefineCommand); sbyte zero = 0; IndexCommand.WriteIndexCommandHeader(channel, zero, zero, zero, zero, zero, zero, zero); try { WriteMap(channel, _indexNameIdRange); WriteMap(channel, _keyIdRange); } catch (UncheckedIOException e) { throw new IOException(e); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void writeRelationshipTypeTokenRecord(org.neo4j.storageengine.api.WritableChannel channel, org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord record) throws java.io.IOException internal virtual void WriteRelationshipTypeTokenRecord(WritableChannel channel, RelationshipTypeTokenRecord record) { // id+in_use(byte)+count(int)+key_blockId(int)+nr_key_records(int) sbyte inUse = record.InUse() ? Record.IN_USE.byteValue() : Record.NOT_IN_USE.byteValue(); channel.Put(inUse); channel.PutInt(record.NameId); if (record.Light) { channel.PutInt(0); } else { outerInstance.writeDynamicRecords(channel, record.NameRecords); } }
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#: //ORIGINAL LINE: private void writeRelationshipRecord(org.neo4j.storageengine.api.WritableChannel channel, org.neo4j.kernel.impl.store.record.RelationshipRecord record) throws java.io.IOException internal virtual void WriteRelationshipRecord(WritableChannel channel, RelationshipRecord record) { sbyte flags = bitFlags(bitFlag(record.InUse(), Record.IN_USE.byteValue()), bitFlag(record.Created, Record.CREATED_IN_TX), bitFlag(record.RequiresSecondaryUnit(), Record.REQUIRE_SECONDARY_UNIT), bitFlag(record.HasSecondaryUnitId(), Record.HAS_SECONDARY_UNIT), bitFlag(record.UseFixedReferences, Record.USES_FIXED_REFERENCE_FORMAT)); channel.Put(flags); if (record.InUse()) { channel.PutLong(record.FirstNode).putLong(record.SecondNode).putInt(record.Type).putLong(record.FirstPrevRel).putLong(record.FirstNextRel).putLong(record.SecondPrevRel).putLong(record.SecondNextRel).putLong(record.NextProp).put(( sbyte )((record.FirstInFirstChain ? 1 : 0) | (record.FirstInSecondChain ? 2 : 0))); if (record.HasSecondaryUnitId()) { channel.PutLong(record.SecondaryUnitId); } } else { channel.PutInt(record.Type); } }
public BinaryLog(WritableChannel<BinaryLogEntry> hackCommittedEntryQueue = null, Func<BinaryLogEntry, Task> hackEntrySyncAppendedCallback = null) { hack__committedEntryQueue = hackCommittedEntryQueue; hack__entrySyncAppendedCallback = hackEntrySyncAppendedCallback; }