blob: f5c1778c461d5644fca9fe34be8019b43f94aa63 [file] [log] [blame]
Frank Wangd7e3b4b2017-09-24 13:37:54 +09001/*
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.PiMeterHandle;
23import org.onosproject.net.pi.runtime.PiMeterCellConfig;
24import org.onosproject.store.serializers.KryoNamespaces;
25
26/**
27 * Distributed implementation of a P4Runtime meter mirror.
28 */
29@Component(immediate = true)
30@Service
31public final class DistributedP4RuntimeMeterMirror
32 extends AbstractDistributedP4RuntimeMirror
33 <PiMeterHandle, PiMeterCellConfig>
34 implements P4RuntimeMeterMirror {
35
36 private static final String DIST_MAP_NAME = "onos-p4runtime-meter-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}