Skip to content

Commit

Permalink
tiny improve
Browse files Browse the repository at this point in the history
Change-Id: I86e7fa5776c5618033a09d1a61c6351eb98048a7
  • Loading branch information
Linary committed Oct 14, 2019
1 parent 3464734 commit 145951f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,15 +108,16 @@ public String update(@Context GraphManager manager,
public String list(@Context GraphManager manager,
@PathParam("graph") String graph,
@QueryParam("names") List<String> names) {
if (CollectionUtils.isEmpty(names)) {
boolean listAll = CollectionUtils.isEmpty(names);
if (listAll) {
LOG.debug("Graph [{}] list edge labels", graph);
} else {
LOG.debug("Graph [{}] get edge labels by names {}", graph, names);
}

HugeGraph g = graph(manager, graph);
List<EdgeLabel> labels;
if (CollectionUtils.isEmpty(names)) {
if (listAll) {
labels = g.schema().getEdgeLabels();
} else {
labels = new ArrayList<>(names.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,16 @@ public String create(@Context GraphManager manager,
public String list(@Context GraphManager manager,
@PathParam("graph") String graph,
@QueryParam("names") List<String> names) {
if (CollectionUtils.isEmpty(names)) {
boolean listAll = CollectionUtils.isEmpty(names);
if (listAll) {
LOG.debug("Graph [{}] list index labels", graph);
} else {
LOG.debug("Graph [{}] get index labels by names {}", graph, names);
}

HugeGraph g = graph(manager, graph);
List<IndexLabel> labels;
if (CollectionUtils.isEmpty(names)) {
if (listAll) {
labels = g.schema().getIndexLabels();
} else {
labels = new ArrayList<>(names.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,16 @@ public String update(@Context GraphManager manager,
public String list(@Context GraphManager manager,
@PathParam("graph") String graph,
@QueryParam("names") List<String> names) {
if (CollectionUtils.isEmpty(names)) {
boolean listAll = CollectionUtils.isEmpty(names);
if (listAll) {
LOG.debug("Graph [{}] list property keys", graph);
} else {
LOG.debug("Graph [{}] get property keys by names {}", graph, names);
}

HugeGraph g = graph(manager, graph);
List<PropertyKey> propKeys;
if (CollectionUtils.isEmpty(names)) {
if (listAll) {
propKeys = g.schema().getPropertyKeys();
} else {
propKeys = new ArrayList<>(names.size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,16 @@ public String update(@Context GraphManager manager,
public String list(@Context GraphManager manager,
@PathParam("graph") String graph,
@QueryParam("names") List<String> names) {
if (CollectionUtils.isEmpty(names)) {
boolean listAll = CollectionUtils.isEmpty(names);
if (listAll) {
LOG.debug("Graph [{}] list vertex labels", graph);
} else {
LOG.debug("Graph [{}] get vertex labels by names {}", graph, names);
}

HugeGraph g = graph(manager, graph);
List<VertexLabel> labels;
if (CollectionUtils.isEmpty(names)) {
if (listAll) {
labels = g.schema().getVertexLabels();
} else {
labels = new ArrayList<>(names.size());
Expand Down

0 comments on commit 145951f

Please sign in to comment.