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) 2013 GraphAware
*
* This file is part of GraphAware.
*
* GraphAware 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 com.graphaware.module.relcount.cache;
import com.graphaware.common.description.property.LiteralPropertiesDescription;
import com.graphaware.common.description.relationship.DetachedRelationshipDescription;
import com.graphaware.common.description.relationship.DetachedRelationshipDescriptionImpl;
import com.graphaware.common.wrapper.NodeWrapper;
import com.graphaware.module.relcount.RelationshipCountConfiguration;
import com.graphaware.runtime.RuntimeRegistry;
import org.neo4j.graphdb.Direction;
import org.neo4j.graphdb.Node;
import org.neo4j.graphdb.Relationship;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.Map;
import static com.graphaware.common.util.DirectionUtils.resolveDirection;
/**
* {@link DegreeCache} that caches degrees using {@link DegreeCachingNode}s.
*
* It has its own "cache" of {@link DegreeCachingNode}s in order to optimize database reads/writes.
*/
public class NodeBasedDegreeCache implements DegreeCache {
private static final Logger LOG = LoggerFactory.getLogger(NodeBasedDegreeCache.class);
private static final ThreadLocal