securegraph

70 views
Skip to first unread message
Assigned to joe.m....@gmail.com by me

Massi Natale

unread,
Feb 12, 2015, 8:10:22 AM2/12/15
to lum...@googlegroups.com
I have an error when I try to read data from securegraph. I attach error and code.
I added the "securegraph-accumulo-iterators" in my sbt, I have not found info how use it.
Thanks
Massimo

This is the error:

Exception in thread "main" java.lang.RuntimeException: org.apache.accumulo.core.client.AccumuloSecurityException: Error BAD_AUTHORIZATIONS for user root - The user does not have the specified authorizations assigned
at org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator.hasNext(TabletServerBatchReaderIterator.java:209)
at org.securegraph.util.LookAheadIterable$1.loadNext(LookAheadIterable.java:43)
at org.securegraph.util.LookAheadIterable$1.hasNext(LookAheadIterable.java:18)
at eu.unicredit.knowledgegraph.Example01_CreateVertex.main(Example01_CreateVertex.java:48)
Caused by: org.apache.accumulo.core.client.AccumuloSecurityException: Error BAD_AUTHORIZATIONS for user root - The user does not have the specified authorizations assigned
at org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator.doLookup(TabletServerBatchReaderIterator.java:709)
at org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator$QueryTask.run(TabletServerBatchReaderIterator.java:369)
at org.apache.accumulo.trace.instrument.TraceRunnable.run(TraceRunnable.java:47)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.accumulo.trace.instrument.TraceRunnable.run(TraceRunnable.java:47)
at org.apache.accumulo.core.util.LoggingRunnable.run(LoggingRunnable.java:34)
at java.lang.Thread.run(Thread.java:745)
Caused by: ThriftSecurityException(user:root, code:BAD_AUTHORIZATIONS)
at org.apache.accumulo.core.tabletserver.thrift.TabletClientService$startMultiScan_result$startMultiScan_resultStandardScheme.read(TabletClientService.java:8165)
at org.apache.accumulo.core.tabletserver.thrift.TabletClientService$startMultiScan_result$startMultiScan_resultStandardScheme.read(TabletClientService.java:8142)
at org.apache.accumulo.core.tabletserver.thrift.TabletClientService$startMultiScan_result.read(TabletClientService.java:8081)
at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78)
at org.apache.accumulo.core.tabletserver.thrift.TabletClientService$Client.recv_startMultiScan(TabletClientService.java:294)
at org.apache.accumulo.core.tabletserver.thrift.TabletClientService$Client.startMultiScan(TabletClientService.java:274)
at org.apache.accumulo.core.client.impl.TabletServerBatchReaderIterator.doLookup(TabletServerBatchReaderIterator.java:652)
... 7 more


This is my code:

public class Example01_CreateVertex {
private static Logger log = Logger.getLogger(Example01_CreateVertex.class);
public static void main(String[] args) throws Exception {

Graph graph = Util.createLightGraph();

Visibility visA = new Visibility("a");
Visibility visB = new Visibility("b");
Visibility visAandB = new Visibility("a&b");
Authorizations authA = new AccumuloAuthorizations("a");

/* add a vertex with properties */
Vertex v = graph.prepareVertex("Micky Mouse", visAandB)
.setProperty("name", "Micky", visA)
.setProperty("surname", "Mouse", visB).save(authA);

/* add 2 vertex and the edge */
Vertex v1 = graph.addVertex("Micky Mouse", visA, authA);
Vertex v2 = graph.addVertex("Donald Duck", visA, authA);
Edge e = graph.addEdge(v1, v2, "is_friend", visA, authA);
/* add a edge */
               graph.addEdge("edgeId", v1, v, "equal", visA, authA);

System.out.println("--------------- -> end add data");

/* read edges */
Iterable<Edge> edges = v1.getEdges(Direction.BOTH, authA);
for (Edge es : edges) {
System.out.println(es.getLabel());
} // for
/* query a vertex */
Iterable<Vertex> vertices = graph.query("Micky Mouse", authA).vertices();
Iterator<Vertex> ed = vertices.iterator();

System.out.println("--------------- -> end query graph");
graph.flush();
} // main
} // class

Joe Ferner

unread,
Feb 12, 2015, 1:04:48 PM2/12/15
to lum...@googlegroups.com
You'll need to first add the a and b authorizations via the accumulo shell (see the addauths command) or the accumulo API.

Massi Natale

unread,
Feb 12, 2015, 4:19:29 PM2/12/15
to lum...@googlegroups.com
Thanks Joe. Can you give me a link with an example of how to use the Accumulo API?
Best
Massimo
Reply all
Reply to author
Forward
0 new messages