1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
4 * Ceph distributed storage system
6 * Copyright (C) 2015 Mirantis, Inc.
8 * Author: Alyona Kiseleva <akiselyova@mirantis.com>
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
20 #include "compressor/CompressionPlugin.h"
21 #include "compressor_example.h"
23 class CompressorPluginExample : public CompressionPlugin {
26 explicit CompressorPluginExample(CephContext* cct) : CompressionPlugin(cct)
29 int factory(CompressorRef *cs,
32 if (compressor == 0) {
33 CompressorExample *interface = new CompressorExample();
34 compressor = CompressorRef(interface);
41 // -----------------------------------------------------------------------------
43 const char *__ceph_plugin_version()
45 return CEPH_GIT_NICE_VER;
48 // -----------------------------------------------------------------------------
50 int __ceph_plugin_init(CephContext *cct,
51 const std::string& type,
52 const std::string& name)
54 PluginRegistry *instance = cct->get_plugin_registry();
56 return instance->add(type, name, new CompressorPluginExample(cct));