Class FileLoadBalancerPersistence

All Implemented Interfaces:
LoadBalancerPersistence

File-based persistence implementation for the state of the JPPF load-balancers. It relies on a directory structure is as follows:

 persistence_root
 |_channel_identifier1
 | |_algorithm1.data
 | |_...
 | |_algorithmP1.data
 |_...
 |_channel_identifiern
   |_algorithm1.data
   |_...
   |_algorithmPn.data

Where:

  • Each channel_identifieri represents a hash of a string concatenated from various properties of the channel. A channel represents a connection between a node and a driver for server-side load-balancing, or between a driver and a client for client-side load-balancing. This id is unique for each channel and resilient over restarts of both related peers, contrary to their uuids, which are recreated each time a component starts. Using a hash also ensures that it can be used a s a valid folder name in a file system
  • Each algorithmi prefix is the hash of the related load-balancing algorithm name. Again, it ensures it can be used to form a valid file name
  • Each algorithmi.data file represents the serialized state of the related load-balancer
Since:
6.0
Author:
Laurent Cohen
  • Field Details

  • Constructor Details

    • FileLoadBalancerPersistence

      public FileLoadBalancerPersistence()
      Initialize this persistence with the root path DEFAULT_ROOT under the current user directory.
    • FileLoadBalancerPersistence

      public FileLoadBalancerPersistence(String... paths)
      Initialize this persistence with the specified path as root directory.
      Parameters:
      paths - the root directory for this persistence.
  • Method Details