Class RawCompressor

    • Method Detail

      • compress

        public int compress​(long nodeId,
                            long[] targets,
                            long[][][] properties,
                            int degree)
        Description copied from interface: AdjacencyCompressor
        Compress a list of target ids into an adjacency list. The input values are an unsorted list of target ids. The provided long[] must be able to hold at least degree elements. The input values might also store properties. The properties has the number of properties in the first dimension, followed by an uncompressed long[] for each property. Those values belong to the target id that is stored at the same array index in the uncompressed target list. Implementors need to make sure to maintain that order when re-ordering the target ids. The provided targets array will be used after this method call. Implementors will need to write the resulting target list somewhere. Where exactly is up to the implementation. The results should end up in the data that is returned by the AdjacencyCompressorFactory.build() method. The method only needs to return the degree of the compressed adjacency list. This value can be different from degree due to possible deduplication, though it should never be larger. The return value is only used for tracking progress and reporting, it is not stored in the graph. How the degree is stored so that it can be used by the Graph is up the implementor of this method.
        Specified by:
        compress in interface AdjacencyCompressor
        Parameters:
        nodeId - The node id that is the source node for this adjacency list. The id is from the GDS internal scope, it is *not* the Neo4j ID.
        targets - A list of target ids, unsorted.
        properties - A nested list of property values.
        degree - The number of targets stored in `targets`.
        Returns:
        the degree of the compressed adjacency list
      • close

        public void close()
        Description copied from interface: AdjacencyCompressor
        Closing this compressor will release some internal data structures, making them eligible for garbage collection. The compressor cannot be used after it has been closed.
        Specified by:
        close in interface AdjacencyCompressor
        Specified by:
        close in interface java.lang.AutoCloseable