NebulaGraph Java Client  release-3.6
All Classes Functions Variables
StorageClient.java
1 /* Copyright (c) 2020 vesoft inc. All rights reserved.
2  *
3  * This source code is licensed under Apache 2.0 License.
4  */
5 
6 package com.vesoft.nebula.client.storage;
7 
8 import com.vesoft.nebula.HostAddr;
9 import com.vesoft.nebula.client.graph.data.HostAddress;
10 import com.vesoft.nebula.client.graph.data.SSLParam;
11 import com.vesoft.nebula.client.meta.MetaManager;
12 import com.vesoft.nebula.client.storage.scan.PartScanInfo;
13 import com.vesoft.nebula.client.storage.scan.ScanEdgeResultIterator;
14 import com.vesoft.nebula.client.storage.scan.ScanVertexResultIterator;
15 import com.vesoft.nebula.meta.ColumnDef;
16 import com.vesoft.nebula.meta.Schema;
17 import com.vesoft.nebula.storage.EdgeProp;
18 import com.vesoft.nebula.storage.ScanEdgeRequest;
19 import com.vesoft.nebula.storage.ScanVertexRequest;
20 import com.vesoft.nebula.storage.VertexProp;
21 import java.io.Serializable;
22 import java.util.ArrayList;
23 import java.util.Arrays;
24 import java.util.HashSet;
25 import java.util.List;
26 import java.util.Set;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
29 
30 public class StorageClient implements Serializable {
31  private static final Logger LOGGER = LoggerFactory.getLogger(StorageClient.class);
32 
33  private final GraphStorageConnection connection;
34  private StorageConnPool pool;
35  private MetaManager metaManager;
36  private final List<HostAddress> addresses;
37  private int timeout = 10000; // ms
38  private int connectionRetry = 3;
39  private int executionRetry = 1;
40 
41  private boolean enableSSL = false;
42  private SSLParam sslParam = null;
43 
51  public StorageClient(String ip, int port) {
52  this(Arrays.asList(new HostAddress(ip, port)));
53  }
54 
61  public StorageClient(List<HostAddress> addresses) {
62  this.connection = new GraphStorageConnection();
63  this.addresses = addresses;
64  }
65 
73  public StorageClient(List<HostAddress> addresses, int timeout) {
74  this.connection = new GraphStorageConnection();
75  this.addresses = addresses;
76  this.timeout = timeout;
77  }
78 
83  public StorageClient(List<HostAddress> addresses, int timeout, int connectionRetry,
84  int executionRetry, boolean enableSSL, SSLParam sslParam) {
85  this(addresses, timeout);
86  this.connectionRetry = connectionRetry;
87  this.executionRetry = executionRetry;
88  this.enableSSL = enableSSL;
89  this.sslParam = sslParam;
90  if (enableSSL && sslParam == null) {
91  throw new IllegalArgumentException("SSL is enabled, but SSLParam is nul.");
92  }
93  }
94 
100  public boolean connect() throws Exception {
101  connection.open(addresses.get(0), timeout, enableSSL, sslParam);
102  StoragePoolConfig config = new StoragePoolConfig();
103  config.setEnableSSL(enableSSL);
104  config.setSslParam(sslParam);
105  pool = new StorageConnPool(config);
106  metaManager = new MetaManager(addresses, timeout, connectionRetry, executionRetry,
107  enableSSL, sslParam);
108  return true;
109  }
110 
111 
123  public ScanVertexResultIterator scanVertex(String spaceName, String tagName,
124  List<String> returnCols) {
125  return scanVertex(spaceName, tagName, returnCols, DEFAULT_LIMIT);
126  }
127 
140  public ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName,
141  List<String> returnCols) {
142  return scanVertex(spaceName, part, tagName, returnCols, DEFAULT_LIMIT);
143  }
144 
154  public ScanVertexResultIterator scanVertex(String spaceName, String tagName) {
155  return scanVertex(spaceName, tagName, DEFAULT_LIMIT);
156  }
157 
168  public ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName) {
169  return scanVertex(spaceName, part, tagName, DEFAULT_LIMIT);
170  }
171 
183  public ScanVertexResultIterator scanVertex(String spaceName,
184  String tagName,
185  List<String> returnCols,
186  int limit) {
187  return scanVertex(spaceName, tagName, returnCols, limit, DEFAULT_START_TIME,
188  DEFAULT_END_TIME);
189  }
190 
203  public ScanVertexResultIterator scanVertex(String spaceName,
204  int part,
205  String tagName,
206  List<String> returnCols,
207  int limit) {
208  return scanVertex(spaceName, part, tagName, returnCols, limit, DEFAULT_START_TIME,
209  DEFAULT_END_TIME);
210  }
211 
222  public ScanVertexResultIterator scanVertex(String spaceName,
223  String tagName,
224  int limit) {
225  return scanVertex(spaceName, tagName, limit, DEFAULT_START_TIME, DEFAULT_END_TIME);
226  }
227 
239  public ScanVertexResultIterator scanVertex(String spaceName,
240  int part,
241  String tagName,
242  int limit) {
243  return scanVertex(spaceName, part, tagName,
244  limit, DEFAULT_START_TIME, DEFAULT_END_TIME);
245  }
246 
262  public ScanVertexResultIterator scanVertex(String spaceName,
263  String tagName,
264  List<String> returnCols,
265  int limit,
266  long startTime,
267  long endTime) {
268  return scanVertex(spaceName, tagName, returnCols, limit, startTime, endTime,
269  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
270  }
271 
288  public ScanVertexResultIterator scanVertex(String spaceName,
289  int part,
290  String tagName,
291  List<String> returnCols,
292  int limit,
293  long startTime,
294  long endTime) {
295  return scanVertex(spaceName, part, tagName, returnCols, limit, startTime, endTime,
296  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
297  }
298 
313  public ScanVertexResultIterator scanVertex(String spaceName,
314  String tagName,
315  int limit,
316  long startTime,
317  long endTime) {
318  return scanVertex(spaceName, tagName, limit, startTime, endTime,
319  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
320  }
321 
336  public ScanVertexResultIterator scanVertex(String spaceName,
337  int part,
338  String tagName,
339  int limit,
340  long startTime,
341  long endTime) {
342  return scanVertex(spaceName,
343  part,
344  tagName,
345  new ArrayList<>(),
346  limit,
347  startTime,
348  endTime,
349  DEFAULT_ALLOW_PART_SUCCESS,
350  DEFAULT_ALLOW_READ_FOLLOWER);
351  }
352 
353 
375  public ScanVertexResultIterator scanVertex(String spaceName,
376  String tagName,
377  List<String> returnCols,
378  int limit,
379  long startTime,
380  long endTime,
381  boolean allowPartSuccess,
382  boolean allowReadFromFollower) {
383  List<Integer> parts = metaManager.getSpaceParts(spaceName);
384  if (parts.isEmpty()) {
385  throw new IllegalArgumentException("No valid part in space " + spaceName);
386  }
387  return scanVertex(
388  spaceName,
389  parts,
390  tagName,
391  returnCols,
392  false,
393  limit,
394  startTime,
395  endTime,
396  allowPartSuccess,
397  allowReadFromFollower);
398  }
399 
400 
423  public ScanVertexResultIterator scanVertex(String spaceName,
424  int part,
425  String tagName,
426  List<String> returnCols,
427  int limit,
428  long startTime,
429  long endTime,
430  boolean allowPartSuccess,
431  boolean allowReadFromFollower) {
432  return scanVertex(
433  spaceName,
434  Arrays.asList(part),
435  tagName,
436  returnCols,
437  false,
438  limit,
439  startTime,
440  endTime,
441  allowPartSuccess,
442  allowReadFromFollower);
443  }
444 
445 
466  public ScanVertexResultIterator scanVertex(String spaceName,
467  String tagName,
468  int limit,
469  long startTime,
470  long endTime,
471  boolean allowPartSuccess,
472  boolean allowReadFromFollower) {
473  List<Integer> parts = metaManager.getSpaceParts(spaceName);
474  if (parts.isEmpty()) {
475  throw new IllegalArgumentException("No valid part in space " + spaceName);
476  }
477  return scanVertex(
478  spaceName,
479  parts,
480  tagName,
481  new ArrayList<>(),
482  true,
483  limit,
484  startTime,
485  endTime,
486  allowPartSuccess,
487  allowReadFromFollower);
488  }
489 
510  public ScanVertexResultIterator scanVertex(String spaceName,
511  int part,
512  String tagName,
513  int limit,
514  long startTime,
515  long endTime,
516  boolean allowPartSuccess,
517  boolean allowReadFromFollower) {
518  return scanVertex(
519  spaceName,
520  Arrays.asList(part),
521  tagName,
522  new ArrayList<>(),
523  true,
524  limit,
525  startTime,
526  endTime,
527  allowPartSuccess,
528  allowReadFromFollower);
529  }
530 
531  private ScanVertexResultIterator scanVertex(String spaceName,
532  List<Integer> parts,
533  String tagName,
534  List<String> returnCols,
535  boolean noColumns,
536  int limit,
537  long startTime,
538  long endTime,
539  boolean allowPartSuccess,
540  boolean allowReadFromFollower) {
541  if (spaceName == null || spaceName.trim().isEmpty()) {
542  throw new IllegalArgumentException("space name is empty.");
543  }
544  if (tagName == null || tagName.trim().isEmpty()) {
545  throw new IllegalArgumentException("tag name is empty");
546  }
547  if (noColumns && returnCols == null) {
548  throw new IllegalArgumentException("returnCols is null");
549  }
550 
551  Set<PartScanInfo> partScanInfoSet = new HashSet<>();
552  for (int part : parts) {
553  HostAddr leader = metaManager.getLeader(spaceName, part);
554  partScanInfoSet.add(new PartScanInfo(part, new HostAddress(leader.getHost(),
555  leader.getPort())));
556  }
557  List<HostAddress> addrs = new ArrayList<>();
558  for (HostAddr addr : metaManager.listHosts()) {
559  addrs.add(new HostAddress(addr.getHost(), addr.getPort()));
560  }
561 
562  long tag = metaManager.getTag(spaceName, tagName).getTag_id();
563  List<byte[]> props = new ArrayList<>();
564  props.add("_vid".getBytes());
565  if (!noColumns) {
566  if (returnCols.size() == 0) {
567  Schema schema = metaManager.getTag(spaceName, tagName).getSchema();
568  for (ColumnDef columnDef : schema.getColumns()) {
569  props.add(columnDef.getName());
570  }
571  } else {
572  for (String prop : returnCols) {
573  props.add(prop.getBytes());
574  }
575  }
576  }
577  VertexProp vertexCols = new VertexProp((int) tag, props);
578  List<VertexProp> vertexProps = Arrays.asList(vertexCols);
579  ScanVertexRequest request = new ScanVertexRequest();
580  request
581  .setSpace_id(getSpaceId(spaceName))
582  .setReturn_columns(vertexProps)
583  .setLimit(limit)
584  .setStart_time(startTime)
585  .setEnd_time(endTime)
586  .setEnable_read_from_follower(allowReadFromFollower);
587 
588  return doScanVertex(spaceName, tagName, partScanInfoSet, request, addrs, allowPartSuccess);
589  }
590 
591 
603  private ScanVertexResultIterator doScanVertex(String spaceName,
604  String tagName,
605  Set<PartScanInfo> partScanInfoSet,
606  ScanVertexRequest request,
607  List<HostAddress> addrs,
608  boolean allowPartSuccess) {
609  if (addrs == null || addrs.isEmpty()) {
610  throw new IllegalArgumentException("storage hosts is empty.");
611  }
612 
613  return new ScanVertexResultIterator.ScanVertexResultBuilder()
614  .withMetaClient(metaManager)
615  .withPool(pool)
616  .withPartScanInfo(partScanInfoSet)
617  .withRequest(request)
618  .withAddresses(addrs)
619  .withSpaceName(spaceName)
620  .withTagName(tagName)
621  .withPartSuccess(allowPartSuccess)
622  .build();
623  }
624 
625 
636  public ScanEdgeResultIterator scanEdge(String spaceName, String edgeName,
637  List<String> returnCols) {
638 
639  return scanEdge(spaceName, edgeName, returnCols, DEFAULT_LIMIT);
640  }
641 
653  public ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName,
654  List<String> returnCols) {
655 
656  return scanEdge(spaceName, part, edgeName, returnCols, DEFAULT_LIMIT);
657  }
658 
668  public ScanEdgeResultIterator scanEdge(String spaceName, String edgeName) {
669  return scanEdge(spaceName, edgeName, DEFAULT_LIMIT);
670  }
671 
682  public ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName) {
683  return scanEdge(spaceName, part, edgeName, DEFAULT_LIMIT);
684  }
685 
698  public ScanEdgeResultIterator scanEdge(String spaceName, String edgeName,
699  List<String> returnCols, int limit) {
700  return scanEdge(spaceName, edgeName, returnCols, limit, DEFAULT_START_TIME,
701  DEFAULT_END_TIME);
702  }
703 
716  public ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName,
717  List<String> returnCols, int limit) {
718  return scanEdge(spaceName, part, edgeName, returnCols, limit, DEFAULT_START_TIME,
719  DEFAULT_END_TIME);
720  }
721 
733  public ScanEdgeResultIterator scanEdge(String spaceName, String edgeName, int limit) {
734  return scanEdge(spaceName, edgeName, limit, DEFAULT_START_TIME, DEFAULT_END_TIME);
735  }
736 
749  public ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName, int limit) {
750  return scanEdge(spaceName, part, edgeName, limit, DEFAULT_START_TIME, DEFAULT_END_TIME);
751  }
752 
765  public ScanEdgeResultIterator scanEdge(String spaceName,
766  String edgeName,
767  List<String> returnCols,
768  int limit,
769  long startTime,
770  long endTime) {
771  return scanEdge(spaceName, edgeName, returnCols, limit, startTime, endTime,
772  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
773  }
774 
792  public ScanEdgeResultIterator scanEdge(String spaceName,
793  int part,
794  String edgeName,
795  List<String> returnCols,
796  int limit,
797  long startTime,
798  long endTime) {
799  return scanEdge(spaceName, part, edgeName, returnCols, limit, startTime, endTime,
800  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
801  }
802 
818  public ScanEdgeResultIterator scanEdge(String spaceName,
819  String edgeName,
820  int limit,
821  long startTime,
822  long endTime) {
823  return scanEdge(spaceName, edgeName, limit, startTime, endTime,
824  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
825  }
826 
843  public ScanEdgeResultIterator scanEdge(String spaceName,
844  int part,
845  String edgeName,
846  int limit,
847  long startTime,
848  long endTime) {
849  return scanEdge(spaceName, part, edgeName, limit, startTime, endTime,
850  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
851  }
852 
853 
872  public ScanEdgeResultIterator scanEdge(String spaceName,
873  String edgeName,
874  List<String> returnCols,
875  int limit,
876  long startTime,
877  long endTime,
878  boolean allowPartSuccess,
879  boolean allowReadFromFollower) {
880 
881  List<Integer> parts = metaManager.getSpaceParts(spaceName);
882  if (parts.isEmpty()) {
883  throw new IllegalArgumentException("No valid part in space " + spaceName);
884  }
885 
886  return scanEdge(spaceName, parts, edgeName, returnCols, false,
887  limit, startTime, endTime, allowPartSuccess, allowReadFromFollower);
888  }
889 
909  public ScanEdgeResultIterator scanEdge(String spaceName,
910  int part,
911  String edgeName,
912  List<String> returnCols,
913  int limit,
914  long startTime,
915  long endTime,
916  boolean allowPartSuccess,
917  boolean allowReadFromFollower) {
918  return scanEdge(spaceName, Arrays.asList(part), edgeName, returnCols, false,
919  limit, startTime, endTime, allowPartSuccess, allowReadFromFollower);
920  }
921 
922 
941  public ScanEdgeResultIterator scanEdge(String spaceName,
942  String edgeName,
943  int limit,
944  long startTime,
945  long endTime,
946  boolean allowPartSuccess,
947  boolean allowReadFromFollower) {
948 
949  List<Integer> parts = metaManager.getSpaceParts(spaceName);
950  if (parts.isEmpty()) {
951  throw new IllegalArgumentException("No valid part in space " + spaceName);
952  }
953  return scanEdge(spaceName, parts, edgeName, new ArrayList<>(), true,
954  limit, startTime, endTime, allowPartSuccess, allowReadFromFollower);
955  }
956 
957 
977  public ScanEdgeResultIterator scanEdge(String spaceName,
978  int part,
979  String edgeName,
980  int limit,
981  long startTime,
982  long endTime,
983  boolean allowPartSuccess,
984  boolean allowReadFromFollower) {
985  return scanEdge(spaceName, Arrays.asList(part), edgeName, new ArrayList<>(), true,
986  limit, startTime, endTime, allowPartSuccess, allowReadFromFollower);
987  }
988 
989 
990  private ScanEdgeResultIterator scanEdge(String spaceName,
991  List<Integer> parts,
992  String edgeName,
993  List<String> returnCols,
994  boolean noColumns,
995  int limit,
996  long startTime,
997  long endTime,
998  boolean allowPartSuccess,
999  boolean allowReadFromFollower) {
1000  if (spaceName == null || spaceName.trim().isEmpty()) {
1001  throw new IllegalArgumentException("space name is empty.");
1002  }
1003  if (edgeName == null || edgeName.trim().isEmpty()) {
1004  throw new IllegalArgumentException("edge name is empty");
1005  }
1006  if (noColumns && returnCols == null) {
1007  throw new IllegalArgumentException("returnCols is null");
1008  }
1009 
1010  Set<PartScanInfo> partScanInfoSet = new HashSet<>();
1011  for (int part : parts) {
1012  HostAddr leader = metaManager.getLeader(spaceName, part);
1013  partScanInfoSet.add(new PartScanInfo(part, new HostAddress(leader.getHost(),
1014  leader.getPort())));
1015  }
1016  List<HostAddress> addrs = new ArrayList<>();
1017  for (HostAddr addr : metaManager.listHosts()) {
1018  addrs.add(new HostAddress(addr.getHost(), addr.getPort()));
1019  }
1020  List<byte[]> props = new ArrayList<>();
1021  props.add("_src".getBytes());
1022  props.add("_dst".getBytes());
1023  props.add("_rank".getBytes());
1024  if (!noColumns) {
1025  if (returnCols.size() == 0) {
1026  Schema schema = metaManager.getEdge(spaceName, edgeName).getSchema();
1027  for (ColumnDef columnDef : schema.getColumns()) {
1028  props.add(columnDef.name);
1029  }
1030  } else {
1031  for (String prop : returnCols) {
1032  props.add(prop.getBytes());
1033  }
1034  }
1035  }
1036 
1037  long edgeId = getEdgeId(spaceName, edgeName);
1038  EdgeProp edgeCols = new EdgeProp((int) edgeId, props);
1039  List<EdgeProp> edgeProps = Arrays.asList(edgeCols);
1040 
1041  ScanEdgeRequest request = new ScanEdgeRequest();
1042  request
1043  .setSpace_id(getSpaceId(spaceName))
1044  .setReturn_columns(edgeProps)
1045  .setLimit(limit)
1046  .setStart_time(startTime)
1047  .setEnd_time(endTime)
1048  .setEnable_read_from_follower(allowReadFromFollower);
1049 
1050  return doScanEdge(spaceName, edgeName, partScanInfoSet, request, addrs, allowPartSuccess);
1051  }
1052 
1053 
1065  private ScanEdgeResultIterator doScanEdge(String spaceName,
1066  String edgeName,
1067  Set<PartScanInfo> partScanInfoSet,
1068  ScanEdgeRequest request,
1069  List<HostAddress> addrs,
1070  boolean allowPartSuccess) {
1071  if (addrs == null || addrs.isEmpty()) {
1072  throw new IllegalArgumentException("storage hosts is empty.");
1073  }
1074 
1075  return new ScanEdgeResultIterator.ScanEdgeResultBuilder()
1076  .withMetaClient(metaManager)
1077  .withPool(pool)
1078  .withPartScanInfo(partScanInfoSet)
1079  .withRequest(request)
1080  .withAddresses(addrs)
1081  .withSpaceName(spaceName)
1082  .withEdgeName(edgeName)
1083  .withPartSuccess(allowPartSuccess)
1084  .build();
1085  }
1086 
1087 
1091  public void close() {
1092  if (pool != null) {
1093  pool.close();
1094  }
1095  if (connection != null) {
1096  connection.close();
1097  }
1098  if (metaManager != null) {
1099  metaManager.close();
1100  }
1101  }
1102 
1103 
1110  return this.connection;
1111  }
1112 
1113 
1120  private int getSpaceId(String spaceName) {
1121  return metaManager.getSpaceId(spaceName);
1122  }
1123 
1131  private long getEdgeId(String spaceName, String edgeName) {
1132  return metaManager.getEdge(spaceName, edgeName).getEdge_type();
1133  }
1134 
1135  private static final int DEFAULT_LIMIT = 1000;
1136  private static final long DEFAULT_START_TIME = 0;
1137  private static final long DEFAULT_END_TIME = Long.MAX_VALUE;
1138  private static final boolean DEFAULT_ALLOW_PART_SUCCESS = false;
1139  private static final boolean DEFAULT_ALLOW_READ_FOLLOWER = true;
1140 }
MetaManager is a manager for meta info, such as spaces,tags and edges.
Set< HostAddr > listHosts()
get all storage addresses
EdgeItem getEdge(String spaceName, String edgeName)
get Edge
int getSpaceId(String spaceName)
get space id
TagItem getTag(String spaceName, String tagName)
get tag
List< Integer > getSpaceParts(String spaceName)
get all parts of one space
HostAddr getLeader(String spaceName, int part)
get part leader
ScanVertexResultIterator scanVertex(String spaceName, String tagName, List< String > returnCols)
scan vertex of all parts with specific return cols, if returnCols is an empty list,...
StorageClient(List< HostAddress > addresses, int timeout)
Get a Nebula Storage client that executes the scan query to get NebulaGraph's data with multi servers...
ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName, List< String > returnCols)
scan edge of specific part with return cols.
ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName, List< String > returnCols, int limit)
scan vertex of specific part with specific return cols and limit.
ScanVertexResultIterator scanVertex(String spaceName, String tagName)
scan vertex of all parts with no return cols.
ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName, int limit, long startTime, long endTime)
scan edge of specific part with no return cols and limit, start time, end time config.
ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName, List< String > returnCols, int limit)
scan edge of specific part with return cols.
ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName, List< String > returnCols)
scan vertex of specific part with specific return cols, if returnCols is an empty list,...
GraphStorageConnection getConnection()
return client's connection session
ScanEdgeResultIterator scanEdge(String spaceName, String edgeName, List< String > returnCols, int limit, long startTime, long endTime, boolean allowPartSuccess, boolean allowReadFromFollower)
scan edge of all parts with return cols and limit, start time, end time, if allow partial success,...
ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName, List< String > returnCols, int limit, long startTime, long endTime)
scan vertex of specific part with specific returnCols, limit, startTime and endTime.
ScanEdgeResultIterator scanEdge(String spaceName, String edgeName)
scan edge of all parts with no return cols.
ScanVertexResultIterator scanVertex(String spaceName, String tagName, List< String > returnCols, int limit, long startTime, long endTime)
scan vertex of all parts with specific returnCols, limit, startTime and endTime.
boolean connect()
Connect to Nebula Storage server.
ScanEdgeResultIterator scanEdge(String spaceName, String edgeName, List< String > returnCols)
scan edge of all parts with return cols.
StorageClient(List< HostAddress > addresses)
Get a Nebula Storage client that executes the scan query to get NebulaGraph's data with multi servers...
StorageClient(String ip, int port)
Get a Nebula Storage client that executes the scan query to get NebulaGraph's data with one server ho...
ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName)
scan edge of specific part with no return cols.
ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName)
scan vertex of specific part with no return cols.
ScanVertexResultIterator scanVertex(String spaceName, String tagName, int limit)
scan vertex of all parts with no return cols and limit.
ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName, int limit)
scan edge of specific part with no return cols and limit config.
ScanVertexResultIterator scanVertex(String spaceName, String tagName, int limit, long startTime, long endTime, boolean allowPartSuccess, boolean allowReadFromFollower)
scan vertex of all parts with no return cols, limit, startTime, endTime, whether allow partial succes...
ScanVertexResultIterator scanVertex(String spaceName, String tagName, List< String > returnCols, int limit)
scan vertex of all parts with specific return cols and limit.
ScanEdgeResultIterator scanEdge(String spaceName, String edgeName, int limit, long startTime, long endTime)
scan edge of all parts with no return cols and limit, start time, end time config.
ScanEdgeResultIterator scanEdge(String spaceName, String edgeName, List< String > returnCols, int limit, long startTime, long endTime)
scan edge of all parts with return cols and limit, start time, end time config.
ScanVertexResultIterator scanVertex(String spaceName, String tagName, int limit, long startTime, long endTime)
scan vertex of all parts with no returnCols, limit, startTime and endTime.
ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName, List< String > returnCols, int limit, long startTime, long endTime)
scan edge of specific part with return cols and limit, start time, end time config.
ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName, int limit, long startTime, long endTime)
scan vertex of specific part with no returnCols, limit, startTime and endTime.
ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName, List< String > returnCols, int limit, long startTime, long endTime, boolean allowPartSuccess, boolean allowReadFromFollower)
scan edge of specific part with return cols and limit, start time, end time, if allow partial success...
ScanEdgeResultIterator scanEdge(String spaceName, String edgeName, List< String > returnCols, int limit)
scan edge of all parts with return cols and limit config.
ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName, int limit)
scan vertex of specific part with no return cols and limit.
ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName, int limit, long startTime, long endTime, boolean allowPartSuccess, boolean allowReadFromFollower)
scan edge of specific part with no return cols and limit, start time, end time, if allow partial succ...
ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName, int limit, long startTime, long endTime, boolean allowPartSuccess, boolean allowReadFromFollower)
scan vertex of specific part with no return cols, limit, startTime, endTime, whether allow partial su...
ScanEdgeResultIterator scanEdge(String spaceName, String edgeName, int limit, long startTime, long endTime, boolean allowPartSuccess, boolean allowReadFromFollower)
scan edge of all parts with no return cols and limit, start time, end time, if allow partial success,...
ScanVertexResultIterator scanVertex(String spaceName, String tagName, List< String > returnCols, int limit, long startTime, long endTime, boolean allowPartSuccess, boolean allowReadFromFollower)
scan vertex of all parts with specific return cols, limit, startTime, endTime, whether allow partial ...
ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName, List< String > returnCols, int limit, long startTime, long endTime, boolean allowPartSuccess, boolean allowReadFromFollower)
scan vertex of specific part with specific return cols, limit, startTime, endTime, whether allow part...
StorageClient(List< HostAddress > addresses, int timeout, int connectionRetry, int executionRetry, boolean enableSSL, SSLParam sslParam)
Get a Nebula Storage client that executes the scan query to get NebulaGraph's data with multi servers...
ScanEdgeResultIterator scanEdge(String spaceName, String edgeName, int limit)
scan edge of all parts with no return cols and limit config.