本文整理汇总了Java中net.floodlightcontroller.counter.ICounterStoreService类的典型用法代码示例。如果您正苦于以下问题:Java ICounterStoreService类的具体用法?Java ICounterStoreService怎么用?Java ICounterStoreService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ICounterStoreService类属于net.floodlightcontroller.counter包,在下文中一共展示了ICounterStoreService类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
@Override
@LogMessageDocs({
@LogMessageDoc(level="WARN",
message="Error parsing flow idle timeout, " +
"using default of {number} seconds",
explanation="The properties file contains an invalid " +
"flow idle timeout",
recommendation="Correct the idle timeout in the " +
"properties file."),
@LogMessageDoc(level="WARN",
message="Error parsing flow hard timeout, " +
"using default of {number} seconds",
explanation="The properties file contains an invalid " +
"flow hard timeout",
recommendation="Correct the hard timeout in the " +
"properties file.")
})
public void init(FloodlightModuleContext context) throws FloodlightModuleException {
super.init();
this.floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
this.deviceManager = context.getServiceImpl(IDeviceService.class);
this.routingEngine = context.getServiceImpl(IRoutingService.class);
this.topology = context.getServiceImpl(ITopologyService.class);
this.counterStore = context.getServiceImpl(ICounterStoreService.class);
}
示例2: init
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
throws FloodlightModuleException {
threadPool = context.getServiceImpl(IThreadPoolService.class);
counterStore = context.getServiceImpl(ICounterStoreService.class);
debugCounters = context.getServiceImpl(IDebugCounterService.class);
flowQueue = new PriorityPendingQueue<OFMatchReconcile>();
flowReconcileListeners =
new ListenerDispatcher<OFType, IFlowReconcileListener>();
Map<String, String> configParam = context.getConfigParams(this);
String enableValue = configParam.get(EnableConfigKey);
registerFlowReconcileManagerDebugCounters();
// Set flowReconcile default to true
flowReconcileEnabled = true;
if (enableValue != null &&
enableValue.equalsIgnoreCase("false")) {
flowReconcileEnabled = false;
}
flowReconcileThreadRunCount = new AtomicInteger(0);
lastReconcileTime = new Date(0);
logger.debug("FlowReconcile is {}", flowReconcileEnabled);
}
示例3: init
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
throws FloodlightModuleException {
floodlightProvider = context.getServiceImpl(IFloodlightProviderService.class);
restApi = context.getServiceImpl(IRestApiService.class);
counterStore = context.getServiceImpl(ICounterStoreService.class);
deviceManager = context.getServiceImpl(IDeviceService.class);
routingEngine = context.getServiceImpl(IRoutingService.class);
topology = context.getServiceImpl(ITopologyService.class);
sfp = context.getServiceImpl(IStaticFlowEntryPusherService.class);
messageDamper = new OFMessageDamper(OFMESSAGE_DAMPER_CAPACITY,
EnumSet.of(OFType.FLOW_MOD),
OFMESSAGE_DAMPER_TIMEOUT);
vips = new HashMap<String, LBVip>();
pools = new HashMap<String, LBPool>();
members = new HashMap<String, LBMember>();
vipIpToId = new HashMap<Integer, String>();
vipIpToMac = new HashMap<Integer, MACAddress>();
memberIpToId = new HashMap<Integer, String>();
}
示例4: retrieve
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
@Get("json")
public Map<String, Object> retrieve() {
IFloodlightProviderService floodlightProvider =
(IFloodlightProviderService)getContext().getAttributes().
get(IFloodlightProviderService.class.getCanonicalName());
HashMap<String,Object> model = new HashMap<String,Object>();
String switchID = (String) getRequestAttributes().get("switchId");
String counterName = (String) getRequestAttributes().get("counterName");
if (switchID.equalsIgnoreCase("all")) {
getOneSwitchCounterJson(model, ICounterStoreService.CONTROLLER_NAME, counterName);
for (Long dpid : floodlightProvider.getAllSwitchDpids()) {
switchID = HexString.toHexString(dpid);
getOneSwitchCounterJson(model, switchID, counterName);
}
} else {
getOneSwitchCounterJson(model, switchID, counterName);
}
return model;
}
示例5: getOneSwitchCounterJson
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
protected void getOneSwitchCounterJson(Map<String, Object> model,
String switchID, String counterName) {
String fullCounterName = "";
try {
counterName = URLDecoder.decode(counterName, "UTF-8");
fullCounterName =
switchID + ICounterStoreService.TitleDelimitor + counterName;
} catch (UnsupportedEncodingException e) {
//Just leave counterTitle undecoded if there is an issue - fail silently
}
ICounter counter = this.counterStore.getCounter(fullCounterName);
Map<String, Long> sample = new HashMap<String, Long> ();
if (counter != null) {
sample.put(counter.getCounterDate().toString(),
counter.getCounterValue().getLong());
model.put(switchID, sample);
}
}
示例6: getOneSwitchCounterCategoriesJson
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
protected void getOneSwitchCounterCategoriesJson(Map<String, Object> model,
String switchID,
String counterName,
String layer) {
String fullCounterName = "";
NetworkLayer nl = NetworkLayer.L3;
try {
counterName = URLDecoder.decode(counterName, "UTF-8");
layer = URLDecoder.decode(layer, "UTF-8");
fullCounterName = switchID + ICounterStoreService.TitleDelimitor + counterName;
} catch (UnsupportedEncodingException e) {
//Just leave counterTitle undecoded if there is an issue - fail silently
}
if (layer.compareToIgnoreCase("4") == 0) {
nl = NetworkLayer.L4;
}
List<String> categories = this.counterStore.getAllCategories(fullCounterName, nl);
if (categories != null) {
model.put(fullCounterName + "." + layer, categories);
}
}
示例7: init
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context) throws FloodlightModuleException {
controller.setStorageSourceService(
context.getServiceImpl(IStorageSourceService.class));
controller.setPktInProcessingService(
context.getServiceImpl(IPktInProcessingTimeService.class));
controller.setCounterStore(
context.getServiceImpl(ICounterStoreService.class));
controller.setDebugCounter(
context.getServiceImpl(IDebugCounterService.class));
controller.setDebugEvent(
context.getServiceImpl(IDebugEventService.class));
controller.setRestApiService(
context.getServiceImpl(IRestApiService.class));
controller.setThreadPoolService(
context.getServiceImpl(IThreadPoolService.class));
controller.setSyncService(
context.getServiceImpl(ISyncService.class));
controller.init(context.getConfigParams(this));
}
示例8: setUp
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
super.setUp();
fmc = new FloodlightModuleContext();
flowReconcileMgr = new FlowReconcileManager();
threadPool = new MockThreadPoolService();
counterStore = createMock(ICounterStoreService.class);
fmc.addService(ICounterStoreService.class, counterStore);
fmc.addService(IThreadPoolService.class, threadPool);
threadPool.init(fmc);
flowReconcileMgr.init(fmc);
threadPool.startUp(fmc);
flowReconcileMgr.startUp(fmc);
}
示例9: init
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
@Override
public void init(FloodlightModuleContext context)
throws FloodlightModuleException {
threadPool = context.getServiceImpl(IThreadPoolService.class);
counterStore = context.getServiceImpl(ICounterStoreService.class);
flowQueue = new ConcurrentLinkedQueue<OFMatchReconcile>();
flowReconcileListeners =
new ListenerDispatcher<OFType, IFlowReconcileListener>();
Map<String, String> configParam = context.getConfigParams(this);
String enableValue = configParam.get(EnableConfigKey);
// Set flowReconcile default to true
flowReconcileEnabled = true;
if (enableValue != null &&
enableValue.equalsIgnoreCase("false")) {
flowReconcileEnabled = false;
}
flowReconcileThreadRunCount = 0;
lastReconcileTime = new Date(0);
logger.debug("FlowReconcile is {}", flowReconcileEnabled);
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:24,代码来源:FlowReconcileManager.java
示例10: retrieve
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
@Get("json")
public Map<String, Object> retrieve() {
IFloodlightProviderService floodlightProvider =
(IFloodlightProviderService)getContext().getAttributes().
get(IFloodlightProviderService.class.getCanonicalName());
HashMap<String,Object> model = new HashMap<String,Object>();
String switchID = (String) getRequestAttributes().get("switchId");
String counterName = (String) getRequestAttributes().get("counterName");
Long[] switchDpids;
if (switchID.equalsIgnoreCase("all")) {
switchDpids = floodlightProvider.getSwitches().keySet().toArray(new Long[0]);
getOneSwitchCounterJson(model, ICounterStoreService.CONTROLLER_NAME, counterName);
for (Long dpid : switchDpids) {
switchID = HexString.toHexString(dpid);
getOneSwitchCounterJson(model, switchID, counterName);
}
} else {
getOneSwitchCounterJson(model, switchID, counterName);
}
return model;
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:25,代码来源:SwitchCounterResource.java
示例11: getOneSwitchCounterJson
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
protected void getOneSwitchCounterJson(Map<String, Object> model,
String switchID, String counterName) {
String fullCounterName = "";
try {
counterName = URLDecoder.decode(counterName, "UTF-8");
fullCounterName =
switchID + ICounterStoreService.TitleDelimitor + counterName;
} catch (UnsupportedEncodingException e) {
//Just leave counterTitle undecoded if there is an issue - fail silently
}
ICounter counter = this.counterStore.getCounter(fullCounterName);
Map<String, Long> sample = new HashMap<String, Long> ();
if (counter != null) {
sample.put(counter.getCounterDate().toString(),
counter.getCounterValue().getLong());
model.put(switchID, sample);
}
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:21,代码来源:SwitchCounterResource.java
示例12: getOneSwitchCounterCategoriesJson
import net.floodlightcontroller.counter.ICounterStoreService; //导入依赖的package包/类
protected void getOneSwitchCounterCategoriesJson(Map<String, Object> model,
String switchID,
String counterName,
String layer) {
String fullCounterName = "";
NetworkLayer nl = NetworkLayer.L3;
try {
counterName = URLDecoder.decode(counterName, "UTF-8");
layer = URLDecoder.decode(layer, "UTF-8");
fullCounterName = switchID + ICounterStoreService.TitleDelimitor + counterName;
} catch (UnsupportedEncodingException e) {
//Just leave counterTitle undecoded if there is an issue - fail silently
}
if (layer.compareToIgnoreCase("4") == 0) {
nl = NetworkLayer.L4;
}
List<String> categories = this.counterStore.getAllCategories(fullCounterName, nl);
if (categories != null) {
model.put(fullCounterName + "." + layer, categories);
}
}
开发者ID:vishalshubham,项目名称:Multipath-Hedera-system-in-Floodlight-controller,代码行数:24,代码来源:SwitchCounterCategoriesResource.java