Skip to main content

Class GetGraphEntitiesRequest

java.lang.Object
com.gpudb.protocol.GetGraphEntitiesRequest
All Implemented Interfaces:
org.apache.avro.generic.GenericContainer, org.apache.avro.generic.IndexedRecord

public class GetGraphEntitiesRequest extends Object implements org.apache.avro.generic.IndexedRecord
A set of parameters for GPUdb.getGraphEntities.

Retrieves node or edge entities from an existing graph, with pagination support via offset and limit. Use GPUdb.showGraph to obtain the total number of nodes and edges.

  • Constructor Details

    • GetGraphEntitiesRequest

      public GetGraphEntitiesRequest()
      Constructs a GetGraphEntitiesRequest object with default parameters.
    • GetGraphEntitiesRequest

      public GetGraphEntitiesRequest(String graphName, long offset, long limit, Map<String,String> options)
      Constructs a GetGraphEntitiesRequest object with the specified parameters.
      Parameters:
      graphName - Name of the graph from which to retrieve entities.
      offset - Starting index of the entities to retrieve (0-based). The default value is 0.
      limit - Number of entities to retrieve starting from offset. A value of -1 returns all entities from the offset to the end. Note: the entitiesInt or entitiesString array size will be 2x this value for nodes (stride 2) or 4x for edges (stride 4). The default value is 10000.
      options - Optional parameters.
      • ENTITY_TYPE: The type of entity to retrieve. Supported values:
        • EDGE: Retrieve edge entities (default).
        • NODE: Retrieve node entities.
        The default value is EDGE.
      • SERVER_ID: Indicates which graph server to send the request to. Required when the graph is distributed across multiple servers. The default value is ‘0’.
      • CONCISE_EDGE_CONNECTIVITY: When true, edges are emitted in a compact connectivity form regardless of the graph’s identifier type: entitiesInt contains stride-4 records [edge_id, node1_index, node2_index, edge_label_index] where node1_index/node2_index are 0-based positions into the node array (obtained from a node-entity call on the same graph). When requesting nodes with this option, the response includes tombstoned (deleted) slots in order to keep position indices stable so edge indices resolve correctly; deleted slots carry id=0 for integer graphs or an empty identifier for string/WKT graphs. For paginated node calls, subtract offset from an edge endpoint index to locate it within the returned page. Supported values:
        • TRUE: Compact integer connectivity for edges; deleted node slots included in node output.
        • FALSE: Default: edges emit node identifiers (int/string/WKT) matching the graph; deleted nodes are skipped.
        The default value is FALSE.
      • INCLUDE_WEIGHTS: When true and options entityType is ‘edge’, the response entitiesWeight array is populated with one float weight per emitted edge (aligned 1:1 with the edge records in entitiesInt or entitiesString). Empty when the graph has no weights component or when requesting nodes. Supported values:The default value is FALSE.
      The default value is an empty Map.
  • Method Details

    • getClassSchema

      public static org.apache.avro.Schema getClassSchema()
      This method supports the Avro framework and is not intended to be called directly by the user.
      Returns:
      The schema for the class.
    • getGraphName

      public String getGraphName()
      Name of the graph from which to retrieve entities.
      Returns:
      The current value of graphName.
    • setGraphName

      public GetGraphEntitiesRequest setGraphName(String graphName)
      Name of the graph from which to retrieve entities.
      Parameters:
      graphName - The new value for graphName.
      Returns:
      this to mimic the builder pattern.
    • getOffset

      public long getOffset()
      Starting index of the entities to retrieve (0-based). The default value is 0.
      Returns:
      The current value of offset.
    • setOffset

      public GetGraphEntitiesRequest setOffset(long offset)
      Starting index of the entities to retrieve (0-based). The default value is 0.
      Parameters:
      offset - The new value for offset.
      Returns:
      this to mimic the builder pattern.
    • getLimit

      public long getLimit()
      Number of entities to retrieve starting from offset. A value of -1 returns all entities from the offset to the end. Note: the entitiesInt or entitiesString array size will be 2x this value for nodes (stride 2) or 4x for edges (stride 4). The default value is 10000.
      Returns:
      The current value of limit.
    • setLimit

      public GetGraphEntitiesRequest setLimit(long limit)
      Number of entities to retrieve starting from offset. A value of -1 returns all entities from the offset to the end. Note: the entitiesInt or entitiesString array size will be 2x this value for nodes (stride 2) or 4x for edges (stride 4). The default value is 10000.
      Parameters:
      limit - The new value for limit.
      Returns:
      this to mimic the builder pattern.
    • getOptions

      public Map<String,String> getOptions()
      Optional parameters.
      • ENTITY_TYPE: The type of entity to retrieve. Supported values:
        • EDGE: Retrieve edge entities (default).
        • NODE: Retrieve node entities.
        The default value is EDGE.
      • SERVER_ID: Indicates which graph server to send the request to. Required when the graph is distributed across multiple servers. The default value is ‘0’.
      • CONCISE_EDGE_CONNECTIVITY: When true, edges are emitted in a compact connectivity form regardless of the graph’s identifier type: entitiesInt contains stride-4 records [edge_id, node1_index, node2_index, edge_label_index] where node1_index/node2_index are 0-based positions into the node array (obtained from a node-entity call on the same graph). When requesting nodes with this option, the response includes tombstoned (deleted) slots in order to keep position indices stable so edge indices resolve correctly; deleted slots carry id=0 for integer graphs or an empty identifier for string/WKT graphs. For paginated node calls, subtract offset from an edge endpoint index to locate it within the returned page. Supported values:
        • TRUE: Compact integer connectivity for edges; deleted node slots included in node output.
        • FALSE: Default: edges emit node identifiers (int/string/WKT) matching the graph; deleted nodes are skipped.
        The default value is FALSE.
      • INCLUDE_WEIGHTS: When true and options entityType is ‘edge’, the response entitiesWeight array is populated with one float weight per emitted edge (aligned 1:1 with the edge records in entitiesInt or entitiesString). Empty when the graph has no weights component or when requesting nodes. Supported values:The default value is FALSE.
      The default value is an empty Map.
      Returns:
      The current value of options.
    • setOptions

      public GetGraphEntitiesRequest setOptions(Map<String,String> options)
      Optional parameters.
      • ENTITY_TYPE: The type of entity to retrieve. Supported values:
        • EDGE: Retrieve edge entities (default).
        • NODE: Retrieve node entities.
        The default value is EDGE.
      • SERVER_ID: Indicates which graph server to send the request to. Required when the graph is distributed across multiple servers. The default value is ‘0’.
      • CONCISE_EDGE_CONNECTIVITY: When true, edges are emitted in a compact connectivity form regardless of the graph’s identifier type: entitiesInt contains stride-4 records [edge_id, node1_index, node2_index, edge_label_index] where node1_index/node2_index are 0-based positions into the node array (obtained from a node-entity call on the same graph). When requesting nodes with this option, the response includes tombstoned (deleted) slots in order to keep position indices stable so edge indices resolve correctly; deleted slots carry id=0 for integer graphs or an empty identifier for string/WKT graphs. For paginated node calls, subtract offset from an edge endpoint index to locate it within the returned page. Supported values:
        • TRUE: Compact integer connectivity for edges; deleted node slots included in node output.
        • FALSE: Default: edges emit node identifiers (int/string/WKT) matching the graph; deleted nodes are skipped.
        The default value is FALSE.
      • INCLUDE_WEIGHTS: When true and options entityType is ‘edge’, the response entitiesWeight array is populated with one float weight per emitted edge (aligned 1:1 with the edge records in entitiesInt or entitiesString). Empty when the graph has no weights component or when requesting nodes. Supported values:The default value is FALSE.
      The default value is an empty Map.
      Parameters:
      options - The new value for options.
      Returns:
      this to mimic the builder pattern.
    • getSchema

      public org.apache.avro.Schema getSchema()
      This method supports the Avro framework and is not intended to be called directly by the user.
      Specified by:
      getSchema in interface org.apache.avro.generic.GenericContainer
      Returns:
      The schema object describing this class.
    • get

      public Object get(int index)
      This method supports the Avro framework and is not intended to be called directly by the user.
      Specified by:
      get in interface org.apache.avro.generic.IndexedRecord
      Parameters:
      index - the position of the field to get
      Returns:
      value of the field with the given index.
      Throws:
    • put

      public void put(int index, Object value)
      This method supports the Avro framework and is not intended to be called directly by the user.
      Specified by:
      put in interface org.apache.avro.generic.IndexedRecord
      Parameters:
      index - the position of the field to set
      value - the value to set
      Throws:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object