Ejemplo n.º 1
0
        /// <summary>
        /// Gets a Graph from the Dataset that can be modified.
        /// </summary>
        /// <param name="graphUri">Graph URI.</param>
        /// <returns></returns>
        public sealed override IGraph GetModifiableGraph(Uri graphUri)
        {
            if (!_modifiableGraphs.HasGraph(graphUri))
            {
                IGraph current = GetModifiableGraphInternal(graphUri);
                if (!_modifiableGraphs.HasGraph(current.BaseUri))
                {
                    _modifiableGraphs.Add(current);
                }
                graphUri = current.BaseUri;
            }
            ITransactionalGraph existing = (ITransactionalGraph)_modifiableGraphs[graphUri];

            _actions.Add(new GraphPersistenceAction(existing, GraphPersistenceActionType.Modified));
            return(existing);
        }
Ejemplo n.º 2
0
        /// <summary>
        ///     Constructs a BatchGraph wrapping the provided baseGraph, using the specified buffer size and expecting vertex ids of
        ///     the specified IdType. Supplying vertex ids which do not match this type will throw exceptions.
        /// </summary>
        /// <param name="graph">Graph to be wrapped</param>
        /// <param name="type"> Type of vertex id expected. This information is used to optimize the vertex cache memory footprint.</param>
        /// <param name="bufferSize">Defines the number of vertices and edges loaded before starting a new transaction. The larger this value,
        /// the more memory is required but the faster the loading process.</param>
        public BatchGraph(ITransactionalGraph graph, VertexIdType type, long bufferSize)
        {
            if (graph == null)
            {
                throw new ArgumentNullException(nameof(graph));
            }
            if (bufferSize <= 0)
            {
                throw new ArgumentException("bufferSize must be greater than zero");
            }

            _baseGraph           = graph;
            _bufferSize          = bufferSize;
            _vertexIdKey         = null;
            _edgeIdKey           = null;
            _cache               = type.GetVertexCache();
            _remainingBufferSize = _bufferSize;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new Graph Persistence action
 /// </summary>
 /// <param name="g">Graph</param>
 /// <param name="action">Action Type</param>
 public GraphPersistenceAction(ITransactionalGraph g, GraphPersistenceActionType action)
 {
     this._g = g;
     this._action = action;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Creates a new Graph Persistence action
 /// </summary>
 /// <param name="g">Graph</param>
 /// <param name="action">Action Type</param>
 public GraphPersistenceAction(ITransactionalGraph g, GraphPersistenceActionType action)
 {
     this._g      = g;
     this._action = action;
 }