Class NodeDB

java.lang.Object
edu.duke.cs.osprey.coffee.nodedb.NodeDB
All Implemented Interfaces:
AutoCloseable

public class NodeDB extends Object implements AutoCloseable
  • Field Details

    • ServiceName

      public static final String ServiceName
      See Also:
    • confSpace

      public final MultiStateConfSpace confSpace
    • member

      public final ClusterMember member
    • file

      public final File file
    • fileBytes

      public final long fileBytes
    • memBytes

      public final long memBytes
    • broadcastNs

      public final long broadcastNs
    • scoringLog

      public final File scoringLog
    • perf

      public final NodePerformance perf
  • Method Details

    • checkSocketIOThread

      public static void checkSocketIOThread()
    • setDropHandler

      public void setDropHandler(Consumer<Stream<NodeIndex.Node>> dropHandler)
      Set a function to call when dropped nodes need to be processed. Called from the NodeDB thread, not the caller thread!
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • size

      public long size(int statei)
    • broadcast

      public void broadcast()
    • clear

      public void clear(int statei)
      Remove all the nodes from the given state
    • clearLocal

      public void clearLocal(int statei)
    • add

      public void add(int statei, List<NodeIndex.Node> nodes)
      Adds nodes to the cluster. Local storage is preferred if there's space. Next, remote storage is preferred if there's space. Otherwise, space will be evicted from local storage to make room.
    • add

      public void add(NodeIndex.Node node)
      Conveience method to add a single node. The batched version is preferred, for speed.
    • addLocal

      public void addLocal(int statei, List<NodeIndex.Node> nodes)
      Add nodes to the local store
    • addLocal

      public void addLocal(NodeIndex.Node node)
      Conveience method to add a single node to the local store. The batched version is preferred, for speed.
    • removeHighestLocal

      public void removeHighestLocal(int statei, int count, List<NodeIndex.Node> nodes)
      Removes the highest node from the local index.
    • removeHighestLocal

      public NodeIndex.Node removeHighestLocal(int statei)
      Conveience method to remove a single node. The batched version is preferred, for speed.
    • removeHigh

      public void removeHigh(int statei, int count, List<NodeIndex.Node> nodes)
      Removes high-scoring nodes from the cluster. It's not necessarily the highest-scoring nodes, due to delays in score broadcasting, but they should be pretty high.
    • removeHigh

      public NodeIndex.Node removeHigh(int statei)
      Conveience method to remove a single node. The batched version is preferred, for speed.
    • freeSpaceLocal

      public long freeSpaceLocal(int statei)
    • nodesPerBlock

      public long nodesPerBlock(int statei)
    • usage

      public float usage()
      Returns the ratio of used space to total space.