Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2018-2020 "Graph Foundation,"
* Graph Foundation, Inc. [https://graphfoundation.org]
*
* This file is part of ONgDB.
*
* ONgDB is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
/*
* Copyright (c) 2002-2020 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* Neo4j is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*/
package org.neo4j.unsafe.batchinsert;
import java.util.Map;
import org.neo4j.graphdb.Label;
import org.neo4j.graphdb.RelationshipType;
import org.neo4j.graphdb.schema.ConstraintCreator;
import org.neo4j.graphdb.schema.IndexCreator;
/**
* The batch inserter drops support for transactions and concurrency in favor
* of insertion speed. When done using the batch inserter {@link #shutdown()}
* must be invoked and complete successfully for the ONgDB store to be in
* consistent state.
*
* Only one thread at a time may work against the batch inserter, multiple
* threads performing concurrent access have to employ synchronization.
*
* Transactions are not supported so if the JVM/machine crashes or you fail to
* invoke {@link #shutdown()} before JVM exits the ONgDB store can be considered
* being in non consistent state and the insertion has to be re-done from
* scratch.
*/
public interface BatchInserter
{
/**
* Creates a node assigning next available id to id and also adds any
* properties supplied.
*
* @param properties a map containing properties or null if no
* properties should be added.
* @param labels a list of labels to initially create the node with.
*
* @return The id of the created node.
*/
long createNode( Map properties, Label... labels );
/**
* Creates a node with supplied id and properties. If a node with the given
* id exist a runtime exception will be thrown.
*
* @param id the id of the node to create.
* @param properties map containing properties or null if no
* properties should be added.
* @param labels a list of labels to initially create the node with.
*/
void createNode( long id, Map properties, Label... labels );
/**
* Checks if a node with the given id exists.
*
* @param nodeId the id of the node.
* @return true if the node exists.
*/
boolean nodeExists( long nodeId );
/**
* Sets the properties of a node. This method will remove any properties
* already existing and replace it with properties in the supplied map.
*
* For best performance try supply all the nodes properties upon creation
* of the node. This method will delete any existing properties so using it
* together with {@link #getNodeProperties(long)} will have bad performance.
*
* @param node the id of the node.
* @param properties map containing the properties or null to
* clear all properties.
*/
void setNodeProperties( long node, Map properties );
/**
* Returns true iff the node with id {@code node} has a property with name
* {@code propertyName}.
*
* @param node The node id of the node to check.
* @param propertyName The property name to check for
* @return True if the node has the named property - false otherwise.
*/
boolean nodeHasProperty( long node, String propertyName );
/**
* Replaces any existing labels for the given node with the supplied list of labels.
*
* @param node the node to set labels for.
* @param labels the labels to set for the node.
*/
void setNodeLabels( long node, Label... labels );
/**
* @param node the node to get labels for.
* @return all labels for the given node.
*/
Iterable