void setMaximumTimerDelay(long maximumTimerDelay);
+ void setIsUseSingleLayerSerialization(Boolean useSingleLayerSerialization);
+
}
* @return listenable future from sal role service
*/
ListenableFuture<RpcResult<SetRoleOutput>> makeDeviceSlave();
+
+ boolean isUseSingleLayerSerialization();
}
type non-zero-uint32-type;
default 900000;
}
+
+ leaf use-single-layer-serialization {
+ description "When true, Yang models are serialized and deserialized directly to and from format supported
+ by device, so serialization and deserialization is faster. Otherwise, models are first serialized to
+ Openflow specification models and then to format supported by device, and reversed when deserializing.";
+ type boolean;
+ default "false";
+ }
}
-}
\ No newline at end of file
+}
openflowPluginProvider.setSkipTableFeatures(providerConfig.isSkipTableFeatures());
openflowPluginProvider.setBasicTimerDelay(providerConfig.getBasicTimerDelay().getValue());
openflowPluginProvider.setMaximumTimerDelay(providerConfig.getMaximumTimerDelay().getValue());
+ openflowPluginProvider.setIsUseSingleLayerSerialization(providerConfig.isUseSingleLayerSerialization());
openflowPluginProvider.initialize();
private boolean skipTableFeatures = true;
private long basicTimerDelay;
private long maximumTimerDelay;
+ private boolean useSingleLayerSerialization = false;
private final ThreadPoolExecutor threadPool;
private ClusterSingletonServiceProvider singletonServicesProvider;
private void startSwitchConnections() {
Futures.addCallback(Futures.allAsList(switchConnectionProviders.stream().map(switchConnectionProvider -> {
// Inject OpenflowPlugin custom serializers and deserializers into OpenflowJava
- SerializerInjector.injectSerializers(switchConnectionProvider);
- DeserializerInjector.injectDeserializers(switchConnectionProvider);
+ if (useSingleLayerSerialization) {
+ SerializerInjector.injectSerializers(switchConnectionProvider);
+ DeserializerInjector.injectDeserializers(switchConnectionProvider);
+ }
// Set handler of incoming connections and start switch connection provider
switchConnectionProvider.setSwitchConnectionHandler(connectionManager);
@Override
public void setFlowRemovedNotification(boolean isFlowRemovedNotificationOn) {
- this.isFlowRemovedNotificationOn = this.isFlowRemovedNotificationOn;
+ this.isFlowRemovedNotificationOn = isFlowRemovedNotificationOn;
}
@Override
notificationPublishService,
hashedWheelTimer,
convertorManager,
- skipTableFeatures);
+ skipTableFeatures,
+ useSingleLayerSerialization);
((ExtensionConverterProviderKeeper) deviceManager).setExtensionConverterProvider(extensionConverterManager);
// Manually shutdown all remaining running threads in pool
threadPool.shutdown();
}
-}
\ No newline at end of file
+
+ @Override
+ public void setIsUseSingleLayerSerialization(Boolean useSingleLayerSerialization) {
+ this.useSingleLayerSerialization = useSingleLayerSerialization;
+ }
+}
private volatile CONTEXT_STATE state;
private ClusterInitializationPhaseHandler clusterInitializationPhaseHandler;
private final DeviceManager myManager;
+ private final boolean useSingleLayerSerialization;
DeviceContextImpl(
@Nonnull final ConnectionContext primaryConnectionContext,
final ConvertorExecutor convertorExecutor,
final boolean skipTableFeatures,
final HashedWheelTimer hashedWheelTimer,
- final DeviceManager myManager) {
+ final DeviceManager myManager,
+ final boolean useSingleLayerSerialization) {
this.primaryConnectionContext = primaryConnectionContext;
this.deviceInfo = primaryConnectionContext.getDeviceInfo();
this.hashedWheelTimer = hashedWheelTimer;
this.state = CONTEXT_STATE.INITIALIZATION;
this.convertorExecutor = convertorExecutor;
this.skipTableFeatures = skipTableFeatures;
+ this.useSingleLayerSerialization = useSingleLayerSerialization;
this.initialized = false;
}
this.onPublished();
}
+ @Override
+ public boolean isUseSingleLayerSerialization() {
+ return useSingleLayerSerialization;
+ }
+
@Override
public boolean isSkipTableFeatures() {
return this.skipTableFeatures;
private final NotificationPublishService notificationPublishService;
private final MessageSpy messageSpy;
private final HashedWheelTimer hashedWheelTimer;
+ private final boolean useSingleLayerSerialization;
public DeviceManagerImpl(@Nonnull final DataBroker dataBroker,
final long globalNotificationQuota,
final NotificationPublishService notificationPublishService,
final HashedWheelTimer hashedWheelTimer,
final ConvertorExecutor convertorExecutor,
- final boolean skipTableFeatures) {
+ final boolean skipTableFeatures,
+ final boolean useSingleLayerSerialization) {
this.dataBroker = dataBroker;
this.singletonServiceProvider = singletonServiceProvider;
this.notificationPublishService = notificationPublishService;
this.messageSpy = messageSpy;
+ this.useSingleLayerSerialization = useSingleLayerSerialization;
}
convertorExecutor,
skipTableFeatures,
hashedWheelTimer,
- this);
+ this,
+ useSingleLayerSerialization);
deviceContext.setSalRoleService(new SalRoleServiceImpl(deviceContext, deviceContext));
deviceContexts.put(deviceInfo, deviceContext);
translatorLibrary,
deviceManager,
convertorExecutor,
- false, timer, deviceManager);
+ false, timer, deviceManager, false);
deviceContextSpy = Mockito.spy(deviceContext);
xid = new Xid(atomicLong.incrementAndGet());
@Test(expected = NullPointerException.class)
public void testDeviceContextImplConstructorNullDataBroker() throws Exception {
- new DeviceContextImpl(connectionContext, null, null, translatorLibrary, deviceManager, convertorExecutor,false, timer, deviceManager).close();
+ new DeviceContextImpl(connectionContext, null, null, translatorLibrary, deviceManager, convertorExecutor,false, timer, deviceManager, false).close();
}
@Test(expected = NullPointerException.class)
public void testDeviceContextImplConstructorNullTimer() throws Exception {
- new DeviceContextImpl(null, dataBroker, null, translatorLibrary, deviceManager,convertorExecutor,false, timer, deviceManager).close();
+ new DeviceContextImpl(null, dataBroker, null, translatorLibrary, deviceManager,convertorExecutor,false, timer, deviceManager, false).close();
}
@Test
null,
new HashedWheelTimer(),
convertorExecutor,
+ false,
false);
deviceManager.setDeviceInitializationPhaseHandler(deviceInitPhaseHandler);