com.continuent.tungsten.replicator.shard
Class ShardManager

java.lang.Object
  extended by com.continuent.tungsten.replicator.shard.ShardManager
All Implemented Interfaces:
ShardManagerMBean

public class ShardManager
extends java.lang.Object
implements ShardManagerMBean

Version:
1.0
Author:
Stephane Giron

Constructor Summary
ShardManager(java.lang.String serviceName, java.lang.String url, java.lang.String user, java.lang.String password, java.lang.String tungstenSchema, java.lang.String tungstenTableType)
           
 
Method Summary
 void advertiseInternal()
           
 DynamicMBeanHelper createHelper()
          Returns a helper that supplies MBean metadata.
 int delete(java.util.List<java.util.Map<java.lang.String,java.lang.String>> params)
          Deletes a list of shards based on shard ids (aka shard name).
 int deleteAll()
          Deletes all shards from the shard table.
 int insert(java.util.List<java.util.Map<java.lang.String,java.lang.String>> params)
          Inserts a list of shards into the shard table.
 boolean isAlive()
          Returns true so that clients can confirm connection liveness.
 java.util.List<java.util.Map<java.lang.String,java.lang.String>> list()
          List all shards definitions
 int update(java.util.List<java.util.Map<java.lang.String,java.lang.String>> params)
          Updates a list of shards into the shard table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShardManager

public ShardManager(java.lang.String serviceName,
                    java.lang.String url,
                    java.lang.String user,
                    java.lang.String password,
                    java.lang.String tungstenSchema,
                    java.lang.String tungstenTableType)
Method Detail

isAlive

public boolean isAlive()
Description copied from interface: ShardManagerMBean
Returns true so that clients can confirm connection liveness.

Specified by:
isAlive in interface ShardManagerMBean
Returns:
true if the service is up and running, false otherwise

insert

public int insert(java.util.List<java.util.Map<java.lang.String,java.lang.String>> params)
           throws java.sql.SQLException
Description copied from interface: ShardManagerMBean
Inserts a list of shards into the shard table. Each shard will be a map of name-value parameters, for example, name -> my_shard, channel -> 2.

Specified by:
insert in interface ShardManagerMBean
Parameters:
params - a list of shards to be inserted
Throws:
java.sql.SQLException

update

public int update(java.util.List<java.util.Map<java.lang.String,java.lang.String>> params)
           throws java.sql.SQLException
Description copied from interface: ShardManagerMBean
Updates a list of shards into the shard table. Each shard will be a map of name-value parameters, for example, name -> my_shard, channel -> 2, the key to be used to update being the shard name.

Specified by:
update in interface ShardManagerMBean
Parameters:
params - a list of shards to be updated
Throws:
java.sql.SQLException

delete

public int delete(java.util.List<java.util.Map<java.lang.String,java.lang.String>> params)
           throws java.sql.SQLException
Description copied from interface: ShardManagerMBean
Deletes a list of shards based on shard ids (aka shard name). The list will only contain shard ids.

Specified by:
delete in interface ShardManagerMBean
Throws:
java.sql.SQLException

deleteAll

public int deleteAll()
              throws java.sql.SQLException
Description copied from interface: ShardManagerMBean
Deletes all shards from the shard table.

Specified by:
deleteAll in interface ShardManagerMBean
Throws:
java.sql.SQLException

list

public java.util.List<java.util.Map<java.lang.String,java.lang.String>> list()
                                                                      throws java.sql.SQLException
Description copied from interface: ShardManagerMBean
List all shards definitions

Specified by:
list in interface ShardManagerMBean
Returns:
A list of shards represented by maps of name-value.
Throws:
java.sql.SQLException

advertiseInternal

public void advertiseInternal()

createHelper

public DynamicMBeanHelper createHelper()
                                throws java.lang.Exception
Returns a helper that supplies MBean metadata.

Specified by:
createHelper in interface ShardManagerMBean
Throws:
java.lang.Exception
See Also:
OpenReplicatorManager.createHelper()