blob: f37cf44328e114388897ccee2afb8d2c05151313 [file] [log] [blame]
Carmelo Cascone6a0b5a32017-11-20 23:08:32 -08001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.drivers.p4runtime.mirror;
18
19import org.apache.felix.scr.annotations.Component;
20import org.apache.felix.scr.annotations.Service;
21import org.onlab.util.KryoNamespace;
22import org.onosproject.net.pi.runtime.PiTableEntry;
23import org.onosproject.net.pi.runtime.PiTableEntryHandle;
24import org.onosproject.store.serializers.KryoNamespaces;
25
26/**
27 * Distributed implementation of a P4Runtime table mirror.
28 */
29@Component(immediate = true)
30@Service
31public final class DistributedP4RuntimeTableMirror
32 extends AbstractDistributedP4RuntimeMirror
33 <PiTableEntryHandle, PiTableEntry>
34 implements P4RuntimeTableMirror {
35
36 private static final String DIST_MAP_NAME = "onos-p4runtime-table-mirror";
37
38 @Override
39 String mapName() {
40 return DIST_MAP_NAME;
41 }
42
43 @Override
44 KryoNamespace storeSerializer() {
45 return KryoNamespace.newBuilder()
46 .register(KryoNamespaces.API)
47 .register(TimedEntry.class)
48 .build();
49 }
50}