use of org.neo4j.collection.primitive.PrimitiveIntIterator in project neo4j by neo4j.
the class GraphPropertiesProxy method getPropertyKeys.
@Override
public Iterable<String> getPropertyKeys() {
try (Statement statement = actions.statement()) {
List<String> keys = new ArrayList<>();
PrimitiveIntIterator properties = statement.readOperations().graphGetPropertyKeys();
while (properties.hasNext()) {
keys.add(statement.readOperations().propertyKeyGetName(properties.next()));
}
return keys;
} catch (PropertyKeyIdNotFoundKernelException e) {
throw new IllegalStateException("Property key retrieved through kernel API should exist.", e);
}
}
use of org.neo4j.collection.primitive.PrimitiveIntIterator in project neo4j by neo4j.
the class ForsetiClient method describeWaitList.
public String describeWaitList() {
StringBuilder sb = new StringBuilder(format("%nClient[%d] waits for [", id()));
PrimitiveIntIterator iter = waitList.iterator();
for (boolean first = true; iter.hasNext(); ) {
int next = iter.next();
if (next == clientId) {
// Skip our own id from the wait list, that's an implementation detail
continue;
}
sb.append((!first) ? "," : "").append(next);
first = false;
}
sb.append("]");
return sb.toString();
}
use of org.neo4j.collection.primitive.PrimitiveIntIterator in project neo4j by neo4j.
the class GraphPropertiesProxy method getAllProperties.
@Override
public Map<String, Object> getAllProperties() {
try (Statement statement = actions.statement()) {
Map<String, Object> properties = new HashMap<>();
ReadOperations readOperations = statement.readOperations();
PrimitiveIntIterator propertyKeys = readOperations.graphGetPropertyKeys();
while (propertyKeys.hasNext()) {
int propertyKeyId = propertyKeys.next();
properties.put(readOperations.propertyKeyGetName(propertyKeyId), readOperations.graphGetProperty(propertyKeyId));
}
return properties;
} catch (PropertyKeyIdNotFoundKernelException e) {
throw new IllegalStateException("Property key retrieved through kernel API should exist.", e);
}
}
use of org.neo4j.collection.primitive.PrimitiveIntIterator in project neo4j by neo4j.
the class NodeProxy method getPropertyKeys.
@Override
public Iterable<String> getPropertyKeys() {
try (Statement statement = actions.statement()) {
List<String> keys = new ArrayList<>();
PrimitiveIntIterator properties = statement.readOperations().nodeGetPropertyKeys(getId());
while (properties.hasNext()) {
keys.add(statement.readOperations().propertyKeyGetName(properties.next()));
}
return keys;
} catch (EntityNotFoundException e) {
throw new NotFoundException("Node not found", e);
} catch (PropertyKeyIdNotFoundKernelException e) {
throw new IllegalStateException("Property key retrieved through kernel API should exist.", e);
}
}
use of org.neo4j.collection.primitive.PrimitiveIntIterator in project neo4j by neo4j.
the class RelationshipProxy method getPropertyKeys.
@Override
public Iterable<String> getPropertyKeys() {
try (Statement statement = actions.statement()) {
List<String> keys = new ArrayList<>();
PrimitiveIntIterator properties = statement.readOperations().relationshipGetPropertyKeys(getId());
while (properties.hasNext()) {
keys.add(statement.readOperations().propertyKeyGetName(properties.next()));
}
return keys;
} catch (EntityNotFoundException e) {
throw new NotFoundException("Relationship not found", e);
} catch (PropertyKeyIdNotFoundKernelException e) {
throw new IllegalStateException("Property key retrieved through kernel API should exist.");
}
}
Aggregations