com.arangodb.entity.CollectionPropertiesEntity Java Examples
The following examples show how to use
com.arangodb.entity.CollectionPropertiesEntity.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ArangoGraphTest.java From arangodb-java-driver with Apache License 2.0 | 6 votes |
@Test public void getInfo() { final GraphEntity info = graph.getInfo(); assertThat(info, is(notNullValue())); assertThat(info.getName(), is(GRAPH_NAME)); assertThat(info.getEdgeDefinitions().size(), is(2)); final Iterator<EdgeDefinition> iterator = info.getEdgeDefinitions().iterator(); final EdgeDefinition e1 = iterator.next(); assertThat(e1.getCollection(), is(EDGE_COL_1)); assertThat(e1.getFrom(), hasItem(VERTEX_COL_1)); assertThat(e1.getTo(), hasItem(VERTEX_COL_2)); final EdgeDefinition e2 = iterator.next(); assertThat(e2.getCollection(), is(EDGE_COL_2)); assertThat(e2.getFrom(), hasItem(VERTEX_COL_2)); assertThat(e2.getTo(), hasItems(VERTEX_COL_1, VERTEX_COL_3)); assertThat(info.getOrphanCollections(), is(empty())); if (isCluster()) { for (final String collection : new String[]{EDGE_COL_1, EDGE_COL_2, VERTEX_COL_1, VERTEX_COL_2}) { final CollectionPropertiesEntity properties = db.collection(collection).getProperties(); assertThat(properties.getReplicationFactor(), is(REPLICATION_FACTOR)); assertThat(properties.getNumberOfShards(), is(NUMBER_OF_SHARDS)); } } }
Example #2
Source File: DefaultCollectionOperations.java From spring-data with Apache License 2.0 | 5 votes |
@Override public CollectionPropertiesEntity getProperties() throws DataAccessException { try { return collection.getProperties(); } catch (final ArangoDBException e) { throw translateExceptionIfPossible(e); } }
Example #3
Source File: CollectionOperations.java From spring-data with Apache License 2.0 | 2 votes |
/** * Reads the properties of the specified collection * * @return properties of the collection * @throws DataAccessException */ CollectionPropertiesEntity getProperties() throws DataAccessException;