NebulaGraph Java Client  release-3.8
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 
44  private String user = null;
45  private String password = null;
46 
54  public StorageClient(String ip, int port) {
55  this(Arrays.asList(new HostAddress(ip, port)));
56  }
57 
64  public StorageClient(List<HostAddress> addresses) {
65  this.connection = new GraphStorageConnection();
66  this.addresses = addresses;
67  }
68 
76  public StorageClient(List<HostAddress> addresses, int timeout) {
77  this.connection = new GraphStorageConnection();
78  this.addresses = addresses;
79  this.timeout = timeout;
80  }
81 
86  public StorageClient(List<HostAddress> addresses, int timeout, int connectionRetry,
87  int executionRetry, boolean enableSSL, SSLParam sslParam) {
88  this(addresses, timeout);
89  this.connectionRetry = connectionRetry;
90  this.executionRetry = executionRetry;
91  this.enableSSL = enableSSL;
92  this.sslParam = sslParam;
93  if (enableSSL && sslParam == null) {
94  throw new IllegalArgumentException("SSL is enabled, but SSLParam is nul.");
95  }
96  }
97 
103  public boolean connect() throws Exception {
104  connection.open(addresses.get(0), timeout, enableSSL, sslParam);
105  StoragePoolConfig config = new StoragePoolConfig();
106  config.setEnableSSL(enableSSL);
107  config.setSslParam(sslParam);
108  pool = new StorageConnPool(config);
109  metaManager = new MetaManager(addresses, timeout, connectionRetry, executionRetry,
110  enableSSL, sslParam);
111  return true;
112  }
113 
114  public StorageClient setUser(String user) {
115  this.user = user;
116  return this;
117  }
118 
119  public StorageClient setPassword(String password) {
120  this.password = password;
121  return this;
122  }
123 
124 
136  public ScanVertexResultIterator scanVertex(String spaceName, String tagName,
137  List<String> returnCols) {
138  return scanVertex(spaceName, tagName, returnCols, DEFAULT_LIMIT);
139  }
140 
153  public ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName,
154  List<String> returnCols) {
155  return scanVertex(spaceName, part, tagName, returnCols, DEFAULT_LIMIT);
156  }
157 
167  public ScanVertexResultIterator scanVertex(String spaceName, String tagName) {
168  return scanVertex(spaceName, tagName, DEFAULT_LIMIT);
169  }
170 
181  public ScanVertexResultIterator scanVertex(String spaceName, int part, String tagName) {
182  return scanVertex(spaceName, part, tagName, DEFAULT_LIMIT);
183  }
184 
196  public ScanVertexResultIterator scanVertex(String spaceName,
197  String tagName,
198  List<String> returnCols,
199  int limit) {
200  return scanVertex(spaceName, tagName, returnCols, limit, DEFAULT_START_TIME,
201  DEFAULT_END_TIME);
202  }
203 
216  public ScanVertexResultIterator scanVertex(String spaceName,
217  int part,
218  String tagName,
219  List<String> returnCols,
220  int limit) {
221  return scanVertex(spaceName, part, tagName, returnCols, limit, DEFAULT_START_TIME,
222  DEFAULT_END_TIME);
223  }
224 
235  public ScanVertexResultIterator scanVertex(String spaceName,
236  String tagName,
237  int limit) {
238  return scanVertex(spaceName, tagName, limit, DEFAULT_START_TIME, DEFAULT_END_TIME);
239  }
240 
252  public ScanVertexResultIterator scanVertex(String spaceName,
253  int part,
254  String tagName,
255  int limit) {
256  return scanVertex(spaceName, part, tagName,
257  limit, DEFAULT_START_TIME, DEFAULT_END_TIME);
258  }
259 
275  public ScanVertexResultIterator scanVertex(String spaceName,
276  String tagName,
277  List<String> returnCols,
278  int limit,
279  long startTime,
280  long endTime) {
281  return scanVertex(spaceName, tagName, returnCols, limit, startTime, endTime,
282  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
283  }
284 
301  public ScanVertexResultIterator scanVertex(String spaceName,
302  int part,
303  String tagName,
304  List<String> returnCols,
305  int limit,
306  long startTime,
307  long endTime) {
308  return scanVertex(spaceName, part, tagName, returnCols, limit, startTime, endTime,
309  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
310  }
311 
326  public ScanVertexResultIterator scanVertex(String spaceName,
327  String tagName,
328  int limit,
329  long startTime,
330  long endTime) {
331  return scanVertex(spaceName, tagName, limit, startTime, endTime,
332  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
333  }
334 
349  public ScanVertexResultIterator scanVertex(String spaceName,
350  int part,
351  String tagName,
352  int limit,
353  long startTime,
354  long endTime) {
355  return scanVertex(spaceName,
356  part,
357  tagName,
358  new ArrayList<>(),
359  limit,
360  startTime,
361  endTime,
362  DEFAULT_ALLOW_PART_SUCCESS,
363  DEFAULT_ALLOW_READ_FOLLOWER);
364  }
365 
366 
388  public ScanVertexResultIterator scanVertex(String spaceName,
389  String tagName,
390  List<String> returnCols,
391  int limit,
392  long startTime,
393  long endTime,
394  boolean allowPartSuccess,
395  boolean allowReadFromFollower) {
396  List<Integer> parts = metaManager.getSpaceParts(spaceName);
397  if (parts.isEmpty()) {
398  throw new IllegalArgumentException("No valid part in space " + spaceName);
399  }
400  return scanVertex(
401  spaceName,
402  parts,
403  tagName,
404  returnCols,
405  false,
406  limit,
407  startTime,
408  endTime,
409  allowPartSuccess,
410  allowReadFromFollower);
411  }
412 
413 
436  public ScanVertexResultIterator scanVertex(String spaceName,
437  int part,
438  String tagName,
439  List<String> returnCols,
440  int limit,
441  long startTime,
442  long endTime,
443  boolean allowPartSuccess,
444  boolean allowReadFromFollower) {
445  return scanVertex(
446  spaceName,
447  Arrays.asList(part),
448  tagName,
449  returnCols,
450  false,
451  limit,
452  startTime,
453  endTime,
454  allowPartSuccess,
455  allowReadFromFollower);
456  }
457 
458 
479  public ScanVertexResultIterator scanVertex(String spaceName,
480  String tagName,
481  int limit,
482  long startTime,
483  long endTime,
484  boolean allowPartSuccess,
485  boolean allowReadFromFollower) {
486  List<Integer> parts = metaManager.getSpaceParts(spaceName);
487  if (parts.isEmpty()) {
488  throw new IllegalArgumentException("No valid part in space " + spaceName);
489  }
490  return scanVertex(
491  spaceName,
492  parts,
493  tagName,
494  new ArrayList<>(),
495  true,
496  limit,
497  startTime,
498  endTime,
499  allowPartSuccess,
500  allowReadFromFollower);
501  }
502 
523  public ScanVertexResultIterator scanVertex(String spaceName,
524  int part,
525  String tagName,
526  int limit,
527  long startTime,
528  long endTime,
529  boolean allowPartSuccess,
530  boolean allowReadFromFollower) {
531  return scanVertex(
532  spaceName,
533  Arrays.asList(part),
534  tagName,
535  new ArrayList<>(),
536  true,
537  limit,
538  startTime,
539  endTime,
540  allowPartSuccess,
541  allowReadFromFollower);
542  }
543 
544  private ScanVertexResultIterator scanVertex(String spaceName,
545  List<Integer> parts,
546  String tagName,
547  List<String> returnCols,
548  boolean noColumns,
549  int limit,
550  long startTime,
551  long endTime,
552  boolean allowPartSuccess,
553  boolean allowReadFromFollower) {
554  if (spaceName == null || spaceName.trim().isEmpty()) {
555  throw new IllegalArgumentException("space name is empty.");
556  }
557  if (tagName == null || tagName.trim().isEmpty()) {
558  throw new IllegalArgumentException("tag name is empty");
559  }
560  if (noColumns && returnCols == null) {
561  throw new IllegalArgumentException("returnCols is null");
562  }
563 
564  Set<PartScanInfo> partScanInfoSet = new HashSet<>();
565  for (int part : parts) {
566  HostAddr leader = metaManager.getLeader(spaceName, part);
567  partScanInfoSet.add(new PartScanInfo(part, new HostAddress(leader.getHost(),
568  leader.getPort())));
569  }
570  List<HostAddress> addrs = new ArrayList<>();
571  for (HostAddr addr : metaManager.listHosts()) {
572  addrs.add(new HostAddress(addr.getHost(), addr.getPort()));
573  }
574 
575  long tag = metaManager.getTag(spaceName, tagName).getTag_id();
576  List<byte[]> props = new ArrayList<>();
577  props.add("_vid".getBytes());
578  if (!noColumns) {
579  if (returnCols.size() == 0) {
580  Schema schema = metaManager.getTag(spaceName, tagName).getSchema();
581  for (ColumnDef columnDef : schema.getColumns()) {
582  props.add(columnDef.getName());
583  }
584  } else {
585  for (String prop : returnCols) {
586  props.add(prop.getBytes());
587  }
588  }
589  }
590  VertexProp vertexCols = new VertexProp((int) tag, props);
591  List<VertexProp> vertexProps = Arrays.asList(vertexCols);
592  ScanVertexRequest request = new ScanVertexRequest();
593  request
594  .setSpace_id(getSpaceId(spaceName))
595  .setReturn_columns(vertexProps)
596  .setLimit(limit)
597  .setStart_time(startTime)
598  .setEnd_time(endTime)
599  .setEnable_read_from_follower(allowReadFromFollower);
600 
601  return doScanVertex(spaceName, tagName, partScanInfoSet, request, addrs, allowPartSuccess);
602  }
603 
604 
616  private ScanVertexResultIterator doScanVertex(String spaceName,
617  String tagName,
618  Set<PartScanInfo> partScanInfoSet,
619  ScanVertexRequest request,
620  List<HostAddress> addrs,
621  boolean allowPartSuccess) {
622  if (addrs == null || addrs.isEmpty()) {
623  throw new IllegalArgumentException("storage hosts is empty.");
624  }
625 
626  return new ScanVertexResultIterator.ScanVertexResultBuilder()
627  .withMetaClient(metaManager)
628  .withPool(pool)
629  .withPartScanInfo(partScanInfoSet)
630  .withRequest(request)
631  .withAddresses(addrs)
632  .withSpaceName(spaceName)
633  .withTagName(tagName)
634  .withPartSuccess(allowPartSuccess)
635  .withUser(user)
636  .withPassword(password)
637  .build();
638  }
639 
640 
651  public ScanEdgeResultIterator scanEdge(String spaceName, String edgeName,
652  List<String> returnCols) {
653 
654  return scanEdge(spaceName, edgeName, returnCols, DEFAULT_LIMIT);
655  }
656 
668  public ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName,
669  List<String> returnCols) {
670 
671  return scanEdge(spaceName, part, edgeName, returnCols, DEFAULT_LIMIT);
672  }
673 
683  public ScanEdgeResultIterator scanEdge(String spaceName, String edgeName) {
684  return scanEdge(spaceName, edgeName, DEFAULT_LIMIT);
685  }
686 
697  public ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName) {
698  return scanEdge(spaceName, part, edgeName, DEFAULT_LIMIT);
699  }
700 
713  public ScanEdgeResultIterator scanEdge(String spaceName, String edgeName,
714  List<String> returnCols, int limit) {
715  return scanEdge(spaceName, edgeName, returnCols, limit, DEFAULT_START_TIME,
716  DEFAULT_END_TIME);
717  }
718 
731  public ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName,
732  List<String> returnCols, int limit) {
733  return scanEdge(spaceName, part, edgeName, returnCols, limit, DEFAULT_START_TIME,
734  DEFAULT_END_TIME);
735  }
736 
748  public ScanEdgeResultIterator scanEdge(String spaceName, String edgeName, int limit) {
749  return scanEdge(spaceName, edgeName, limit, DEFAULT_START_TIME, DEFAULT_END_TIME);
750  }
751 
764  public ScanEdgeResultIterator scanEdge(String spaceName, int part, String edgeName, int limit) {
765  return scanEdge(spaceName, part, edgeName, limit, DEFAULT_START_TIME, DEFAULT_END_TIME);
766  }
767 
780  public ScanEdgeResultIterator scanEdge(String spaceName,
781  String edgeName,
782  List<String> returnCols,
783  int limit,
784  long startTime,
785  long endTime) {
786  return scanEdge(spaceName, edgeName, returnCols, limit, startTime, endTime,
787  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
788  }
789 
807  public ScanEdgeResultIterator scanEdge(String spaceName,
808  int part,
809  String edgeName,
810  List<String> returnCols,
811  int limit,
812  long startTime,
813  long endTime) {
814  return scanEdge(spaceName, part, edgeName, returnCols, limit, startTime, endTime,
815  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
816  }
817 
833  public ScanEdgeResultIterator scanEdge(String spaceName,
834  String edgeName,
835  int limit,
836  long startTime,
837  long endTime) {
838  return scanEdge(spaceName, edgeName, limit, startTime, endTime,
839  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
840  }
841 
858  public ScanEdgeResultIterator scanEdge(String spaceName,
859  int part,
860  String edgeName,
861  int limit,
862  long startTime,
863  long endTime) {
864  return scanEdge(spaceName, part, edgeName, limit, startTime, endTime,
865  DEFAULT_ALLOW_PART_SUCCESS, DEFAULT_ALLOW_READ_FOLLOWER);
866  }
867 
868 
887  public ScanEdgeResultIterator scanEdge(String spaceName,
888  String edgeName,
889  List<String> returnCols,
890  int limit,
891  long startTime,
892  long endTime,
893  boolean allowPartSuccess,
894  boolean allowReadFromFollower) {
895 
896  List<Integer> parts = metaManager.getSpaceParts(spaceName);
897  if (parts.isEmpty()) {
898  throw new IllegalArgumentException("No valid part in space " + spaceName);
899  }
900 
901  return scanEdge(spaceName, parts, edgeName, returnCols, false,
902  limit, startTime, endTime, allowPartSuccess, allowReadFromFollower);
903  }
904 
924  public ScanEdgeResultIterator scanEdge(String spaceName,
925  int part,
926  String edgeName,
927  List<String> returnCols,
928  int limit,
929  long startTime,
930  long endTime,
931  boolean allowPartSuccess,
932  boolean allowReadFromFollower) {
933  return scanEdge(spaceName, Arrays.asList(part), edgeName, returnCols, false,
934  limit, startTime, endTime, allowPartSuccess, allowReadFromFollower);
935  }
936 
937 
956  public ScanEdgeResultIterator scanEdge(String spaceName,
957  String edgeName,
958  int limit,
959  long startTime,
960  long endTime,
961  boolean allowPartSuccess,
962  boolean allowReadFromFollower) {
963 
964  List<Integer> parts = metaManager.getSpaceParts(spaceName);
965  if (parts.isEmpty()) {
966  throw new IllegalArgumentException("No valid part in space " + spaceName);
967  }
968  return scanEdge(spaceName, parts, edgeName, new ArrayList<>(), true,
969  limit, startTime, endTime, allowPartSuccess, allowReadFromFollower);
970  }
971 
972 
992  public ScanEdgeResultIterator scanEdge(String spaceName,
993  int part,
994  String edgeName,
995  int limit,
996  long startTime,
997  long endTime,
998  boolean allowPartSuccess,
999  boolean allowReadFromFollower) {
1000  return scanEdge(spaceName, Arrays.asList(part), edgeName, new ArrayList<>(), true,
1001  limit, startTime, endTime, allowPartSuccess, allowReadFromFollower);
1002  }
1003 
1004 
1005  private ScanEdgeResultIterator scanEdge(String spaceName,
1006  List<Integer> parts,
1007  String edgeName,
1008  List<String> returnCols,
1009  boolean noColumns,
1010  int limit,
1011  long startTime,
1012  long endTime,
1013  boolean allowPartSuccess,
1014  boolean allowReadFromFollower) {
1015  if (spaceName == null || spaceName.trim().isEmpty()) {
1016  throw new IllegalArgumentException("space name is empty.");
1017  }
1018  if (edgeName == null || edgeName.trim().isEmpty()) {
1019  throw new IllegalArgumentException("edge name is empty");
1020  }
1021  if (noColumns && returnCols == null) {
1022  throw new IllegalArgumentException("returnCols is null");
1023  }
1024 
1025  Set<PartScanInfo> partScanInfoSet = new HashSet<>();
1026  for (int part : parts) {
1027  HostAddr leader = metaManager.getLeader(spaceName, part);
1028  partScanInfoSet.add(new PartScanInfo(part, new HostAddress(leader.getHost(),
1029  leader.getPort())));
1030  }
1031  List<HostAddress> addrs = new ArrayList<>();
1032  for (HostAddr addr : metaManager.listHosts()) {
1033  addrs.add(new HostAddress(addr.getHost(), addr.getPort()));
1034  }
1035  List<byte[]> props = new ArrayList<>();
1036  props.add("_src".getBytes());
1037  props.add("_dst".getBytes());
1038  props.add("_rank".getBytes());
1039  if (!noColumns) {
1040  if (returnCols.size() == 0) {
1041  Schema schema = metaManager.getEdge(spaceName, edgeName).getSchema();
1042  for (ColumnDef columnDef : schema.getColumns()) {
1043  props.add(columnDef.name);
1044  }
1045  } else {
1046  for (String prop : returnCols) {
1047  props.add(prop.getBytes());
1048  }
1049  }
1050  }
1051 
1052  long edgeId = getEdgeId(spaceName, edgeName);
1053  EdgeProp edgeCols = new EdgeProp((int) edgeId, props);
1054  List<EdgeProp> edgeProps = Arrays.asList(edgeCols);
1055 
1056  ScanEdgeRequest request = new ScanEdgeRequest();
1057  request
1058  .setSpace_id(getSpaceId(spaceName))
1059  .setReturn_columns(edgeProps)
1060  .setLimit(limit)
1061  .setStart_time(startTime)
1062  .setEnd_time(endTime)
1063  .setEnable_read_from_follower(allowReadFromFollower);
1064 
1065  return doScanEdge(spaceName, edgeName, partScanInfoSet, request, addrs, allowPartSuccess);
1066  }
1067 
1068 
1080  private ScanEdgeResultIterator doScanEdge(String spaceName,
1081  String edgeName,
1082  Set<PartScanInfo> partScanInfoSet,
1083  ScanEdgeRequest request,
1084  List<HostAddress> addrs,
1085  boolean allowPartSuccess) {
1086  if (addrs == null || addrs.isEmpty()) {
1087  throw new IllegalArgumentException("storage hosts is empty.");
1088  }
1089 
1090  return new ScanEdgeResultIterator.ScanEdgeResultBuilder()
1091  .withMetaClient(metaManager)
1092  .withPool(pool)
1093  .withPartScanInfo(partScanInfoSet)
1094  .withRequest(request)
1095  .withAddresses(addrs)
1096  .withSpaceName(spaceName)
1097  .withEdgeName(edgeName)
1098  .withPartSuccess(allowPartSuccess)
1099  .withUser(user)
1100  .withPassword(password)
1101  .build();
1102  }
1103 
1104 
1108  public void close() {
1109  if (pool != null) {
1110  pool.close();
1111  }
1112  if (connection != null) {
1113  connection.close();
1114  }
1115  if (metaManager != null) {
1116  metaManager.close();
1117  }
1118  }
1119 
1120 
1127  return this.connection;
1128  }
1129 
1130 
1137  private int getSpaceId(String spaceName) {
1138  return metaManager.getSpaceId(spaceName);
1139  }
1140 
1148  private long getEdgeId(String spaceName, String edgeName) {
1149  return metaManager.getEdge(spaceName, edgeName).getEdge_type();
1150  }
1151 
1152  private static final int DEFAULT_LIMIT = 1000;
1153  private static final long DEFAULT_START_TIME = 0;
1154  private static final long DEFAULT_END_TIME = Long.MAX_VALUE;
1155  private static final boolean DEFAULT_ALLOW_PART_SUCCESS = false;
1156  private static final boolean DEFAULT_ALLOW_READ_FOLLOWER = true;
1157 }
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.