Skip to content

Commit

Permalink
Fix Terracotta-OSS#9 - Expose Cluster configuration using IClientTest…
Browse files Browse the repository at this point in the history
…Environment
  • Loading branch information
ramsai1729 authored and jd0-sag committed Dec 20, 2016
1 parent 7c7ac71 commit 0333aa7
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ public interface IClientTestEnvironment {
* @return The 0-indexed value uniquely specifying this client (always >= 0, < getTotalClientCount()).
*/
public int getThisClientIndex();

/**
* @return {@link IClusterInfo} which provides information about connecting cluster
*/
public IClusterInfo getClusterInfo();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package org.terracotta.passthrough;

import java.util.Collection;

/**
* An abstraction to expose cluster information to clients for e.g. server configuration etc
*
* @author vmad
*/
public interface IClusterInfo {

/**
* @param name server name to identify the server
* @return corresponding {@link IServerInfo}
*/
IServerInfo getServerInfo(String name);

/**
* @return A collection {@link IServerInfo} for all servers in this stripe
*/
Collection<IServerInfo> getServersInfo();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package org.terracotta.passthrough;

/**
* Provides a server information like configured server port and group port etc
*
* @author vmad
*/
public interface IServerInfo {

/**
* @return name of this server
*/
String getName();

/**
* @return configured server port for this server
*/
int getServerPort();

/**
* @return configured server group port for this server
*/
int getGroupPort();
}

0 comments on commit 0333aa7

Please sign in to comment.