public class OGraphBatchInsertBasic extends Object
Typical usage:
OGraphBatchInsertSimple batch = new OGraphBatchInsertSimple("plocal:your/db", "admin", "admin");
batch.begin();
batch.createEdge(0L, 1L);
batch.createEdge(0L, 2L);
...
batch.end();
There is no need to create vertices before connecting them:
batch.createVertex(0L);
batch.createVertex(1L);
batch.createEdge(0L, 1L);
is equivalent to (but less performing than)
batch.createEdge(0L, 1L);
batch.createVertex() is needed only if you want to create unconnected vertices.
Constructor and Description |
---|
OGraphBatchInsertBasic(String iDbURL)
Creates a new batch insert procedure by using admin user.
|
OGraphBatchInsertBasic(String iDbURL,
String iUserName,
String iPassword)
Creates a new batch insert procedure.
|
Modifier and Type | Method and Description |
---|---|
void |
begin()
Creates the database (if it does not exist) and initializes batch operations.
|
void |
createEdge(Long from,
Long to)
Creates a new edge between two vertices.
|
void |
createVertex(Long v)
Creates a new vertex
|
void |
end()
Flushes data to db and closes the db.
|
int |
getAverageEdgeNumberPerNode() |
int |
getBonsaiThreshold() |
String |
getEdgeClass() |
int |
getEstimatedEntries()
Returns the estimated number of entries.
|
String |
getIdPropertyName() |
int |
getParallel() |
String |
getVertexClass() |
void |
setAverageEdgeNumberPerNode(int averageEdgeNumberPerNode)
configures the average number of edges per node (for optimization).
|
void |
setBonsaiThreshold(int bonsaiThreshold)
Sets the threshold for passing from emdedded RidBag to SBTreeBonsai implementation, in number
of edges (low level optimization).
|
void |
setEdgeClass(String edgeClass) |
void |
setEstimatedEntries(int estimatedEntries)
Sets the estimated number of entries, 0 for auto-resize (default).
|
void |
setIdPropertyName(String idPropertyName) |
void |
setParallel(int parallel)
sets the number of parallel threads to be used for batch insert
|
void |
setVertexClass(String vertexClass) |
public OGraphBatchInsertBasic(String iDbURL)
iDbURL
- db connection URL (plocal:/your/db/path)public OGraphBatchInsertBasic(String iDbURL, String iUserName, String iPassword)
iDbURL
- db connection URL (plocal:/your/db/path)iUserName
- db user name (use admin for new db)iPassword
- db password (use admin for new db)public void begin()
public void end()
public void createVertex(Long v)
v
- the vertex IDpublic void createEdge(Long from, Long to)
from
- id of the vertex that is starting point of the edgeto
- id of the vertex that is end point of the edgepublic int getAverageEdgeNumberPerNode()
public void setAverageEdgeNumberPerNode(int averageEdgeNumberPerNode)
averageEdgeNumberPerNode
- public String getIdPropertyName()
public void setIdPropertyName(String idPropertyName)
idPropertyName
- the property name where ids are written on verticespublic String getEdgeClass()
public void setEdgeClass(String edgeClass)
edgeClass
- the edge class namepublic String getVertexClass()
public void setVertexClass(String vertexClass)
vertexClass
- the vertex class namepublic int getBonsaiThreshold()
public void setBonsaiThreshold(int bonsaiThreshold)
See OGlobalConfiguration.RID_BAG_EMBEDDED_TO_SBTREEBONSAI_THRESHOLD}
public int getEstimatedEntries()
public void setEstimatedEntries(int estimatedEntries)
public int getParallel()
public void setParallel(int parallel)
parallel
- number of threads (default 4)Copyright © 2009–2020 OrientDB. All rights reserved.