public class

KnapsackSearchPathImpl

extends Object
implements KnapsackSearchPath
java.lang.Object
   ↳ org.apache.helix.controller.strategy.knapsack.KnapsackSearchPathImpl

Class Overview

Implementation of KnapsackSearchPath

Based on the C++ knapsack solver in Google's or-tools package.

Summary

Public Constructors
KnapsackSearchPathImpl(KnapsackSearchNode from, KnapsackSearchNode to)
Create a search path between nodes in a knapsack
Public Methods
KnapsackSearchNode from()
Get the source node
void init()
Initialize the path
KnapsackSearchNode moveUpToDepth(KnapsackSearchNode node, int depth)
Get an ancestor of a given search node
KnapsackSearchNode to()
Get the destination node
KnapsackSearchNode via()
Get the intermediate node
[Expand]
Inherited Methods
From class java.lang.Object
From interface org.apache.helix.controller.strategy.knapsack.KnapsackSearchPath

Public Constructors

public KnapsackSearchPathImpl (KnapsackSearchNode from, KnapsackSearchNode to)

Create a search path between nodes in a knapsack

Parameters
from the source node
to the destination node

Public Methods

public KnapsackSearchNode from ()

Get the source node

Returns
  • starting KnapsackSearchNode

public void init ()

Initialize the path

public KnapsackSearchNode moveUpToDepth (KnapsackSearchNode node, int depth)

Get an ancestor of a given search node

Parameters
node the search node
depth the depth of the ancestor
Returns
  • the ancestor node

public KnapsackSearchNode to ()

Get the destination node

Returns
  • terminating KnapsackSearchNode

public KnapsackSearchNode via ()

Get the intermediate node

Returns
  • KnapsackSearchNode between source and destination