test_class.declarator: logger =
              LoggerFactory.getLogger(SyncManagerTest.class)
test_class.modifier: protected static
test_class.original_string: protected static Logger logger =
              LoggerFactory.getLogger(SyncManagerTest.class);
test_class.type: Logger
test_class.var_name: logger
test_class.declarator: moduleContexts
test_class.modifier: protected
test_class.original_string: protected FloodlightModuleContext[] moduleContexts;
test_class.type: FloodlightModuleContext[]
test_class.var_name: moduleContexts
test_class.declarator: syncManagers
test_class.modifier: protected
test_class.original_string: protected SyncManager[] syncManagers;
test_class.type: SyncManager[]
test_class.var_name: syncManagers
test_class.declarator: mapper = new ObjectMapper()
test_class.modifier: protected final static
test_class.original_string: protected final static ObjectMapper mapper = new ObjectMapper();
test_class.type: ObjectMapper
test_class.var_name: mapper
test_class.declarator: nodeString
test_class.modifier: protected
test_class.original_string: protected String nodeString;
test_class.type: String
test_class.var_name: nodeString
test_class.declarator: nodes
test_class.original_string: ArrayList<Node> nodes;
test_class.type: ArrayList<Node>
test_class.var_name: nodes
test_class.declarator: tp
test_class.original_string: ThreadPool tp;
test_class.type: ThreadPool
test_class.var_name: tp
test_class.declarator: keyStoreFolder = new TemporaryFolder()
test_class.modifier: @Rule
      public
test_class.original_string: @Rule
      public TemporaryFolder keyStoreFolder = new TemporaryFolder();
test_class.type: TemporaryFolder
test_class.var_name: keyStoreFolder
test_class.declarator: keyStoreFile
test_class.modifier: protected
test_class.original_string: protected File keyStoreFile;
test_class.type: File
test_class.var_name: keyStoreFile
test_class.declarator: keyStorePassword = "verysecurepassword"
test_class.modifier: protected
test_class.original_string: protected String keyStorePassword = "verysecurepassword";
test_class.type: String
test_class.var_name: keyStorePassword
test_class.file: src/agents/apps/floodlight/floodlight-1.2/src/test/java/org/sdnplatform/sync/internal/SyncManagerTest.java
test_class.identifier: SyncManagerTest
test_case.body: @Test
      public void testAddNode() throws Exception {
          waitForFullMesh(2000);
          IStoreClient<String, String> client0 =
                  syncManagers[0].getStoreClient("global", 
                                                 String.class, String.class);
          IStoreClient<String, String> client1 =
                  syncManagers[1].getStoreClient("global", 
                                                 String.class, String.class);
          client0.put("key", "value");
          waitForValue(client1, "key", "value", 2000, "client1");
          
          nodes.add(new Node("localhost", 40105, (short)5, (short)5));
          SyncManager[] sms = Arrays.copyOf(syncManagers, 
                                            syncManagers.length + 1);
          FloodlightModuleContext[] fmcs =
                  Arrays.copyOf(moduleContexts,
                                moduleContexts.length + 1);
          sms[syncManagers.length] = new SyncManager();
          fmcs[moduleContexts.length] = new FloodlightModuleContext();
          nodeString = mapper.writeValueAsString(nodes);
  
          setupSyncManager(fmcs[moduleContexts.length],
                           sms[syncManagers.length],
                           nodes.get(syncManagers.length));
          syncManagers = sms;
          moduleContexts = fmcs;
  
          for(int i = 0; i < 4; i++) {
              moduleContexts[i].addConfigParam(syncManagers[i],
                                               "nodes", nodeString);
              syncManagers[i].doUpdateConfiguration();
          }
          waitForFullMesh(2000);
  
          IStoreClient<String, String> client4 =
                  syncManagers[4].getStoreClient("global", 
                                                 String.class, String.class);
          client4.put("newkey", "newvalue");
          waitForValue(client4, "key", "value", 2000, "client4");
          waitForValue(client0, "newkey", "newvalue", 2000, "client0");
      }
test_case.class_method_signature: SyncManagerTest.testAddNode()
test_case.full_signature: @Test public void testAddNode()
test_case.identifier: testAddNode
test_case.invocations: waitForFullMesh getStoreClient getStoreClient put waitForValue add copyOf copyOf writeValueAsString setupSyncManager get addConfigParam doUpdateConfiguration waitForFullMesh getStoreClient put waitForValue waitForValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAddNode()
focal_class.declarator: logger =
  			LoggerFactory.getLogger(SyncManager.class.getName())
focal_class.modifier: protected static final
focal_class.original_string: protected static final Logger logger =
  			LoggerFactory.getLogger(SyncManager.class.getName());
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: threadPool
focal_class.modifier: protected
focal_class.original_string: protected IThreadPoolService threadPool;
focal_class.type: IThreadPoolService
focal_class.var_name: threadPool
focal_class.declarator: debugCounter
focal_class.modifier: protected
focal_class.original_string: protected IDebugCounterService debugCounter;
focal_class.type: IDebugCounterService
focal_class.var_name: debugCounter
focal_class.declarator: storeRegistry = null
focal_class.modifier: private
focal_class.original_string: private StoreRegistry storeRegistry = null;
focal_class.type: StoreRegistry
focal_class.var_name: storeRegistry
focal_class.declarator: timer
focal_class.modifier: private
focal_class.original_string: private Timer timer;
focal_class.type: Timer
focal_class.var_name: timer
focal_class.declarator: clusterConfigProvider
focal_class.modifier: private
focal_class.original_string: private IClusterConfigProvider clusterConfigProvider;
focal_class.type: IClusterConfigProvider
focal_class.var_name: clusterConfigProvider
focal_class.declarator: clusterConfig = new ClusterConfig()
focal_class.modifier: private
focal_class.original_string: private ClusterConfig clusterConfig = new ClusterConfig();
focal_class.type: ClusterConfig
focal_class.var_name: clusterConfig
focal_class.declarator: rpcService = null
focal_class.modifier: protected
focal_class.original_string: protected RPCService rpcService = null;
focal_class.type: RPCService
focal_class.var_name: rpcService
focal_class.declarator: CLEANUP_INTERVAL = 60 * 60
focal_class.modifier: private static final
focal_class.original_string: private static final int CLEANUP_INTERVAL = 60 * 60;
focal_class.type: int
focal_class.var_name: CLEANUP_INTERVAL
focal_class.declarator: ANTIENTROPY_INTERVAL = 5 * 60
focal_class.modifier: private static final
focal_class.original_string: private static final int ANTIENTROPY_INTERVAL = 5 * 60;
focal_class.type: int
focal_class.var_name: ANTIENTROPY_INTERVAL
focal_class.declarator: CONFIG_RESCAN_INTERVAL = 10
focal_class.modifier: private static final
focal_class.original_string: private static final int CONFIG_RESCAN_INTERVAL = 10;
focal_class.type: int
focal_class.var_name: CONFIG_RESCAN_INTERVAL
focal_class.declarator: cleanupTask
focal_class.modifier: private
focal_class.original_string: private SingletonTask cleanupTask;
focal_class.type: SingletonTask
focal_class.var_name: cleanupTask
focal_class.declarator: antientropyTask
focal_class.modifier: private
focal_class.original_string: private SingletonTask antientropyTask;
focal_class.type: SingletonTask
focal_class.var_name: antientropyTask
focal_class.declarator: updateConfigTask
focal_class.modifier: private
focal_class.original_string: private SingletonTask updateConfigTask;
focal_class.type: SingletonTask
focal_class.var_name: updateConfigTask
focal_class.declarator: SYNC_WORKER_POOL = 2
focal_class.modifier: private static final
focal_class.original_string: private static final int SYNC_WORKER_POOL = 2;
focal_class.type: int
focal_class.var_name: SYNC_WORKER_POOL
focal_class.declarator: hintThreadPool
focal_class.modifier: private
focal_class.original_string: private ExecutorService hintThreadPool;
focal_class.type: ExecutorService
focal_class.var_name: hintThreadPool
focal_class.declarator: random = new Random()
focal_class.modifier: private final
focal_class.original_string: private final Random random = new Random();
focal_class.type: Random
focal_class.var_name: random
focal_class.declarator: cursorMap =
  			new ConcurrentHashMap<Integer, Cursor>()
focal_class.modifier: private final
focal_class.original_string: private final Map<Integer, Cursor> cursorMap =
  			new ConcurrentHashMap<Integer, Cursor>();
focal_class.type: Map<Integer, Cursor>
focal_class.var_name: cursorMap
focal_class.declarator: persistenceEnabled = true
focal_class.modifier: private
focal_class.original_string: private boolean persistenceEnabled = true;
focal_class.type: boolean
focal_class.var_name: persistenceEnabled
focal_class.declarator: PACKAGE =
  			ISyncService.class.getPackage().getName()
focal_class.modifier: private static final
focal_class.original_string: private static final String PACKAGE =
  			ISyncService.class.getPackage().getName();
focal_class.type: String
focal_class.var_name: PACKAGE
focal_class.declarator: counterHints
focal_class.modifier: public static
focal_class.original_string: public static IDebugCounter counterHints;
focal_class.type: IDebugCounter
focal_class.var_name: counterHints
focal_class.declarator: counterSentValues
focal_class.modifier: public static
focal_class.original_string: public static IDebugCounter counterSentValues;
focal_class.type: IDebugCounter
focal_class.var_name: counterSentValues
focal_class.declarator: counterReceivedValues
focal_class.modifier: public static
focal_class.original_string: public static IDebugCounter counterReceivedValues;
focal_class.type: IDebugCounter
focal_class.var_name: counterReceivedValues
focal_class.declarator: counterPuts
focal_class.modifier: public static
focal_class.original_string: public static IDebugCounter counterPuts;
focal_class.type: IDebugCounter
focal_class.var_name: counterPuts
focal_class.declarator: counterGets
focal_class.modifier: public static
focal_class.original_string: public static IDebugCounter counterGets;
focal_class.type: IDebugCounter
focal_class.var_name: counterGets
focal_class.declarator: counterIterators
focal_class.modifier: public static
focal_class.original_string: public static IDebugCounter counterIterators;
focal_class.type: IDebugCounter
focal_class.var_name: counterIterators
focal_class.declarator: counterErrorRemote
focal_class.modifier: public static
focal_class.original_string: public static IDebugCounter counterErrorRemote;
focal_class.type: IDebugCounter
focal_class.var_name: counterErrorRemote
focal_class.declarator: counterErrorProcessing
focal_class.modifier: public static
focal_class.original_string: public static IDebugCounter counterErrorProcessing;
focal_class.type: IDebugCounter
focal_class.var_name: counterErrorProcessing
focal_class.file: src/agents/apps/floodlight/floodlight-1.2/src/main/java/org/sdnplatform/sync/internal/SyncManager.java
focal_class.identifier: SyncManager
focal_class.class_method_signature: SyncManager.registerStore(String storeName, Scope scope)
focal_class.full_signature: @Override public void registerStore(String storeName, Scope scope)
focal_class.identifier: registerStore
focal_class.modifiers: @Override public
focal_class.parameters: (String storeName, Scope scope)
focal_class.return: void
focal_class.signature: void registerStore(String storeName, Scope scope)
focal_class.class_method_signature: SyncManager.registerPersistentStore(String storeName, Scope scope)
focal_class.full_signature: @Override public void registerPersistentStore(String storeName, Scope scope)
focal_class.identifier: registerPersistentStore
focal_class.modifiers: @Override public
focal_class.parameters: (String storeName, Scope scope)
focal_class.return: void
focal_class.signature: void registerPersistentStore(String storeName, Scope scope)
focal_class.class_method_signature: SyncManager.getClusterConfig()
focal_class.full_signature: public ClusterConfig getClusterConfig()
focal_class.identifier: getClusterConfig
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: ClusterConfig
focal_class.signature: ClusterConfig getClusterConfig()
focal_class.class_method_signature: SyncManager.cleanup()
focal_class.full_signature: public void cleanup()
focal_class.identifier: cleanup
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void cleanup()
focal_class.class_method_signature: SyncManager.antientropy(Node node)
focal_class.full_signature: public void antientropy(Node node)
focal_class.identifier: antientropy
focal_class.modifiers: public
focal_class.parameters: (Node node)
focal_class.return: void
focal_class.signature: void antientropy(Node node)
focal_class.class_method_signature: SyncManager.antientropy()
focal_class.full_signature: public void antientropy()
focal_class.identifier: antientropy
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void antientropy()
focal_class.class_method_signature: SyncManager.writeSyncValue(String storeName, Scope scope,
  			boolean persist,
  			byte[] key, Iterable<Versioned<byte[]>> values)
focal_class.full_signature: public void writeSyncValue(String storeName, Scope scope,
  			boolean persist,
  			byte[] key, Iterable<Versioned<byte[]>> values)
focal_class.identifier: writeSyncValue
focal_class.modifiers: public
focal_class.parameters: (String storeName, Scope scope,
  			boolean persist,
  			byte[] key, Iterable<Versioned<byte[]>> values)
focal_class.return: void
focal_class.signature: void writeSyncValue(String storeName, Scope scope,
  			boolean persist,
  			byte[] key, Iterable<Versioned<byte[]>> values)
focal_class.class_method_signature: SyncManager.handleSyncOffer(String storeName,
  			byte[] key,
  			Iterable<VectorClock> versions)
focal_class.full_signature: public boolean handleSyncOffer(String storeName,
  			byte[] key,
  			Iterable<VectorClock> versions)
focal_class.identifier: handleSyncOffer
focal_class.modifiers: public
focal_class.parameters: (String storeName,
  			byte[] key,
  			Iterable<VectorClock> versions)
focal_class.return: boolean
focal_class.signature: boolean handleSyncOffer(String storeName,
  			byte[] key,
  			Iterable<VectorClock> versions)
focal_class.class_method_signature: SyncManager.getRawStore(String storeName)
focal_class.full_signature: public IStorageEngine<ByteArray, byte[]> getRawStore(String storeName)
focal_class.identifier: getRawStore
focal_class.modifiers: public
focal_class.parameters: (String storeName)
focal_class.return: IStorageEngine<ByteArray, byte[]>
focal_class.signature: IStorageEngine<ByteArray, byte[]> getRawStore(String storeName)
focal_class.class_method_signature: SyncManager.getThreadPool()
focal_class.full_signature: public IThreadPoolService getThreadPool()
focal_class.identifier: getThreadPool
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: IThreadPoolService
focal_class.signature: IThreadPoolService getThreadPool()
focal_class.class_method_signature: SyncManager.queueSyncTask(SynchronizingStorageEngine e,
  			ByteArray key, Versioned<byte[]> value)
focal_class.full_signature: public void queueSyncTask(SynchronizingStorageEngine e,
  			ByteArray key, Versioned<byte[]> value)
focal_class.identifier: queueSyncTask
focal_class.modifiers: public
focal_class.parameters: (SynchronizingStorageEngine e,
  			ByteArray key, Versioned<byte[]> value)
focal_class.return: void
focal_class.signature: void queueSyncTask(SynchronizingStorageEngine e,
  			ByteArray key, Versioned<byte[]> value)
focal_class.class_method_signature: SyncManager.addListener(String storeName, MappingStoreListener listener)
focal_class.full_signature: @Override public void addListener(String storeName, MappingStoreListener listener)
focal_class.identifier: addListener
focal_class.modifiers: @Override public
focal_class.parameters: (String storeName, MappingStoreListener listener)
focal_class.return: void
focal_class.signature: void addListener(String storeName, MappingStoreListener listener)
focal_class.class_method_signature: SyncManager.updateConfiguration()
focal_class.full_signature: public void updateConfiguration()
focal_class.identifier: updateConfiguration
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void updateConfiguration()
focal_class.class_method_signature: SyncManager.getCursor(int cursorId)
focal_class.full_signature: public Cursor getCursor(int cursorId)
focal_class.identifier: getCursor
focal_class.modifiers: public
focal_class.parameters: (int cursorId)
focal_class.return: Cursor
focal_class.signature: Cursor getCursor(int cursorId)
focal_class.class_method_signature: SyncManager.newCursor(String storeName)
focal_class.full_signature: public Cursor newCursor(String storeName)
focal_class.identifier: newCursor
focal_class.modifiers: public
focal_class.parameters: (String storeName)
focal_class.return: Cursor
focal_class.signature: Cursor newCursor(String storeName)
focal_class.class_method_signature: SyncManager.closeCursor(Cursor cursor)
focal_class.full_signature: public void closeCursor(Cursor cursor)
focal_class.identifier: closeCursor
focal_class.modifiers: public
focal_class.parameters: (Cursor cursor)
focal_class.return: void
focal_class.signature: void closeCursor(Cursor cursor)
focal_class.class_method_signature: SyncManager.getStore(String storeName)
focal_class.full_signature: @Override public IStore<ByteArray,byte[]> getStore(String storeName)
focal_class.identifier: getStore
focal_class.modifiers: @Override public
focal_class.parameters: (String storeName)
focal_class.return: IStore<ByteArray,byte[]>
focal_class.signature: IStore<ByteArray,byte[]> getStore(String storeName)
focal_class.class_method_signature: SyncManager.getLocalNodeId()
focal_class.full_signature: @Override public short getLocalNodeId()
focal_class.identifier: getLocalNodeId
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: short
focal_class.signature: short getLocalNodeId()
focal_class.class_method_signature: SyncManager.shutdown()
focal_class.full_signature: @Override public void shutdown()
focal_class.identifier: shutdown
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void shutdown()
focal_class.class_method_signature: SyncManager.init(FloodlightModuleContext context)
focal_class.full_signature: @Override public void init(FloodlightModuleContext context)
focal_class.identifier: init
focal_class.modifiers: @Override public
focal_class.parameters: (FloodlightModuleContext context)
focal_class.return: void
focal_class.signature: void init(FloodlightModuleContext context)
focal_class.class_method_signature: SyncManager.registerDebugCounters(FloodlightModuleContext context)
focal_class.full_signature: private void registerDebugCounters(FloodlightModuleContext context)
focal_class.identifier: registerDebugCounters
focal_class.modifiers: private
focal_class.parameters: (FloodlightModuleContext context)
focal_class.return: void
focal_class.signature: void registerDebugCounters(FloodlightModuleContext context)
focal_class.class_method_signature: SyncManager.startUp(FloodlightModuleContext context)
focal_class.full_signature: @Override public void startUp(FloodlightModuleContext context)
focal_class.identifier: startUp
focal_class.modifiers: @Override public
focal_class.parameters: (FloodlightModuleContext context)
focal_class.return: void
focal_class.signature: void startUp(FloodlightModuleContext context)
focal_class.class_method_signature: SyncManager.getModuleDependencies()
focal_class.full_signature: @Override public Collection<Class<? extends IFloodlightService>> getModuleDependencies()
focal_class.identifier: getModuleDependencies
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Collection<Class<? extends IFloodlightService>>
focal_class.signature: Collection<Class<? extends IFloodlightService>> getModuleDependencies()
focal_class.class_method_signature: SyncManager.doUpdateConfiguration()
focal_class.full_signature: protected void doUpdateConfiguration()
focal_class.identifier: doUpdateConfiguration
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void doUpdateConfiguration()
focal_class.class_method_signature: SyncManager.getStoreInternal(String storeName)
focal_class.full_signature: protected SynchronizingStorageEngine getStoreInternal(String storeName)
focal_class.identifier: getStoreInternal
focal_class.modifiers: protected
focal_class.parameters: (String storeName)
focal_class.return: SynchronizingStorageEngine
focal_class.signature: SynchronizingStorageEngine getStoreInternal(String storeName)
focal_class.class_method_signature: SyncManager.sendSyncOffer(short nodeId, SyncMessage bsm)
focal_class.full_signature: private void sendSyncOffer(short nodeId, SyncMessage bsm)
focal_class.identifier: sendSyncOffer
focal_class.modifiers: private
focal_class.parameters: (short nodeId, SyncMessage bsm)
focal_class.return: void
focal_class.signature: void sendSyncOffer(short nodeId, SyncMessage bsm)
focal_class.superclass: extends AbstractSyncManager
focal_method.body: protected void doUpdateConfiguration()
  			throws FloodlightModuleException {
  
  		try {
  			ClusterConfig oldConfig = clusterConfig;
  			clusterConfig = clusterConfigProvider.getConfig();
  			if (clusterConfig.equals(oldConfig)) return;
  
  			logger.info("[{}] Updating sync configuration {}",
  					clusterConfig.getNode().getNodeId(),
  					clusterConfig);
  			if (oldConfig.getNode() != null &&
  					!clusterConfig.getNode().equals(oldConfig.getNode())) {
  				logger.info("[{}] Local node configuration changed; restarting sync" +
  						"service", oldConfig.getNode().getNodeId());
  				shutdown();
  				startUp(null);
  			}
  
  			for (Node n : clusterConfig.getNodes()) {
  				Node existing = oldConfig.getNode(n.getNodeId());
  				if (existing != null && !n.equals(existing)) {
  					// we already had this node's configuration, but it's
  					// changed.  Disconnect from the node and let it
  					// reinitialize
  					logger.info("[{}->{}] Configuration for node has changed",
  							getLocalNodeId(), n.getNodeId());
  					rpcService.disconnectNode(n.getNodeId());
  				}
  			}
  			for (Node n : oldConfig.getNodes()) {
  				Node nn = clusterConfig.getNode(n.getNodeId());
  				if (nn == null) {
  					// n is a node that doesn't appear in the new config
  					logger.info("[{}->{}] Disconnecting deconfigured node",
  							getLocalNodeId(), n.getNodeId());
  					rpcService.disconnectNode(n.getNodeId());
  				}
  			}
  		} catch (Exception e) {
  			throw new FloodlightModuleException("Could not update " +
  					"configuration", e);
  		}
  	}
focal_method.class_method_signature: SyncManager.doUpdateConfiguration()
focal_method.full_signature: protected void doUpdateConfiguration()
focal_method.identifier: doUpdateConfiguration
focal_method.invocations: getConfig equals info getNodeId getNode getNode equals getNode getNode info getNodeId getNode shutdown startUp getNodes getNode getNodeId equals info getLocalNodeId getNodeId disconnectNode getNodeId getNodes getNode getNodeId info getLocalNodeId getNodeId disconnectNode getNodeId
focal_method.modifiers: protected
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void doUpdateConfiguration()