]>
git.proxmox.com Git - ceph.git/blob - ceph/src/test/compressor/compressor_plugin_example.cc
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"
25 class CompressorPluginExample
: public CompressionPlugin
{
28 explicit CompressorPluginExample(CephContext
* cct
) : CompressionPlugin(cct
)
31 int factory(CompressorRef
*cs
,
34 if (compressor
== 0) {
35 CompressorExample
*interface
= new CompressorExample();
36 compressor
= CompressorRef(interface
);
43 // -----------------------------------------------------------------------------
45 const char *__ceph_plugin_version()
47 return CEPH_GIT_NICE_VER
;
50 // -----------------------------------------------------------------------------
52 int __ceph_plugin_init(CephContext
*cct
,
53 const std::string
& type
,
54 const std::string
& name
)
56 PluginRegistry
*instance
= cct
->get_plugin_registry();
58 return instance
->add(type
, name
, new CompressorPluginExample(cct
));