Imported Upstream version 1.5.1

This commit is contained in:
Mario Fetka 2020-09-22 02:25:22 +02:00
commit 434d6067d9
2103 changed files with 928962 additions and 0 deletions

20
AUTHORS Normal file
View File

@ -0,0 +1,20 @@
Michael Berlin
Eugenio Cesario
Johannes Dillmann
Jan Fajerski
Jens V. Fischer
Juan Gonzalez
Lukas Kairies
Christoph Kleineweber
Björn Kolbeck
Nico Kruber
Felix Langner
Philippe Lieser
Christian Lorenz
Matthias Noack
Patrick Schäfer
Robert Schmidtke
Thorsten Schuett
Paul Seiferth
Dmitry Smirnov
Jan Stender

92
CHANGELOG Normal file
View File

@ -0,0 +1,92 @@
12-MAR-2015: release 1.5.1
Changes:
* Hadoop Adapter supports Hadoop-2.x and other applications running on the YARN platform (tested with Apache Spark and Apache Flink), new OSD selection policy that imitates the HDFS placement behavior.
* Consistent adding and removing replicas for R/W replication.
* xtfs_scrup now replaces failed replicas using the R/W replication policy.
* Improvements of the SSL mode: the used SSL/TLS version is selectable, strict certificate chain checks are possible, the SSL code on client and server side was improved.
* Support for PKCS12 certificate containers is remove from the Windows client (did not work in previous release).
* mount.xtreemfs accepts all parameters to be passed in the form -o option=value. If XtreemFS is mounted via /etc/fstab, mount options are passed to the XtreemFS client.
* Dockerfiles for the XtreemFS services are available at https://github.com/xtreemfs/xtreemfs-docker.
* A Vagrantfile is available in the XtreemFS repository to ease development and testing for new contributors.
* Fixed snapshots in the case of deleted files.
* Snapshots can be deleted even after inactivating snapshots for a volume (issue 290).
* Initial version of an LD_PRELOAD based client that bypasses FUSE (experimental).
* Initial implementation of volume quotas (checked only while opening files by the MRC).
* OSDs can report their health to the DIR (e.g. based on SMART values), which aggregates this information in the web interface. A new OSD selection policy sorts out unhealthy OSDs.
* Improved automatic testing: introduced Travis-CI, migrated all JUnit tests to version 4, improved reliability of nightly integration tests.
* Added new benchmark tool xtfs_benchmark that is based on the JAVA libxtreemfs.
* Many small improvements and fixes.
12-MAR-2014: release 1.5 (Wonderful Waffles)
Changes:
* Improved Hadoop Adapter e.g., added support for multiple volumes and read and write buffer to speed up performance.
* Support for SSDs: Support for multiple OSD storage threads to increase parallelism.
* Status webpage as part of the DIR webinterface for replicated files to show current primary and backup replicas.
* Multi-homing support. XtreemFS can now be made available for multiple networks and clients will pick the correct address automatically.
* Support for multiple OSDs per machine (e.g. one for each disk) through the xtreemfs-osd-farm init.d script.
* Fixed major issues in Read-Only and Read/Write file replication.
* Reduced metadata cache default timeout from 120 to 10 seconds. Disable it completely with --metadata-cache-size=0.
* Upgraded to Google Protobuffers 2.5 which improves performance.
* Windows Client: Fixed several issues (e.g., 286, 299) and updated the CbFS driver to the latest version.
* XtreemFS also compiles under buildroot now.
* Fixed several issues around SSL (e.g., 263, 281).
* Fixed many small issues e.g., reported volume capacity was inaccurate (issue 296).
Other fixed issues: 267, 268, 272, 274, 276, 277, 278, 283, 287, 288, 292, 293, 294.
* Improved general stability (e.g., see issues 297, 301).
* xtfs_scrub now repairs replicas with an invalid checksum automatically.
* Disabled deferred deletion of file data on the OSDs.
* Improved test coverage of nightly tests and added missing unit tests and a Valgrind leak check for C++ unit tests.
12-NOV-2012: release 1.4 (Salty Sticks)
Changes:
* Improved stability: Fixed client crashes when timeouts occurred; fixed server crashes and issues with the R/W replication.
* Full support for asynchronous writes: If a client is started with "--enable-async-writes", write() requests will be immediately acknowledged by the client and executed in the background. Outstanding writes are always flushed at close() or fsync*() events. This improves the write throughput, especially in case of connections with high latency.
* Added Windows Client Beta which uses Eldos' Callback File System product instead of Dokan.
* Re-wrote HDFS interface implementation: Use XtreemFS as replacement for HDFS in your Hadoop setup.
* libxtreemfs for Java: Access XtreemFS directly from your Java application. See source files org.xtreemfs.common.libxtreemfs.{Client,Volume,FileHandle}.java for the interface.
* Re-added Vivaldi support and added/improved its functionality:
* Vivaldi is directly integrated in the client now and can be enabled with '--vivaldi-enable'.
* Added Vivaldi visualization: see '/vivaldi' subpage on DIR. Have a look at our demo server to get an impressium: http://demo.xtreemfs.org:30638/vivaldi
* Coordinates of clients can be also visualized if clients reporting was enabled with '--vivaldi-enable-dir-updates'.
* Added support for OSD Selection based on Custom Attributes. For example, assign a country code to every OSD as custom attribute and limit the placement of files on OSDs based on the attribute.
* Rewrote xtfs_scrub tool and fixed support for read-only replicated files and checksums. R/W replicas will be supported in the next release.
* Certificate password provided on command line no longer visible in process listing output. Additionally, the password can be entered on stdin now. (Issue 251)
* Support for binary extended attributes (allows to preserve POSIX ACLs when copying data to XtreemFS; however they are not evaluated - use the XtreemFS ACLs therefore).
* Fixed several client issues (e.g., 231, 234, 237).
* Fixed clock synchronization problems which impaired the DIR/MRC replication. This also fixed issue 236.
* Client: Added DIR fail over support. Specify multiple DIR replicas when mounting as follows: mount.xtreemfs dir1,dir2,dir3/volume. However, please note that the DIR/MRC replication is still experimental and not officially supported yet.
* MacOSX Client: Fixed wrong df output (issue 247). Fixed failed installer if XtreemFS is already installed (issue 239). Fixed installer check if FUSE is installed (also works for OSXFUSE now) (issue 197).
* Volume Snapshots Tools: Functionality was moved from "xtfs_snap" tool to "xtfsutil".
* Various minor fixes.
* MRC: To prevent confusion, global policy attributes are no longer allowed and always have to be prefixed by the policy id e.g., "1002.uuids".
* init.d scripts no longer store a lock file in /var/lock/subsys. You can remove this directory now.
03-NOV-2011: release 1.3.1
* Added 'xtfs_remove_osd' utility to remove OSDs from an XtreemFS installation. All files on the OSD to be removed will be relocated to different OSDs.
* Added first support for asynchronous writes in the client. Mounting with '--max-writeahead' and '--max-writeahead-requests' allows the user to specify the maximum number of bytes and requests to be sent to an OSD before receiving an acknowledgment. However, this feature currently does not work together with replication and retries.
* Added monitoring support to servers. Various characteristics are accessible now via SNMP, such as data transfer statistics, memory usage, numbers of files and directories, etc. A Ganglia plugin makes it possible to visualize them.
* improved stability of MRC/DIR replication
* improved the behavior of the read-write replication under heavy load by internally limiting the length of request queues
* made several usability changes to xtfsutil
* added '/babudb' subpage to MRC/DIR status page that shows internal database statistics
* added Gentoo overlay
* installing XtreemFS now creates symlinks '/sbin/mount.xtreemfs' and '/sbin/umount.xtreemfs' in order to support XtreemFS mounting via fstab (however, not all client options are available in the fstab yet, see issue 205)
* the replication policy "WaRa" was renamed to "WaR1"
* fixed issues 196, 198-204, 206-209, 211-218, 220, 222
* fixed a wide range of issues w/ read-only and read-write replication of files
* fixed issues w/ several MRC calls when admin passwords were specified (a consequence of this is that an XtreemFS 1.3.0 client can no longer mount admin_password protected MRCs; upgrade the client to 1.3.1 to fix this)
* fixed various client issues, such as deadlocks and memory leaks
10-AUG-2011: release 1.3.0 (Tasty Tartlet)
* added new features: full read-write replication of files, snapshots
* completely re-wrote the client
- it now supports metadata caching and automatic fail-over for replicated files
- a client library 'libxtreemfs' separates the client logic from platform-specific bindings (e.g. FUSE, Dokan)
* added first prototypes of metadata (MRC and DIR) replication
* merged all user tools into a new general-purpose tool 'xtfsutil'
* changed license from GPL to BSD

8
KNOWN_ISSUES Normal file
View File

@ -0,0 +1,8 @@
From release 1.3.1 on, we document all known limitations of XtreemFS
in our issue tracker and mark each with the label "KnownLimitations".
Please have a look at
https://github.com/xtreemfs/xtreemfs/labels/KnownLimitations
for the complete list of current known limitations.

35
LICENSE Normal file
View File

@ -0,0 +1,35 @@
Copyright (c) 2008-2012, Michael Berlin, Eugenio Cesario,
Juan Gonzalez, Björn Kolbeck, Felix Langner, Christian Lorenz,
Matthias Noack, Patrick Schäfer, Paul Seiferth, Jan Stender
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of the Zuse Institute Berlin nor the
names of its contributors may be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

349
Makefile Normal file
View File

@ -0,0 +1,349 @@
ifeq "$(JAVA_HOME)" ""
JAVAC_BIN = /usr/bin/javac
else
JAVAC_BIN = $(JAVA_HOME)/bin/javac
endif
ifeq "$(ANT_HOME)" ""
ANT_BIN = /usr/bin/ant
else
ANT_BIN = $(ANT_HOME)/bin/ant
endif
ifeq "$(CMAKE_HOME)" ""
CMAKE_BIN = cmake
else
CMAKE_BIN = $(CMAKE_HOME)/bin/cmake
endif
SHELL := $(shell which bash)
WHICH_GPP = $(shell which g++)
WHICH_CLANGPP = $(shell which clang++)
ifeq "$(shell uname)" "SunOS"
PROTOBUF_DISABLE_64_BIT_SOLARIS = "--disable-64bit-solaris"
endif
# Paths used during compilation.
XTREEMFS_CLIENT_BUILD_DIR=$(shell pwd)/cpp/build
XTREEMFS_BINARIES_DIR = $(shell pwd)/bin
# Install paths relative to DESTDIR.
XTREEMFS_JAR_DIR=$(DESTDIR)/usr/share/java
XTREEMFS_CONFIG_PARENT_DIR=$(DESTDIR)/etc/xos
XTREEMFS_CONFIG_DIR=$(XTREEMFS_CONFIG_PARENT_DIR)/xtreemfs
XTREEMFS_INIT_DIR=$(DESTDIR)/etc/init.d
XTREEMFS_SHARE_DIR=$(DESTDIR)/usr/share/xtreemfs
BIN_DIR=$(DESTDIR)/usr/bin
SBIN_DIR=$(DESTDIR)/sbin
MAN_DIR=$(DESTDIR)/usr/share/man/man1
DOC_DIR_SERVER=$(DESTDIR)/usr/share/doc/xtreemfs-server
DOC_DIR_CLIENT=$(DESTDIR)/usr/share/doc/xtreemfs-client
DOC_DIR_TOOLS=$(DESTDIR)/usr/share/doc/xtreemfs-tools
PLUGIN_CONFIG_DIR=$(XTREEMFS_CONFIG_DIR)/server-repl-plugin
#Configuration of cpp code thirdparty dependencies.
# If you edit the next five variables, make sure you also change them in cpp/CMakeLists.txt.
CLIENT_GOOGLE_PROTOBUF_CPP = cpp/thirdparty/protobuf-2.5.0
CLIENT_GOOGLE_PROTOBUF_CPP_LIBRARY = $(CLIENT_GOOGLE_PROTOBUF_CPP)/src/.libs/libprotobuf.a
CLIENT_GOOGLE_TEST_CPP = cpp/thirdparty/gtest-1.7.0
CLIENT_GOOGLE_TEST_CPP_LIBRARY = $(CLIENT_GOOGLE_TEST_CPP)/lib/.libs/libgtest.a
CLIENT_GOOGLE_TEST_CPP_MAIN = $(CLIENT_GOOGLE_TEST_CPP)/lib/.libs/libgtest_main.a
# The two required objects libgtest.a and libgtest_main.a both depend
# on the same target building the Google googletest library.
# Therefore, this target is guarded by a checkfile which will be touched once it was executed.
# This prevents the target from getting executed again as long as the checkfile does not change.
CLIENT_GOOGLE_TEST_CHECKFILE = .googletest_library_already_built
TARGETS = client server foundation flease
.PHONY: clean distclean set_version
all: check_server check_client check_test $(TARGETS)
clean: check_server check_client $(patsubst %,%_clean,$(TARGETS))
distclean: check_server check_client $(patsubst %,%_distclean,$(TARGETS))
install: install-client install-server install-tools
install-client:
@if [ ! -f $(XTREEMFS_BINARIES_DIR)/mkfs.xtreemfs ]; then echo "PLEASE RUN 'make client' FIRST!"; exit 1; fi
@mkdir -p $(DOC_DIR_CLIENT)
@cp LICENSE $(DOC_DIR_CLIENT)
@mkdir -p $(BIN_DIR)
@cp -p $(XTREEMFS_BINARIES_DIR)/*.xtreemfs $(XTREEMFS_BINARIES_DIR)/xtfsutil $(BIN_DIR)
# mount -t xtreemfs will be recognized when binaries are present in /sbin/. Only applicable if the Fuse Client was built.
@[ -f $(XTREEMFS_BINARIES_DIR)/mount.xtreemfs ] && mkdir -p $(SBIN_DIR); true
@[ -f $(XTREEMFS_BINARIES_DIR)/mount.xtreemfs ] && ln -s $(BIN_DIR)/mount.xtreemfs $(SBIN_DIR)/mount.xtreemfs; true
@[ -f $(XTREEMFS_BINARIES_DIR)/mount.xtreemfs ] && ln -s $(BIN_DIR)/umount.xtreemfs $(SBIN_DIR)/umount.xtreemfs; true
@mkdir -p $(XTREEMFS_CONFIG_DIR)
@cp etc/xos/xtreemfs/default_dir $(XTREEMFS_CONFIG_DIR)
@mkdir -p $(MAN_DIR)
@cp -R man/man1/*.xtreemfs* $(MAN_DIR)
@cp -R man/man1/xtfsutil.* $(MAN_DIR)
install-server:
@if [ ! -f java/servers/dist/XtreemFS.jar ]; then echo "PLEASE RUN 'make server' FIRST!"; exit 1; fi
@mkdir -p $(DOC_DIR_SERVER)
@cp LICENSE $(DOC_DIR_SERVER)
@mkdir -p $(XTREEMFS_JAR_DIR)
@cp java/servers/dist/XtreemFS.jar $(XTREEMFS_JAR_DIR)
@cp java/foundation/dist/Foundation.jar $(XTREEMFS_JAR_DIR)
@cp java/flease/dist/Flease.jar $(XTREEMFS_JAR_DIR)
@cp java/lib/*.jar $(XTREEMFS_JAR_DIR)
@cp contrib/server-repl-plugin/BabuDB_replication_plugin.jar $(XTREEMFS_JAR_DIR)
@mkdir -p $(XTREEMFS_CONFIG_DIR)
# @cp etc/xos/xtreemfs/*config.properties $(XTREEMFS_CONFIG_DIR)
# delete UUID from config-files
@grep -v '^uuid\W*=\W*\w\+' etc/xos/xtreemfs/dirconfig.properties > $(XTREEMFS_CONFIG_DIR)/dirconfig.properties
@grep -v '^uuid\W*=\W*\w\+' etc/xos/xtreemfs/mrcconfig.properties > $(XTREEMFS_CONFIG_DIR)/mrcconfig.properties
@grep -v '^uuid\W*=\W*\w\+' etc/xos/xtreemfs/osdconfig.properties > $(XTREEMFS_CONFIG_DIR)/osdconfig.properties
@mkdir -p $(PLUGIN_CONFIG_DIR)
@cp contrib/server-repl-plugin/config/dir.properties $(PLUGIN_CONFIG_DIR)
@cp contrib/server-repl-plugin/config/mrc.properties $(PLUGIN_CONFIG_DIR)
@cp packaging/generate_uuid $(XTREEMFS_CONFIG_DIR)
@cp packaging/postinstall_setup.sh $(XTREEMFS_CONFIG_DIR)
@chmod a+x $(XTREEMFS_CONFIG_DIR)/postinstall_setup.sh
# Generating init.d scripts based on template.
@etc/init.d/generate_initd_scripts.sh
@mkdir -p $(XTREEMFS_INIT_DIR)
@cp etc/init.d/xtreemfs-{dir,mrc,osd} $(XTREEMFS_INIT_DIR)
@chmod a+x $(XTREEMFS_INIT_DIR)/xtreemfs-*
@mkdir -p $(XTREEMFS_SHARE_DIR)
@cp contrib/xtreemfs-osd-farm/xtreemfs-osd-farm $(XTREEMFS_SHARE_DIR)
@echo "to complete the server installation, please execute $(XTREEMFS_CONFIG_DIR)/postinstall_setup.sh"
install-tools:
@if [ ! -f java/servers/dist/XtreemFS.jar ]; then echo "PLEASE RUN 'make server' FIRST!"; exit 1; fi
@mkdir -p $(DOC_DIR_TOOLS)
@cp LICENSE $(DOC_DIR_TOOLS)
@mkdir -p $(XTREEMFS_JAR_DIR)
@cp java/servers/dist/XtreemFS.jar $(XTREEMFS_JAR_DIR)
@cp java/foundation/dist/Foundation.jar $(XTREEMFS_JAR_DIR)
@cp java/flease/dist/Flease.jar $(XTREEMFS_JAR_DIR)
@cp java/lib/*.jar $(XTREEMFS_JAR_DIR)
@mkdir -p $(BIN_DIR)
@cp -p `ls $(XTREEMFS_BINARIES_DIR)/xtfs_* | grep -v xtfs_.*mount` $(BIN_DIR)
@mkdir -p $(MAN_DIR)
@cp -R man/man1/xtfs_* $(MAN_DIR)
uninstall:
@rm -rf $(DOC_DIR_SERVER)
@rm -rf $(DOC_DIR_CLIENT)
@rm -rf $(DOC_DIR_TOOLS)
@rm -rf $(BIN_DIR)/xtfs*
@rm -rf $(BIN_DIR)/*.xtreemfs
@rm -f $(SBIN_DIR)/mount.xtreemfs
@rm -f $(SBIN_DIR)/umount.xtreemfs
@rm -f $(XTREEMFS_JAR_DIR)/XtreemFS.jar
@rm -f $(XTREEMFS_JAR_DIR)/Foundation.jar
@rm -f $(XTREEMFS_JAR_DIR)/Flease.jar
@rm -f $(XTREEMFS_JAR_DIR)/BabuDB.jar
@rm -f $(XTREEMFS_JAR_DIR)/commons-codec-1.3.jar
@rm -f $(XTREEMFS_JAR_DIR)/jdmkrt.jar
@rm -f $(XTREEMFS_JAR_DIR)/jdmktk.jar
@rm -f $(XTREEMFS_JAR_DIR)/protobuf-java-2.5.0.jar
@rm -f $(XTREEMFS_JAR_DIR)/BabuDB_replication_plugin.jar
@rm -f $(XTREEMFS_INIT_DIR)/xtreemfs-*
@rm -rf $(MAN_DIR)/xtfs*
@rm -rf $(MAN_DIR)/*.xtreemfs*
@echo "uninstall complete"
purge: uninstall
@rm -rf $(XTREEMFS_CONFIG_DIR)
@echo "purge complete"
check_server:
@if [ ! -e $(JAVAC_BIN) ]; then echo "javac not found! Make sure a JDK is installed and set JAVA_HOME."; exit 1; fi;
@if [ $(shell $(JAVAC_BIN) -version 2>&1 | head -n1 | cut -d" " -f2 | cut -d. -f2) -lt 6 ]; then echo "java version >= 1.6.0 required!"; exit 1; fi;
@echo "java ok"
@if [ ! -e $(ANT_BIN) ]; then echo "ant not found! Make sure ant is installed and set ANT_HOME."; exit 1; fi;
@echo "ant ok"
check_client:
@if [ ! $(WHICH_GPP) -a ! $(WHICH_CLANGPP) ]; then echo "C++ compiler not found";exit 1; fi;
@if [ ! $(CMAKE_BIN) ]; then echo "cmake not found";exit 1; fi;
@echo "C++ ok"
check_test:
@if [[ $(shell python -V 2>&1 | head -n1 | cut -d" " -f2 | cut -d. -f2) -lt 3 && $(shell python -V 2>&1 | head -n1 | cut -d" " -f2 | cut -d. -f1) -lt 3 ]]; then echo "python >= 2.4 required!"; exit 1; fi;
@echo "python ok"
set_version:
# Try to set the SVN revision and branch name as part of the version. We don't care if this may fail.
ifndef SKIP_SET_SVN_VERSION
@./packaging/set_version.sh -s &>/dev/null; exit 0
endif
.PHONY: client client_clean client_distclean client_thirdparty_clean client_package_macosx
# Client section.
CLIENT_THIRDPARTY_REQUIREMENTS = $(CLIENT_GOOGLE_PROTOBUF_CPP_LIBRARY)
ifdef BUILD_CLIENT_TESTS
CLIENT_THIRDPARTY_REQUIREMENTS += $(CLIENT_GOOGLE_TEST_CPP_LIBRARY) $(CLIENT_GOOGLE_TEST_CPP_MAIN)
CMAKE_BUILD_CLIENT_TESTS = -DBUILD_CLIENT_TESTS=true
endif
# Do not use env variables to control the CMake behavior as stated in http://www.cmake.org/Wiki/CMake_FAQ#How_can_I_get_or_set_environment_variables.3F
# Instead define them via -D, so they will be cached.
ifdef BOOST_ROOT
CMAKE_BOOST_ROOT = -DBOOST_ROOT="$(BOOST_ROOT)" -DBoost_NO_SYSTEM_PATHS=ON
endif
# Tell CMake if it should ignore a missing Fuse.
ifdef SKIP_FUSE
CMAKE_SKIP_FUSE = -DSKIP_FUSE=true
endif
# Trigger building the experimental LD_PRELOAD library
ifdef BUILD_PRELOAD
CMAKE_BUILD_PRELOAD = -DBUILD_PRELOAD=true
endif
client_thirdparty: $(CLIENT_THIRDPARTY_REQUIREMENTS)
$(CLIENT_GOOGLE_PROTOBUF_CPP_LIBRARY): $(CLIENT_GOOGLE_PROTOBUF_CPP)/src/**
@echo "client_thirdparty: Configuring and building required Google protobuf library..."
@cd $(CLIENT_GOOGLE_PROTOBUF_CPP) && LIBS=-lpthread ./configure $(PROTOBUF_DISABLE_64_BIT_SOLARIS) >/dev/null
@$(MAKE) -C $(CLIENT_GOOGLE_PROTOBUF_CPP) >/dev/null
@echo "client_thirdparty: ...completed building required Google protobuf library."
@touch $(CLIENT_GOOGLE_PROTOBUF_CPP_LIBRARY)
$(CLIENT_GOOGLE_TEST_CPP_LIBRARY): $(CLIENT_GOOGLE_TEST_CHECKFILE)
@touch $(CLIENT_GOOGLE_TEST_CPP_LIBRARY)
$(CLIENT_GOOGLE_TEST_CPP_MAIN): $(CLIENT_GOOGLE_TEST_CHECKFILE)
@touch $(CLIENT_GOOGLE_TEST_CPP_MAIN)
$(CLIENT_GOOGLE_TEST_CHECKFILE): $(CLIENT_GOOGLE_TEST_CPP)/include/** $(CLIENT_GOOGLE_TEST_CPP)/src/**
@echo "client_thirdparty: Configuring and building required Google googletest library..."
@cd $(CLIENT_GOOGLE_TEST_CPP) && ./configure >/dev/null
@$(MAKE) -C $(CLIENT_GOOGLE_TEST_CPP) >/dev/null
@touch $(CLIENT_GOOGLE_TEST_CPP_LIBRARY)
@echo "client_thirdparty: ...completed building required Google googletest library."
@touch $(CLIENT_GOOGLE_TEST_CHECKFILE)
client_thirdparty_clean:
@if [ -f $(CLIENT_GOOGLE_PROTOBUF_CPP)/Makefile ]; then echo "Cleaning required Google protobuf library sources..."; $(MAKE) -C $(CLIENT_GOOGLE_PROTOBUF_CPP) clean >/dev/null; fi
@if [ -f $(shell pwd)/$(CLIENT_GOOGLE_TEST_CPP)/Makefile ]; then echo "Cleaning required Google googletest library sources..."; $(MAKE) -C $(shell pwd)/$(CLIENT_GOOGLE_TEST_CPP) clean >/dev/null; fi
@if [ -f $(CLIENT_GOOGLE_TEST_CHECKFILE) ]; then rm $(CLIENT_GOOGLE_TEST_CHECKFILE); fi
@echo "...finished cleaning thirdparty sources."
client_thirdparty_distclean:
@echo "client_thirdparty: Dist-Cleaning required Google protobuf library sources..."
@if [ -f $(shell pwd)/$(CLIENT_GOOGLE_PROTOBUF_CPP)/Makefile ]; then $(MAKE) -C $(shell pwd)/$(CLIENT_GOOGLE_PROTOBUF_CPP) distclean >/dev/null; fi
@echo "client_thirdparty: Dist-Cleaning required Google googletest library sources..."
@if [ -f $(shell pwd)/$(CLIENT_GOOGLE_TEST_CPP)/Makefile ]; then $(MAKE) -C $(shell pwd)/$(CLIENT_GOOGLE_TEST_CPP) distclean >/dev/null; fi
@if [ -f $(CLIENT_GOOGLE_TEST_CHECKFILE) ]; then rm $(CLIENT_GOOGLE_TEST_CHECKFILE); fi
@echo "client_thirdparty: ...finished distcleaning thirdparty sources."
client_debug: CLIENT_DEBUG = -DCMAKE_BUILD_TYPE=Debug
client_debug: client
client: check_client client_thirdparty set_version
$(CMAKE_BIN) -Hcpp -B$(XTREEMFS_CLIENT_BUILD_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 $(CLIENT_DEBUG) $(CMAKE_BOOST_ROOT) $(CMAKE_BUILD_CLIENT_TESTS) $(CMAKE_SKIP_FUSE) ${CMAKE_BUILD_PRELOAD}
@$(MAKE) -C $(XTREEMFS_CLIENT_BUILD_DIR)
@cd $(XTREEMFS_CLIENT_BUILD_DIR); for i in *.xtreemfs xtfsutil; do [ -f $(XTREEMFS_BINARIES_DIR)/$$i ] && rm -f $(XTREEMFS_BINARIES_DIR)/$$i; done; true
@cp -p $(XTREEMFS_CLIENT_BUILD_DIR)/*.xtreemfs $(XTREEMFS_BINARIES_DIR)
@cp -p $(XTREEMFS_CLIENT_BUILD_DIR)/xtfsutil $(XTREEMFS_BINARIES_DIR)
client_clean: check_client client_thirdparty_clean
@cd $(XTREEMFS_CLIENT_BUILD_DIR) &>/dev/null && { for i in *.xtreemfs xtfsutil; do [ -f $(XTREEMFS_BINARIES_DIR)/$$i ] && rm -f $(XTREEMFS_BINARIES_DIR)/$$i; done }; true
@rm -rf $(XTREEMFS_CLIENT_BUILD_DIR)
client_distclean: check_client client_thirdparty_distclean
@cd $(XTREEMFS_CLIENT_BUILD_DIR) &>/dev/null && { for i in *.xtreemfs xtfsutil; do [ -f $(XTREEMFS_BINARIES_DIR)/$$i ] && rm -f $(XTREEMFS_BINARIES_DIR)/$$i; done }; true
@rm -rf $(XTREEMFS_CLIENT_BUILD_DIR)
CLIENT_PACKAGE_MACOSX_OUTPUT_DIR = XtreemFS_Client_MacOSX.mpkg
CLIENT_PACKAGE_MACOSX_OUTPUT_FILE = XtreemFS_Client_MacOSX_installer.dmg
client_package_macosx:
ifeq ($(CMAKE_BOOST_ROOT),)
@echo No BOOST_ROOT environment variable is specified. This will probably fail. Please set it first.; exit 1
endif
@./packaging/set_version.sh -i
# Clean everything first to ensure we package a clean client.
@$(MAKE) client_distclean
# We call $(MAKE) instead of specifying the targets as requirements as its not possible to define dependencies between these two and this breaks in case of parallel builds.
@$(MAKE) client SKIP_SET_SVN_VERSION=1
@echo "Running the Apple Packagemaker..."
@/Developer/usr/bin/packagemaker -d packaging/macosx/XtreemFS_MacOSX_Package.pmdoc/ -o $(CLIENT_PACKAGE_MACOSX_OUTPUT_DIR)
@echo "Creating a DMG file..."
@if [ -f "$(CLIENT_PACKAGE_MACOSX_OUTPUT_FILE)" ]; then echo "Removing previous file $(CLIENT_PACKAGE_MACOSX_OUTPUT_FILE)."; rm "$(CLIENT_PACKAGE_MACOSX_OUTPUT_FILE)"; fi
@hdiutil create -fs HFS+ -srcfolder "$(CLIENT_PACKAGE_MACOSX_OUTPUT_DIR)" -volname "XtreemFS Client for MacOSX" "$(CLIENT_PACKAGE_MACOSX_OUTPUT_FILE)"
@if [ -d "$(CLIENT_PACKAGE_MACOSX_OUTPUT_DIR)" ]; then echo "Cleaning up temporary files..."; rm -r "$(CLIENT_PACKAGE_MACOSX_OUTPUT_DIR)"; fi
@echo "Package file created: $(CLIENT_PACKAGE_MACOSX_OUTPUT_FILE)"
.PHONY: flease flease_clean flease_distclean
flease: foundation
$(ANT_BIN) -D"file.encoding=UTF-8" -f java/flease/build-1.6.5.xml jar
flease_clean:
$(ANT_BIN) -D"file.encoding=UTF-8" -f java/flease/build-1.6.5.xml clean || exit 1;
flease_distclean:
$(ANT_BIN) -D"file.encoding=UTF-8" -f java/flease/build-1.6.5.xml clean || exit 1;
.PHONY: foundation foundation_clean foundation_distclean
foundation: set_version
$(ANT_BIN) -D"file.encoding=UTF-8" -f java/foundation/build-1.6.5.xml jar
foundation_clean:
$(ANT_BIN) -D"file.encoding=UTF-8" -f java/foundation/build-1.6.5.xml clean || exit 1;
foundation_distclean:
$(ANT_BIN) -D"file.encoding=UTF-8" -f java/foundation/build-1.6.5.xml clean || exit 1;
.PHONY: server server_clean server_distclean
server: check_server foundation flease
$(ANT_BIN) -D"file.encoding=UTF-8" -f java/servers/build-1.6.5.xml jar
server_clean: check_server
$(ANT_BIN) -D"file.encoding=UTF-8" -f java/servers/build-1.6.5.xml clean || exit 1;
server_distclean: check_server
$(ANT_BIN) -D"file.encoding=UTF-8" -f java/servers/build-1.6.5.xml clean || exit 1;
.PHONY: hadoop-client hadoop-client_clean hadoop-client_distclean
hadoop-client: server foundation
$(ANT_BIN) -D"file.encoding=UTF-8" -f contrib/hadoop/build.xml jar
@echo -e "\n\nHadoop Client was successfully compiled. You can find it here:\n\n\tcontrib/hadoop/dist/XtreemFSHadoopClient.jar\n\nSee the XtreemFS User Guide how to add it in Hadoop.\n"
hadoop-client_clean:
$(ANT_BIN) -D"file.encoding=UTF-8" -f contrib/hadoop/build.xml clean || exit 1
hadoop-client_distclean:
$(ANT_BIN) -D"file.encoding=UTF-8" -f contrib/hadoop/build.xml clean || exit 1
test: check_test client server
python ./tests/xtestenv -c ./tests/test_config.py short
pbrpcgen:
$(ANT_BIN) -D"file.encoding=UTF-8" -f java/pbrpcgen/build.xml
pbrpcgen_clean:
$(ANT_BIN) -D"file.encoding=UTF-8" -f java/pbrpcgen/build.xml clean || exit 1
interfaces: pbrpcgen client_thirdparty
$(MAKE) -C interface

13
README.md Normal file
View File

@ -0,0 +1,13 @@
XtreemFS is a distributed, replicated and fault-tolerant file system for federated IT infrastructures. It is open source software licensed under the New BSD License.
**For more information, downloads and documentation visit our website at http://www.XtreemFS.org.**
* Website: http://www.XtreemFS.org
* Downloads (Linux, MacOSX, Windows): http://www.XtreemFS.org/download.php
* User Documentation: http://www.XtreemFS.org/userguide.php
* Mailing List: http://groups.google.com/group/xtreemfs
* Tutorial for Replication Fail-Over Demo: https://code.google.com/p/xtreemfs/wiki/ContrailSummerSchoolHandsOn2013
The XtreemFS project is developed by Zuse Institute Berlin. The development of the project is funded by the European Commission since 2006 under Grant Agreements No. FP6-033576, FP7-ICT-257438, and FP7-318521, as well as the German projects MoSGrid, "First We Take Berlin", FFMK, GeoMultiSens, and BBDC.
[![Build Status](https://travis-ci.org/xtreemfs/xtreemfs.svg?branch=master)](https://travis-ci.org/xtreemfs/xtreemfs)

129
Vagrantfile vendored Normal file
View File

@ -0,0 +1,129 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"
# The url from where the 'config.vm.box' box will be fetched if it
# doesn't already exist on the user's system.
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network :forwarded_port, guest: 80, host: 8080
config.vm.network :forwarded_port, guest: 30636, host: 30636
config.vm.network :forwarded_port, guest: 32636, host: 32636
config.vm.network :forwarded_port, guest: 30638, host: 30638
config.vm.network :forwarded_port, guest: 32638, host: 32638
config.vm.network :forwarded_port, guest: 30640, host: 30640
config.vm.network :forwarded_port, guest: 32640, host: 32640
# Create a private network, which allows host-only access to the machine
# using a specific IP.
# config.vm.network :private_network, ip: "192.168.33.10"
# Create a public network, which generally matched to bridged network.
# Bridged networks make the machine appear as another physical device on
# your network.
# config.vm.network :public_network
# If true, then any SSH connections made will enable agent forwarding.
# Default value: false
# config.ssh.forward_agent = true
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.synced_folder ".", "/xtreemfs_src"
# Provider-specific configuration so you can fine-tune various
# backing providers for Vagrant. These expose provider-specific options.
# Example for VirtualBox:
#
# config.vm.provider :virtualbox do |vb|
# # Don't boot with headless mode
# vb.gui = true
#
# # Use VBoxManage to customize the VM. For example to change memory:
# vb.customize ["modifyvm", :id, "--memory", "1024"]
# end
#
# View the documentation for the provider you're using for more
# information on available options.
# Enable provisioning with Puppet stand alone. Puppet manifests
# are contained in a directory path relative to this Vagrantfile.
# You will need to create the manifests directory and a manifest in
# the file precise64.pp in the manifests_path directory.
#
# An example Puppet manifest to provision the message of the day:
#
# # group { "puppet":
# # ensure => "present",
# # }
# #
# # File { owner => 0, group => 0, mode => 0644 }
# #
# # file { '/etc/motd':
# # content => "Welcome to your Vagrant-built virtual machine!
# # Managed by Puppet.\n"
# # }
#
# config.vm.provision :puppet do |puppet|
# puppet.manifests_path = "manifests"
# puppet.manifest_file = "site.pp"
# end
# Enable provisioning with chef solo, specifying a cookbooks path, roles
# path, and data_bags path (all relative to this Vagrantfile), and adding
# some recipes and/or roles.
#
# config.vm.provision :chef_solo do |chef|
# chef.cookbooks_path = "../my-recipes/cookbooks"
# chef.roles_path = "../my-recipes/roles"
# chef.data_bags_path = "../my-recipes/data_bags"
# chef.add_recipe "mysql"
# chef.add_role "web"
#
# # You may also specify custom JSON attributes:
# chef.json = { :mysql_password => "foo" }
# end
# Enable provisioning with chef server, specifying the chef server URL,
# and the path to the validation key (relative to this Vagrantfile).
#
# The Opscode Platform uses HTTPS. Substitute your organization for
# ORGNAME in the URL and validation key.
#
# If you have your own Chef Server, use the appropriate URL, which may be
# HTTP instead of HTTPS depending on your configuration. Also change the
# validation key to validation.pem.
#
# config.vm.provision :chef_client do |chef|
# chef.chef_server_url = "https://api.opscode.com/organizations/ORGNAME"
# chef.validation_key_path = "ORGNAME-validator.pem"
# end
#
# If you're using the Opscode platform, your validator client is
# ORGNAME-validator, replacing ORGNAME with your organization name.
#
# If you have your own Chef Server, the default validation client name is
# chef-validator, unless you changed the configuration.
#
# chef.validation_client_name = "ORGNAME-validator"
config.vm.provision "shell", path: "contrib/vagrant/provision.sh"
end

2725
bin/cpplint.py vendored Executable file

File diff suppressed because it is too large Load Diff

4
bin/protoc-gen-pbrpc Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
FULLPATH=`readlink -f $0`
BASEDIR=`dirname ${FULLPATH}`
java -cp ${BASEDIR}/../java/pbrpcgen/dist/pbrpcgen.jar:${BASEDIR}/../java/lib/protobuf-java-2.5.0.jar org.xtreemfs.pbrpcgen.RPCSourceGenerator

4
bin/protoc-gen-pbrpccpp Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
FULLPATH=`readlink -f $0`
BASEDIR=`dirname ${FULLPATH}`
java -cp ${BASEDIR}/../java/pbrpcgen/dist/pbrpcgen.jar:${BASEDIR}/../java/lib/protobuf-java-2.5.0.jar org.xtreemfs.pbrpcgen.RPCCPPSourceGenerator

78
bin/toggle_jcip_annnotations.sh Executable file
View File

@ -0,0 +1,78 @@
#!/bin/bash
# Copyright (c) 2012 by Michael Berlin, Zuse Institute Berlin
#
# Licensed under the BSD License, see LICENSE file for details.
#
# This file is only used for developers of the Java code.
# It allows to comment and uncomment the JCIP annotations (http://www.jcip.net/).
#
# If JCIP annotations are enabled, the jcip-annotations.jar is required for
# compiling and running the XtreemFS code. However, we do not want to package
# it as part of binary packages. Therefore, this script is used to comment
# the annotations in the code. We do not delete the annotations from the code
# since we want to keep them as documentation - even if currently (Feb 2012)
# there is no tool available to evaluate them.
function display_usage() {
cat <<EOF
toogle_jcip_annotations.sh:
-h this screen
-c <path> Comments all JCIP annotations found in .java files in path
-u <path> Uncomments all JCIP annotations found in .java files in path
EOF
}
if [ -z "$1" ]
then
display_usage
exit 1
fi
while getopts ":hc:u:" opt
do
case $opt in
c)
mode="comment"
path="$OPTARG"
;;
u)
mode="uncomment"
path="$OPTARG"
;;
h)
display_usage
exit 1
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires a path as an argument." >&2
exit 1
;;
esac
done
if [ -z "$mode" ]
then
echo "Error: Run with -c <path> or -u <path>."
exit 1
fi
if [ ! "$path" ]
then
echo "Error: The given path \"$path\" does not exist."
exit 1
fi
comment_prefix="\/\/ JCIP "
if [ "$mode" = "comment" ]
then
# find "$path" -iname "*.java" -exec sed -r -i -e "s/^([^\/][^\/].*@(GuardedBy|Immutable|NotThreadSafe|ThreadSafe).*)$/$comment_prefix\1/" {} \;
find "$path" -iname "*.java" -exec sed -r -i -e "s/^([^\/][^\/].*(@|net\.jcip\.annotations\.)(GuardedBy|Immutable|NotThreadSafe|ThreadSafe).*)$/$comment_prefix\1/" {} \;
else
find "$path" -iname "*.java" -exec sed -r -i -e "s/^$comment_prefix([^\/][^\/].*(@|net\.jcip\.annotations\.)(GuardedBy|Immutable|NotThreadSafe|ThreadSafe).*)$/\1/" {} \;
fi

12
bin/umount.xtreemfs Executable file
View File

@ -0,0 +1,12 @@
#!/bin/bash
# a simple wrapper around fusermount -u, now passes all args to fusermount
if [ "x$1" == "x" -o "$1" == "--help" -o "$1" == "-h" ]
then
echo "usage: umount.xtreemfs <mount_point>"
echo ""
exit 1
fi
fusermount -u $@
exit $?

54
bin/xtfs_benchmark Executable file
View File

@ -0,0 +1,54 @@
#!/bin/bash
check_xtreemfs() {
if [ -z "$XTREEMFS" ]; then
if [ -d java -a -d cpp -a -d etc ]; then
#echo "Looks like you are in an XtreemFS base directory..."
XTREEMFS=`pwd`
elif [ -d ../java -a -d ../cpp -a -d ../etc ]; then
#echo "XTREEMFS base could be the parent directory..."
XTREEMFS=`pwd`/..
fi
fi
if [ ! -e "$XTREEMFS/java/servers/dist/XtreemFS.jar" -a ! -d "$XTREEMFS/java/lib" -a ! -f "/usr/share/java/XtreemFS.jar" ];
then
echo "XtreemFS jar could not be found!"
exit 1
fi
}
check_java() {
if [ -z "$JAVA_HOME" -a ! -f "/usr/bin/java" ]; then
echo "\$JAVA_HOME not set, JDK/JRE 1.6 required"
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
JAVA_HOME=/usr
fi
JVERS=`$JAVA_HOME/bin/java -version 2>&1 | grep "java version" | \
cut -d " " -f 3`
test "$JVERS" \> "\"1.6.0"
if [ $? -eq 1 ]; then
echo "Java version is $JVERS. You need JAVA 1.6!!!"
exit 1
fi
#echo "Java version $JVERS found under $JAVA_HOME"
}
check_xtreemfs
check_java
# exec $JAVA_HOME/bin/java -Dcom.sun.sdp.conf=$XTREEMFS/sdp.conf -Dcom.sun.sdp.debug=sdp.log -Djava.net.preferIPv4Stack=true -ea -cp $XTREEMFS/java/servers/dist/XtreemFS.jar:$XTREEMFS/java/foundation/dist/Foundation.jar:$XTREEMFS/java/lib/*:/usr/share/java/XtreemFS.jar:/usr/share/java/protobuf-java-2.3.0.jar:/usr/share/java/Foundation.jar:. \
# org.xtreemfs.utils.xtfs_benchmark.xtfs_benchmark $*
exec $JAVA_HOME/bin/java -ea -cp $XTREEMFS/java/servers/dist/XtreemFS.jar:$XTREEMFS/java/foundation/dist/Foundation.jar:$XTREEMFS/java/lib/*:/usr/share/java/XtreemFS.jar:/usr/share/java/protobuf-java-2.3.0.jar:/usr/share/java/Foundation.jar:. \
org.xtreemfs.utils.xtfs_benchmark.xtfs_benchmark $*
# exec $JAVA_HOME/bin/java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=3128 -ea -cp $XTREEMFS/java/servers/dist/XtreemFS.jar:$XTREEMFS/java/foundation/dist/Foundation.jar:$XTREEMFS/java/lib/*:/usr/share/java/XtreemFS.jar:/usr/share/java/protobuf-java-2.3.0.jar:/usr/share/java/Foundation.jar:. \
# org.xtreemfs.utils.xtfs_benchmark.xtfs_benchmark $*

46
bin/xtfs_chstatus Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
check_xtreemfs() {
if [ -z "$XTREEMFS" ]; then
if [ -d java -a -d cpp -a -d etc ]; then
#echo "Looks like you are in an XtreemFS base directory..."
XTREEMFS=`pwd`
elif [ -d ../java -a -d ../cpp -a -d ../etc ]; then
#echo "XTREEMFS base could be the parent directory..."
XTREEMFS=`pwd`/..
fi
fi
if [ ! -e "$XTREEMFS/java/servers/dist/XtreemFS.jar" -a ! -d "$XTREEMFS/java/lib" -a ! -f "/usr/share/java/XtreemFS.jar" ];
then
echo "XtreemFS jar could not be found!"
exit 1
fi
}
check_java() {
if [ -z "$JAVA_HOME" -a ! -f "/usr/bin/java" ]; then
echo "\$JAVA_HOME not set, JDK/JRE 1.6 required"
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
JAVA_HOME=/usr
fi
JVERS=`$JAVA_HOME/bin/java -version 2>&1 | grep "java version" | \
cut -d " " -f 3`
test "$JVERS" \> "\"1.6.0"
if [ $? -eq 1 ]; then
echo "Java version is $JVERS. You need JAVA 1.6!!!"
exit 1
fi
#echo "Java version $JVERS found under $JAVA_HOME"
}
check_xtreemfs
check_java
exec $JAVA_HOME/bin/java -ea -cp $XTREEMFS/java/servers/dist/XtreemFS.jar:$XTREEMFS/java/foundation/dist/Foundation.jar:$XTREEMFS/java/lib/*:/usr/share/java/XtreemFS.jar:/usr/share/java/protobuf-java-2.5.0.jar:/usr/share/java/Foundation.jar:. \
org.xtreemfs.utils.xtfs_chstatus $*

46
bin/xtfs_cleanup Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
check_xtreemfs() {
if [ -z "$XTREEMFS" ]; then
if [ -d java -a -d cpp -a -d etc ]; then
#echo "Looks like you are in an XtreemFS base directory..."
XTREEMFS=`pwd`
elif [ -d ../java -a -d ../cpp -a -d ../etc ]; then
#echo "XTREEMFS base could be the parent directory..."
XTREEMFS=`pwd`/..
fi
fi
if [ ! -e "$XTREEMFS/java/servers/dist/XtreemFS.jar" -a ! -d "$XTREEMFS/java/lib" -a ! -f "/usr/share/java/XtreemFS.jar" ];
then
echo "XtreemFS jar could not be found!"
exit 1
fi
}
check_java() {
if [ -z "$JAVA_HOME" -a ! -f "/usr/bin/java" ]; then
echo "\$JAVA_HOME not set, JDK/JRE 1.6 required"
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
JAVA_HOME=/usr
fi
JVERS=`$JAVA_HOME/bin/java -version 2>&1 | grep "java version" | \
cut -d " " -f 3`
test "$JVERS" \> "\"1.6.0"
if [ $? -eq 1 ]; then
echo "Java version is $JVERS. You need JAVA 1.6!!!"
exit 1
fi
#echo "Java version $JVERS found under $JAVA_HOME"
}
check_xtreemfs
check_java
exec $JAVA_HOME/bin/java -ea -cp $XTREEMFS/java/servers/dist/XtreemFS.jar:$XTREEMFS/java/foundation/dist/Foundation.jar:$XTREEMFS/java/lib/*:/usr/share/java/XtreemFS.jar:/usr/share/java/protobuf-java-2.5.0.jar:/usr/share/java/Foundation.jar:. \
org.xtreemfs.utils.xtfs_cleanup_osd $*

46
bin/xtfs_mrcdbtool Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
check_xtreemfs() {
if [ -z "$XTREEMFS" ]; then
if [ -d java -a -d cpp -a -d etc ]; then
#echo "Looks like you are in an XtreemFS base directory..."
XTREEMFS=`pwd`
elif [ -d ../java -a -d ../cpp -a -d ../etc ]; then
#echo "XTREEMFS base could be the parent directory..."
XTREEMFS=`pwd`/..
fi
fi
if [ ! -e "$XTREEMFS/java/servers/dist/XtreemFS.jar" -a ! -d "$XTREEMFS/java/lib" -a ! -f "/usr/share/java/XtreemFS.jar" ];
then
echo "XtreemFS jar could not be found!"
exit 1
fi
}
check_java() {
if [ -z "$JAVA_HOME" -a ! -f "/usr/bin/java" ]; then
echo "\$JAVA_HOME not set, JDK/JRE 1.6 required"
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
JAVA_HOME=/usr
fi
JVERS=`$JAVA_HOME/bin/java -version 2>&1 | grep "java version" | \
cut -d " " -f 3`
test "$JVERS" \> "\"1.6.0"
if [ $? -eq 1 ]; then
echo "Java version is $JVERS. You need JAVA 1.6!!!"
exit 1
fi
#echo "Java version $JVERS found under $JAVA_HOME"
}
check_xtreemfs
check_java
exec $JAVA_HOME/bin/java -ea -cp $XTREEMFS/java/servers/dist/XtreemFS.jar:$XTREEMFS/java/foundation/dist/Foundation.jar:$XTREEMFS/java/lib/*:/usr/share/java/XtreemFS.jar:/usr/share/java/protobuf-java-2.5.0.jar:/usr/share/java/Foundation.jar:. \
org.xtreemfs.utils.xtfs_mrcdbtool $*

46
bin/xtfs_remove_osd Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
check_xtreemfs() {
if [ -z "$XTREEMFS" ]; then
if [ -d java -a -d cpp -a -d etc ]; then
#echo "Looks like you are in an XtreemFS base directory..."
XTREEMFS=`pwd`
elif [ -d ../java -a -d ../cpp -a -d ../etc ]; then
#echo "XTREEMFS base could be the parent directory..."
XTREEMFS=`pwd`/..
fi
fi
if [ ! -e "$XTREEMFS/java/servers/dist/XtreemFS.jar" -a ! -d "$XTREEMFS/java/lib" -a ! -f "/usr/share/java/XtreemFS.jar" ];
then
echo "XtreemFS jar could not be found!"
exit 1
fi
}
check_java() {
if [ -z "$JAVA_HOME" -a ! -f "/usr/bin/java" ]; then
echo "\$JAVA_HOME not set, JDK/JRE 1.6 required"
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
JAVA_HOME=/usr
fi
JVERS=`$JAVA_HOME/bin/java -version 2>&1 | grep "java version" | \
cut -d " " -f 3`
test "$JVERS" \> "\"1.6.0"
if [ $? -eq 1 ]; then
echo "Java version is $JVERS. You need JAVA 1.6!!!"
exit 1
fi
#echo "Java version $JVERS found under $JAVA_HOME"
}
check_xtreemfs
check_java
exec $JAVA_HOME/bin/java -ea -cp $XTREEMFS/java/servers/dist/XtreemFS.jar:$XTREEMFS/java/foundation/dist/Foundation.jar:$XTREEMFS/java/lib/*:/usr/share/java/XtreemFS.jar:/usr/share/java/protobuf-java-2.5.0.jar:/usr/share/java/Foundation.jar:. \
org.xtreemfs.utils.xtfs_remove_osd $*

46
bin/xtfs_scrub Executable file
View File

@ -0,0 +1,46 @@
#!/bin/bash
check_xtreemfs() {
if [ -z "$XTREEMFS" ]; then
if [ -d java -a -d cpp -a -d etc ]; then
#echo "Looks like you are in an XtreemFS base directory..."
XTREEMFS=`pwd`
elif [ -d ../java -a -d ../cpp -a -d ../etc ]; then
#echo "XTREEMFS base could be the parent directory..."
XTREEMFS=`pwd`/..
fi
fi
if [ ! -e "$XTREEMFS/java/servers/dist/XtreemFS.jar" -a ! -d "$XTREEMFS/java/lib" -a ! -f "/usr/share/java/XtreemFS.jar" ];
then
echo "XtreemFS jar could not be found!"
exit 1
fi
}
check_java() {
if [ -z "$JAVA_HOME" -a ! -f "/usr/bin/java" ]; then
echo "\$JAVA_HOME not set, JDK/JRE 1.6 required"
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
JAVA_HOME=/usr
fi
JVERS=`$JAVA_HOME/bin/java -version 2>&1 | grep "java version" | \
cut -d " " -f 3`
test "$JVERS" \> "\"1.6.0"
if [ $? -eq 1 ]; then
echo "Java version is $JVERS. You need JAVA 1.6!!!"
exit 1
fi
#echo "Java version $JVERS found under $JAVA_HOME"
}
check_xtreemfs
check_java
exec $JAVA_HOME/bin/java -ea -cp $XTREEMFS/java/servers/dist/XtreemFS.jar:$XTREEMFS/java/foundation/dist/Foundation.jar:$XTREEMFS/java/lib/*:/usr/share/java/XtreemFS.jar:/usr/share/java/protobuf-java-2.5.0.jar:/usr/share/java/Foundation.jar:. \
org.xtreemfs.utils.xtfs_scrub.xtfs_scrub $*

403
contrib/benchmark/benchmark.sh Executable file
View File

@ -0,0 +1,403 @@
#!/bin/bash
# the timeout for one execution of xtfs_benchmark
TIMEOUT=1500
# the timeout for one cleanup
TIMEOUT_CLEANUP=300
# the time to sleep after a cleanup
SLEEPTIME=600
# if false, the script will not sleep after a cleanup and after drop_caches
# (-v will set false)
SLEEP=true
# the size of the basefile for random benchmarks
BASEFILE_SIZE="100g"
# the directories for the logfiles and the results
LOG_BASE=${BENCH_LOG:-$HOME}
LOG_DIR="$LOG_BASE/log"
RESULT_DIR="$LOG_BASE/result"
# Drops caches after each benchmark. Uncomment to activate
# cp "drop_caches" to "/usr/local/bin" and add "ALL ALL=NOPASSWD: /usr/local/bin/drop_caches" to sudoers file
DROP_CACHES=${BENCH_DROP_CACHES:-"/usr/local/bin/drop_caches"}
if [[ $DROP_CACHES != "false" ]]; then
DROP_CACHES_CALL="sudo ${DROP_CACHES}"
fi
# IP and Port of the DIR
DIR=${BENCH_DIR:-"localhost:32638"}
# IP and Port of the MRC
MRC=${BENCH_MRC:-"localhost:32636"}
# space separed list of OSD_UUIDS, e.g. "osd1 osd2 ..."
OSD_UUIDS=${BENCH_OSD_UUIDS:-"test-osd0"}
# stripe size for a volume
STRIPE_SIZE="128K"
# request size for each I/O operation
REQUEST_SIZE=$STRIPE_SIZE
# replication settings
REPLICATION_POLICY=""
REPLICATION_FACTOR=1
check_env(){
# check XTREEMFS
if [ -z "$XTREEMFS" ]; then
if [ -d java -a -d cpp -a -d etc ]; then
#echo "Looks like you are in an XtreemFS base directory..."
XTREEMFS=`pwd`
elif [ -d ../java -a -d ../cpp -a -d ../etc ]; then
#echo "XTREEMFS base could be the parent directory..."
XTREEMFS=`pwd`/..
fi
fi
if [ ! -e "$XTREEMFS/java/servers/dist/XtreemFS.jar" -a ! -d "$XTREEMFS/java/lib" -a ! -f "/usr/share/java/XtreemFS.jar" ];
then
echo "XtreemFS jar could not be found!"
exit 1
fi
# check JAVA_HOME
if [ -z "$JAVA_HOME" -a ! -f "/usr/bin/java" ]; then
echo "\$JAVA_HOME not set, JDK/JRE 1.6 required"
exit 1
fi
if [ -z "$JAVA_HOME" ]; then
JAVA_HOME=/usr
fi
}
printUsage() {
cat << EOF
Synopsis
$(basename $0) -t TYPE -s NUMBER [-x NUMBER] [-p POLICY -f NUMBER] [-b NUMBER -e NUMBER] [-r NUMBER] [-v]
Run a XtreemFS benchmark series, i.e. a series of benchmarks with increasing
numbers of threads. Logs are placed in \$HOME/log/, results in \$HOME/results
(can be changed at the head of the script).
-t type
Type of benchmarks to run. Type can be either of the following:
sw sequential write
usw unaligned sequential write
sr sequential read
rw random write
rr random read
-s size
Size of one benchmark, modifier K (for KiB), M (for MiB) or G (for GiB) is mandatory.
-c size
Size of each read/write request, modifier K (for KiB), M (for MiB) or G (for GiB) is mandatory.
Defaults to 128K.
-i size
Stripe size for each volume, modifier K (for KiB), M (for MiB) or G (for GiB) is mandatory.
Defaults to 128K.
-p policy
Replication policy to use. Defaults to none.
-f factor
Replication factor to use. Defaults to 1.
-b number of threads to beginn the benchmark series
Minimum number of threads to be run as the benchmarks series.
The series will run benchmarks between the 'begin' and the 'end' number of threads.
-e number of threads to end the benchmark series
Maximum number of threads to be run as the benchmarks series.
The series will run benchmarks between the 'begin' and the 'end' number of threads.
-r repetitions
Number of times a benchmark is repeated.
-v verbose
If set, bash debugging is enabled ('set -x') and sleeping after the benchmarks
is disabled.
EOF
}
init_params(){
check_env
if ! [ -d $LOG_DIR ]; then
echo "$LOG_DIR doesn't existing. Creating $LOG_DIR..."
mkdir -p $LOG_DIR
fi
if ! [ -d $RESULT_DIR ]; then
echo "$RESULT_DIR doesn't existing. Creating $RESULT_DIR"
mkdir -p $RESULT_DIR
fi
THREADS="$(seq $BEGIN $END)"
REPETITIONS="$(seq 1 $REPETITIONS)"
# use second resolution in case multiple benchmarks are run per minute
NOW=$(date +"%y-%m-%d_%H-%M-%S")
# redirect stdout and stderr
exec 2> >(tee $LOG_DIR/$TYPE-$NOW.log)
exec > >(tee $RESULT_DIR/$TYPE-$NOW.csv)
BASEFILE_SIZE=$(parse_size $BASEFILE_SIZE)
REQUEST_SIZE=$(parse_size $REQUEST_SIZE)
STRIPE_SIZE=$(parse_size $STRIPE_SIZE)
}
parse_size(){
local size_with_modifier=$1
local index=$(echo `expr match $size_with_modifier '[0-9]\+'`)
local size=${size_with_modifier:0:$index}
local modifier=${size_with_modifier:$index}
if [ $index != ${#size_with_modifier} ]; then
if [ $modifier = "K" ] || [ $modifier = "k" ]; then
size=$(echo "$size*2^10" | bc)
elif [ $modifier = "M" ] || [ $modifier = "m" ]; then
size=$(echo "$size*2^20" | bc)
elif [ $modifier = "G" ] || [ $modifier = "g" ]; then
size=$(echo "$size*2^30" | bc)
else
echo "Wrong size modifier. Only 'M' and 'G' are allowed"
exit 1
fi
fi
echo $size
}
prepare_seq_read(){
local size=$1
local threads=$2
# declare array of volume names
local volume_index=$(echo "$threads-1" | bc)
for i in $(seq 0 $volume_index); do VOLUMES[$i]=benchmark$i; done
echo -e "\nPreparing sequential read benchmarks\n" >&2
for i in $(seq 1 $threads); do
local index=$(echo "$i-1"|bc)
timeout --foreground $TIMEOUT $XTREEMFS/bin/xtfs_benchmark -sw -ssize $1 --no-cleanup --user $USER \
${VOLUMES[$index]} --stripe-size $STRIPE_SIZE --chunk-size $REQUEST_SIZE
done
}
prepare_random(){
local threads=$1
# declare array of volume names
local volume_index=$(echo "$threads-1" | bc)
for i in $(seq 0 $volume_index); do VOLUMES[$i]=benchmark$i; done
# calc basefile size and round to a number divideable through REQUEST_SIZE
local basefile_size=$(echo "(($BASEFILE_SIZE/$threads)/$REQUEST_SIZE)*$REQUEST_SIZE" | bc)
echo -e "\nPreparing random benchmark: Creating a basefiles\n" >&2
for i in $(seq 1 $threads); do
local index=$(echo "$i-1"|bc)
timeout --foreground $TIMEOUT $XTREEMFS/bin/xtfs_benchmark -rr -rsize $REQUEST_SIZE --no-cleanup-basefile --no-cleanup-volumes --user $USER \
--basefile-size $basefile_size ${VOLUMES[$index]} --stripe-size $STRIPE_SIZE --chunk-size $REQUEST_SIZE
done
}
run_benchmark(){
local benchType=$1
local size=$2
local threads=$3
local replicationOpt=""
if [[ $REPLICATION_POLICY != "" ]]; then
replicationOpt="--replication-policy $REPLICATION_POLICY"
fi
if [ $benchType = "sr" ]; then
XTREEMFS=$XTREEMFS timeout --foreground $TIMEOUT $XTREEMFS/bin/xtfs_benchmark -$benchType -ssize $size -n $threads --no-cleanup-volumes --user $USER \
$replicationOpt --replication-factor $REPLICATION_FACTOR --chunk-size $REQUEST_SIZE --stripe-size $STRIPE_SIZE
elif [ $benchType = "sw" ] || [ $benchType = "usw" ]; then
XTREEMFS=$XTREEMFS timeout --foreground $TIMEOUT $XTREEMFS/bin/xtfs_benchmark -$benchType -ssize $size -n $threads --user $USER \
$replicationOpt --replication-factor $REPLICATION_FACTOR --chunk-size $REQUEST_SIZE --stripe-size $STRIPE_SIZE
elif [ $benchType = "rw" ] || [ $benchType = "rr" ]; then
# calc basefile size and round to a number divideable through REQUEST_SIZE
local basefile_size=$(echo "(($BASEFILE_SIZE/$threads)/$REQUEST_SIZE)*$REQUEST_SIZE" | bc)
XTREEMFS=$XTREEMFS timeout --foreground $TIMEOUT $XTREEMFS/bin/xtfs_benchmark -$benchType -rsize $size --basefile-size $basefile_size -n $threads \
--no-cleanup-basefile --no-cleanup-volumes --user $USER \
$replicationOpt --replication-factor $REPLICATION_FACTOR --chunk-size $REQUEST_SIZE --stripe-size $STRIPE_SIZE
fi
local bench_exit_status=$?
if [ $bench_exit_status -eq 124 ]; then
echo "The benchmark timed out (Timeout: $TIMEOUT)" >&2
interrupted_exit
elif [ $bench_exit_status -ne 0 ]; then
echo "The benchmark did not finish with exit status 0" >&2
interrupted_exit
fi
# cleanup after *every* benchmark only for seq write benchmark
if [ $benchType = "sr" ]; then
cleanup_osd
fi
}
delete_volumes(){
local number_of_threads=$1
local volume_index=$(echo "$number_of_threads-1" | bc)
for i in $(seq 0 $volume_index); do
rmfs.xtreemfs -f $MRC/benchmark$i >/dev/null
if [ $? -eq 0 ]; then
echo "Removed volume benchmark$i" >&2
fi
done
}
cleanup_osd(){
for osd in $OSD_UUIDS; do
timeout --foreground $TIMEOUT_CLEANUP $XTREEMFS/bin/xtfs_cleanup -dir pbrpc://$DIR -wait -e -delete_volumes uuid:$osd >&2
done
if $SLEEP; then
echo "Start Sleeping for $(echo "$SLEEPTIME/60"|bc) minutes at $(date)" >&2
sleep $SLEEPTIME
echo "Finished Sleeping at $(date)" >&2
fi
drop_caches
}
interrupted_exit(){
echo "Unexpected exit, cleaning up..." >&2
SLEEP=false
delete_volumes $END
cleanup_osd
exit 1
}
drop_caches(){
if [ -n "$DROP_CACHES_CALL" ]; then
echo "Dropping caches" >&2
$DROP_CACHES_CALL
if $SLEEP; then
sleep 10
fi
fi
}
##### main ###
trap "echo; echo 'Interrupt received '; interrupted_exit" INT
# show usage if invoked without options/arguments
if [ $# -eq 0 ]; then
printUsage
exit 1
fi
# default values
BEGIN=1
END=1
REPETITIONS=1
# parse options
while getopts ":t:s:c:i:b:e:r:p:f:v" opt; do
case $opt in
t)
if [ $OPTARG = "sw" ] || [ $OPTARG = "usw" ] || [ $OPTARG = "sr" ] || [ $OPTARG = "rw" ] || [ $OPTARG = "rr" ]; then
TYPE=$OPTARG
else
echo 'wrong argument to -t. Needs to be either "sw", "usw", "sr", "rw" or "rr"'
exit 1
fi
;;
s)
SIZE=$(parse_size $OPTARG)
;;
c)
REQUEST_SIZE=$(parse_size $OPTARG)
;;
i)
STRIPE_SIZE=$(parse_size $OPTARG)
;;
b)
BEGIN=$OPTARG
;;
e)
END=$OPTARG
;;
r)
REPETITIONS=$OPTARG
;;
p)
REPLICATION_POLICY=$OPTARG
;;
f)
REPLICATION_FACTOR=$OPTARG
;;
v)
SLEEP=false
set -x
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
esac
done
init_params
drop_caches
echo "Running:" $0 $@ >&2
for i in $THREADS; do
size="$(echo "$SIZE/$i"|bc)"
if [ $TYPE != "usw" ]; then
size="$(echo "($size/$REQUEST_SIZE)*$REQUEST_SIZE" | bc)" # round down to a size divideable through the REQUEST_SIZE
fi
if [ $TYPE = "sr" ]; then
prepare_seq_read $size $i
cleanup_osd
elif [ $TYPE = "rw" ] || [ $TYPE = "rr" ]; then
prepare_random $i
fi
for j in $REPETITIONS; do
echo "Start $i-Thread-Benchmark Nr. $j" >&2
run_benchmark $TYPE $size $i
echo "Finished $i-Thread-Benchmark Nr. $j" >&2
done
# seq write benchmarks run cleanup after every benchmark, so this would be redundant
if [ $TYPE != "sw" ] && [ $TYPE != "usw" ]; then
volume_index=$(echo "$i-1" | bc)
for i in $(seq 0 $volume_index); do
rmfs.xtreemfs -f $MRC/benchmark$i >&2
echo "Remove volume benchmark$i" >&2
done
cleanup_osd
fi
done

3
contrib/benchmark/drop_caches Executable file
View File

@ -0,0 +1,3 @@
#!/bin/bash
/bin/bash -c "echo 3 > /proc/sys/vm/drop_caches"

View File

@ -0,0 +1,69 @@
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
extension-element-prefixes="date">
<!--
Copyright (c) 2013 by Michael Berlin, Zuse Institute Berlin
Licensed under the BSD License, see LICENSE file for details.
This file transforms a MRC database dump (in XML format) into
a list of files. The output format is as follows:
volume name/path on volume|creation time|file size|file's owner name
The current version lists only files which are placed on an OSD
with the UUID 'zib.mosgrid.osd15' (see line 34).
You can use the 'xsltproc' tool to apply this transformation to a XML dump.
Example: xsltproc -o filtered_files_output.txt filter_files.xslt /tmp/dump.xml
-->
<xsl:output omit-xml-declaration="yes"/>
<!--Strip off white space from all elements. We take care of the format on our own.-->
<xsl:strip-space elements="*"/>
<!--For each volume, process its "file" elements.-->
<xsl:template match="volume">
<xsl:apply-templates select="//file"/>
</xsl:template>
<xsl:template match="file[xlocList/xloc/osd/@location='zib.mosgrid.osd15']">
<!--Traverse the path of the <file> element and output the 'name' attribute of
each element to display the file system path.
The first entry is the name of the volume.-->
<xsl:for-each select="ancestor-or-self::*/@name">
<!--We ignore the <volume> element because its name is repeated as <dir> element below.-->
<xsl:if test="local-name(..) != 'volume'">
<!--Output path element.-->
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<!--Display separator.-->
<xsl:text>/</xsl:text>
</xsl:if>
</xsl:if>
</xsl:for-each>
<!--Creation time.-->
<xsl:text>|</xsl:text>
<xsl:value-of select="date:add('1970-01-01T00:00:00Z', date:duration(@ctime))"/>
<!--File size.-->
<xsl:text>|</xsl:text>
<xsl:value-of select="@size"/>
<!--Owner.-->
<xsl:text>|</xsl:text>
<xsl:value-of select="@uid"/>
<!--New line.-->
<xsl:text>&#xa;</xsl:text>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ganglia-plugin</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse-pydev version="1.0"?>
<pydev_project>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.6</pydev_property>
<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
<path>/ganglia-plugin/src</path>
</pydev_pathproperty>
</pydev_project>

View File

@ -0,0 +1,6 @@
How to use this plugin?
- Make sure your ganglia installation supports python plugins.
- Copy plugin files from src directory to /usr/lib/ganglia/python_modules/
- Copy configuration files configuration-files directory to /etc/ganglia/conf.d
- Alter configuration files to suite your needs.

View File

@ -0,0 +1,61 @@
modules {
module {
name = "xtfs-dir-plugin"
language = "python"
# The following params are examples only
param Host {
value = localhost
}
param Port {
value = 9001
}
param CommunityString {
value = public
}
}
}
collection_group {
collect_every = 60
time_threshold = 10
metric {
name = "dir_jvm_used_mem"
title = "used memory of the jvm"
value_threshold = 1
}
metric {
name = "dir_jvm_free_mem"
title = "free memory of the jvm"
value_threshold = 1
}
metric {
name = "dir_client_connections"
title = "number of Clients"
value_threshold = 1
}
metric {
name = "dir_pending_requests"
title = "number of pending requests"
value_threshold = 1
}
metric {
name = "addr_mapping_count"
title = "number of address mappings"
value_threshold = 1
}
metric {
name = "service_count"
title = "number of services"
value_threshold = 1
}
metric {
name = "dir_status"
title = "Status DIR"
}
metric {
name = "dir_uuid"
title = "DIR UUID"
}
}

View File

@ -0,0 +1,56 @@
modules {
module {
name = "xtfs-mrc-plugin"
language = "python"
# The following params are examples only
param Host {
value = localhost
}
param Port {
value = 9002
}
param CommunityString {
value = public
}
}
}
collection_group {
collect_every = 60
time_threshold = 10
metric {
name = "mrc_jvm_used_mem"
title = "used memory of the jvm"
value_threshold = 1
}
metric {
name = "mrc_jvm_free_mem"
title = "free memory of the jvm"
value_threshold = 1
}
metric {
name = "mrc_client_connections"
title = "number of Clients"
value_threshold = 1
}
metric {
name = "mrc_pending_requests"
title = "number of pending requests"
value_threshold = 1
}
metric {
name = "volumes_count"
title = "number of volumes"
value_threshold = 1
}
metric {
name = "mrc_status"
title = "Status MRC"
}
metric {
name = "mrc_uuid"
title = "MRC UUID"
}
}

View File

@ -0,0 +1,107 @@
modules {
module {
name = "xtfs-osd-plugin"
language = "python"
# The following params are examples only
param Host {
value = localhost
}
param Port {
value = 9003
}
param CommunityString {
value = public
}
}
}
collection_group {
collect_every = 60
time_threshold = 10
metric {
name = "osd_jvm_used_mem"
title = "used memory of the jvm"
value_threshold = 1
}
metric {
name = "osd_jvm_free_mem"
title = "free memory of the jvm"
value_threshold = 1
}
metric {
name = "osd_client_connections"
title = "number of Clients"
value_threshold = 1
}
metric {
name = "objects_received"
title = "objects received"
value_threshold = 1
}
metric {
name = "repl_objects_received"
title = "replicated objects received"
value_threshold = 1
}
metric {
name = "objects_transmitted"
title = "objects transmitted"
value_threshold = 1
}
metric {
name = "repl_bytes_received"
title = "replicated bytes received"
value_threshold = 1
}
metric {
name = "bytes_received"
title = "bytes received"
value_threshold = 1
}
metric {
name = "bytes_transmitted"
title = "bytes transmitted"
value_threshold = 1
}
metric {
name = "preproc_queue_length"
title = "preprocessing stage queue length"
value_threshold = 1
}
metric {
name = "storage_queue_length"
title = "storage stage queue length"
value_threshold = 1
}
metric {
name = "deletion_queue_length"
title = "deletion stage queue length"
value_threshold = 1
}
metric {
name = "open_files"
title = "open files"
value_threshold = 1
}
metric {
name = "deleted_files"
title = "deleted files"
value_threshold = 1
}
metric {
name = "free_space"
title = "free space"
value_threshold = 100
}
metric {
name = "osd_status"
title = "Status OSD"
}
metric {
name = "osd_uuid"
title = "OSD UUID"
}
}

View File

@ -0,0 +1,250 @@
'''
Created on May 25, 2011
@author: bzcseife
This is a python ganglia plugin which monitors the status of an DIR service of the XtreemFS
filesystem. It is intend to run on the same host as the DIR and gathers information of the DIR per
SNMP. Therefore you have to configure your DIR to provide a SNMP Agent on this host.
'''
#TODO: If ganglia supports 64bit values uses 64bit integers instead of converting all 64 bit integers
#reported from the SNMP Agent to 32bit integers.
import random
from pysnmp.entity.rfc3413.oneliner import cmdgen
from pysnmp.entity.rfc3413.oneliner.cmdgen import UdpTransportTarget
descriptors = list()
Random_Max = 50
Constant_Value = 50
#Get the used memory of the JVM
def JvmUsedMem(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 1, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1]/1024/1024)
else:
return 0
#Get the free memory of the JVM
def JvmFreeMem(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 2, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1] / 1024 / 1024)
else:
return 0
#Get the number of client connections
def ClientConnections(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 8, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of pending requests
def PendingRequests(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 9, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of address mappings registered
def AddressMappingCount(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 2, 1, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of services registered
def ServiceCount(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 2, 2, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#get the status of the DIR
#OID: 1.3.6.1.4.1.38350.1.11.0
def Status(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 11, 0))
if (errorStatus == False and errorIndication == None):
return str(varBinds[0][1])
else:
return "OFFLINE"
#get the UUID of the DIR
#OID: 1.3.6.1.4.1.38350.1.13.0
def Uuid(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 13, 0))
if (errorStatus == False and errorIndication == None):
return str(varBinds[0][1])
else:
return "Service not available"
def metric_init(params):
global descriptors
global Commmunity_String
global Snmp_Port
global authData
global transportTarget
if 'ComummunityString' in params:
Community_String = params['CommunityString']
else:
Community_String = 'public'
if 'Port' in params:
Snmp_Port = int(params['Port'])
if 'Host' in params:
Snmp_Host = params['Host']
authData = cmdgen.CommunityData('xtreemfs-agent', 'public')
transportTarget = cmdgen.UdpTransportTarget((Snmp_Host, Snmp_Port), 1, 0)
d0 = {'name': 'dir_jvm_used_mem',
'call_back': JvmUsedMem,
'time_max': 90,
'value_type': 'uint',
'units': 'Megabytes',
'slope': 'both',
'format': '%u',
'description': 'The amount of memory the JVM uses currently.',
'groups': 'dir'}
d1 = {'name': 'dir_jvm_free_mem',
'call_back': JvmFreeMem,
'time_max': 90,
'value_type': 'uint',
'units': 'Megabytes',
'slope': 'both',
'format': '%u',
'description': 'The amount of free memory the JVM can still use.',
'groups': 'dir'}
d2 = {'name': 'dir_client_connections',
'call_back': ClientConnections,
'time_max': 90,
'value_type': 'uint',
'units': 'clients',
'slope': 'both',
'format': '%u',
'description': 'The number of active client connection this DIR has currently to handle.',
'groups': 'dir'}
d3 = {'name': 'dir_pending_requests',
'call_back': PendingRequests,
'time_max': 90,
'value_type': 'uint',
'units': 'pending requests',
'slope': 'both',
'format': '%u',
'description': 'The number of pending requests this DIR has enqueued.',
'groups': 'dir'}
d4 = {'name': 'addr_mapping_count',
'call_back': AddressMappingCount,
'time_max': 90,
#value_type: string | uint | float | double
'value_type': 'uint',
#units: unit of your metric
'units': 'mappings',
#slope: zero | positive | negative | both
#This value maps to the data source types defined for RRDTool
#If 'positive', RRD file generated will be of COUNTER type (calculating the rate of change)
#If 'negative', ????
#'both' will be of GAUGE type (no calculations are performed, graphing only the value reported)
#If 'zero', the metric will appear in the "Time and String Metrics" or the "Constant Metrics" depending on the value_type of the m
'slope': 'both',
#format: format string of your metric
#Must correspond to value_type otherwise value of your metric will be unpredictable (reference: http://docs.python.org/library/stdtypes.html#string-formatting)
'format': '%u',
#description: description of your metric
'description': 'The number of address mapping registered at the DIR.',
#groups (optional): groups your metric belongs to
'groups': 'dir'}
d5 = {'name': 'service_count',
'call_back': ServiceCount,
'time_max': 90,
'value_type': 'uint',
'units': 'services',
'slope': 'both',
'format': '%u',
'description': 'The number of services registered at the DIR.',
'groups': 'dir'}
d6 = {'name': 'dir_status',
'call_back': Status,
'time_max': 90,
'value_type': 'string',
'units': '',
'slope': 'zero',
'format': '%s',
'description': 'ONLINE if this DIR is running correctly, OFFLINE otherwise',
'groups': 'dir'}
d7 = {'name': 'dir_uuid',
'call_back': Uuid,
'time_max': 90,
'value_type': 'string',
'units': '',
'slope': 'zero',
'format': '%s',
'description': 'UUID of the DIR running on this host',
'groups': 'dir'}
descriptors = [d0, d1, d2, d3, d4, d5, d6, d7]
return descriptors
def metric_cleanup():
'''Clean up the metric module.'''
pass
#for debugging purpose
if __name__ == '__main__':
params = {'CommunityString': 'public', 'Host': 'localhost', 'Port': 9001}
metric_init(params)
for d in descriptors:
v = d['call_back'](d['name'])
print 'value for %s is' % (d['name'])
print v

View File

@ -0,0 +1,221 @@
'''
Created on May 25, 2011
@author: bzcseife
This is a python ganglia plugin which monitors the status of an DIR service of the XtreemFS
filesystem. It is intend to run on the same host as the MRC and gathers information of the MRC per
SNMP. Therefore you have to configure your MRC to provide a SNMP Agent on this host.
'''
#TODO: If ganglia supports 64bit values uses 64bit integers instead of converting all 64 bit integers
#reported from the SNMP Agent to 32bit integers.
import random
from pysnmp.entity.rfc3413.oneliner import cmdgen
from pysnmp.entity.rfc3413.oneliner.cmdgen import UdpTransportTarget
descriptors = list()
Random_Max = 50
Constant_Value = 50
#Get the used memory of the JVM
def JvmUsedMem(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 1, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1] / 1024 / 1024)
else:
return 0
#Get the free memory of the JVM
def JvmFreeMem(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 2, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1] / 1024 / 1024)
else:
return 0
#Get the number of client connections
def ClientConnections(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 7, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of pending requests
def PendingRequests(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 8, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of volumes
def VolumeCount(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 3, 2, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#get the status of the MRC
def Status(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 11, 0))
if (errorStatus == False and errorIndication == None):
return str(varBinds[0][1])
else:
return "OFFLINE"
#get the UUID of the MRC
#OID: 1.3.6.1.4.1.38350.1.13.0
def Uuid(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 13, 0))
if (errorStatus == False and errorIndication == None):
return str(varBinds[0][1])
else:
return "Service not available"
def metric_init(params):
global descriptors
global Commmunity_String
global Snmp_Port
global authData
global transportTarget
if 'ComummunityString' in params:
Community_String = params['CommunityString']
else:
Community_String = 'public'
if 'Port' in params:
Snmp_Port = int(params['Port'])
if 'Host' in params:
Snmp_Host = params['Host']
authData = cmdgen.CommunityData('xtreemfs-agent', 'public')
transportTarget = cmdgen.UdpTransportTarget((Snmp_Host, Snmp_Port),1 ,0)
d0 = {'name': 'mrc_jvm_used_mem',
'call_back': JvmUsedMem,
'time_max': 90,
'value_type': 'uint',
'units': 'Megabytes',
'slope': 'both',
'format': '%u',
'description': 'The amount of memory the JVM uses currently.',
'groups': 'mrc'}
d1 = {'name': 'mrc_jvm_free_mem',
'call_back': JvmFreeMem,
'time_max': 90,
'value_type': 'uint',
'units': 'Megabytes',
'slope': 'both',
'format': '%u',
'description': 'The amount of free memory the JVM can still use.',
'groups': 'mrc'}
d2 = {'name': 'mrc_client_connections',
'call_back': ClientConnections,
'time_max': 90,
'value_type': 'uint',
'units': 'clients',
'slope': 'both',
'format': '%u',
'description': 'The number of active client connection this MRC has currently to handle.',
'groups': 'mrc'}
d3 = {'name': 'mrc_pending_requests',
'call_back': PendingRequests,
'time_max': 90,
'value_type': 'uint',
'units': 'pending requests',
'slope': 'both',
'format': '%u',
'description': 'The number of pending requests this MRC has enqueued.',
'groups': 'mrc'}
d4 = {'name': 'volumes_count',
'call_back': VolumeCount,
'time_max': 90,
'value_type': 'uint',
'units': 'volumes',
'slope': 'both',
'format': '%u',
'description': 'The number of volumes on this MRC.',
'groups': 'mrc'}
d5 = {'name': 'mrc_status',
'call_back': Status,
'time_max': 90,
'value_type': 'string',
'units': '',
'slope': 'zero',
'format': '%s',
'description': 'ONLINE if this OSD is running correctly, OFFLINE otherwise',
'groups': 'mrc'}
d6 = {'name': 'mrc_uuid',
'call_back': Uuid,
'time_max': 90,
'value_type': 'string',
'units': '',
'slope': 'zero',
'format': '%s',
'description': 'UUID of the MRC running on this host',
'groups': 'mrc'}
descriptors = [d0, d1, d2, d3, d4, d5, d6 ]
return descriptors
def metric_cleanup():
'''Clean up the metric module.'''
pass
#for debugging purpose
if __name__ == '__main__':
params = {'CommunityString': 'public', 'Host': 'localhost', 'Port': 9002}
metric_init(params)
for d in descriptors:
v = d['call_back'](d['name'])
print 'value for %s is ' % (d['name'])
print v

View File

@ -0,0 +1,477 @@
'''
Created on May 25, 2011
@author: bzcseife
This is a python ganglia plugin which monitors the status of an OSD service of the XtreemFS
filesystem. It is intend to run on the same host as the OSD and gathers information of the OSD per
SNMP. Therefore you have to configure your OSD to provide a SNMP Agent on this host.
'''
#TODO: If ganglia supports 64bit values uses 64bit integers instead of converting all 64 bit integers
#reported from the SNMP Agent to 32bit integers.
import random
from pysnmp.entity.rfc3413.oneliner import cmdgen
from pysnmp.entity.rfc3413.oneliner.cmdgen import UdpTransportTarget
descriptors = list()
Random_Max = 50
Constant_Value = 50
#Get the used memory of the JVM
def JvmUsedMem(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 1, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1] / 1024 / 1024)
else:
return 0
#Get the free memory of the JVM
def JvmFreeMem(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 2, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1] / 1024 / 1024)
else:
return 0
#Get the number of client connections
def ClientConnections(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 7, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of pending requests
def PendingRequests(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 8, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of objects received
def ObjectsReceived(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 1, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of replicated objects received
def ReplObjectsReceived(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 2, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of replicated objects transmitted
def ObjectsTransmitted(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 3, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of replicated bytes received
def ReplBytesReceived(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 4, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1] / 1024 / 1024)
else:
return 0
#Get the number of bytes received
def BytesReceived(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 5, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1] / 1024 / 1024)
else:
return 0
#Get the number of bytes transmitted
def BytesTransmitted(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 6, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1] / 1024 / 1024)
else:
return 0
#Get the length of the preprocessing stage queue
def PreprocQueueLength(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 7, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1] / 1024 / 1024)
else:
return 0
#Get the length of the storage stage queue
def StorageQueueLength(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 8, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the length of the deletion stage queue
def DeletionQueueLength(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 9, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of open files from the OSD per snmp
def OsdOpenFiles(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 10, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the number of deleted files from the OSD per snmp
def OsdDeletedFiles(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 11, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1])
else:
return 0
#Get the free space from the OSD per snmp
def OsdFreeSpace(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 4, 12, 0))
if (errorStatus == False and errorIndication == None):
return int(varBinds[0][1] / 1024 / 1024)
else:
return 0
#get the status of the OSD
def Status(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 11, 0))
if (errorStatus == False and errorIndication == None):
return str(varBinds[0][1])
else:
return "OFFLINE"
#get the UUID of the OSD
#OID: 1.3.6.1.4.1.38350.1.13.0
def Uuid(name):
errorIndication, errorStatus, errorIndex, varBinds = cmdgen.CommandGenerator().getCmd(authData,
transportTarget,
(1, 3, 6, 1, 4, 1, 38350, 1, 13, 0))
if (errorStatus == False and errorIndication == None):
return str(varBinds[0][1])
else:
return "Service not available"
def metric_init(params):
global descriptors
global Commmunity_String
global Snmp_Port
global authData
global transportTarget
if 'ComummunityString' in params:
Community_String = params['CommunityString']
else:
Community_String = 'public'
if 'Port' in params:
Snmp_Port = int(params['Port'])
if 'Host' in params:
Snmp_Host = params['Host']
authData = cmdgen.CommunityData('xtreemfs-agent', 'public')
transportTarget = cmdgen.UdpTransportTarget((Snmp_Host, Snmp_Port),1,0)
d0 = {'name': 'osd_jvm_used_mem',
'call_back': JvmUsedMem,
'time_max': 90,
'value_type': 'uint',
'units': 'Megabytes',
'slope': 'both',
'format': '%u',
'description': 'The amount of memory the JVM uses currently.',
'groups': 'osd'}
d1 = {'name': 'osd_jvm_free_mem',
'call_back': JvmFreeMem,
'time_max': 90,
'value_type': 'uint',
'units': 'Megabytes',
'slope': 'both',
'format': '%u',
'description': 'The amount of free memory the JVM can still use.',
'groups': 'osd'}
d2 = {'name': 'osd_client_connections',
'call_back': ClientConnections,
'time_max': 90,
'value_type': 'uint',
'units': 'clients',
'slope': 'both',
'format': '%u',
'description': 'The number of active client connection this OSD has currently to handle.',
'groups': 'osd'}
d3 = {'name': 'osd_pending_requests',
'call_back': PendingRequests,
'time_max': 90,
'value_type': 'uint',
'units': 'pending requests',
'slope': 'both',
'format': '%u',
'description': 'The number of pending requests this OSD has enqueued.',
'groups': 'osd'}
d4 = {'name': 'objects_received',
'call_back': ObjectsReceived,
'time_max': 90,
'value_type': 'uint',
'units': 'objects',
'slope': 'positive',
'format': '%u',
'description': 'The number of objects this OSD has received.',
'groups': 'osd'}
d5 = {'name': 'repl_objects_received',
'call_back': ReplObjectsReceived,
'time_max': 90,
'value_type': 'uint',
'units': 'objects',
'slope': 'positive',
'format': '%u',
'description': 'The number of replicated objects this OSD has received.',
'groups': 'osd'}
d6 = {'name': 'objects_transmitted',
'call_back': ObjectsTransmitted,
'time_max': 90,
'value_type': 'uint',
'units': 'objects',
'slope': 'positive',
'format': '%u',
'description': 'The number of objects this OSD has transmitted.',
'groups': 'osd'}
d7 = {'name': 'repl_bytes_received',
'call_back': ReplBytesReceived,
'time_max': 90,
'value_type': 'uint',
'units': 'Megabytes',
'slope': 'positive',
'format': '%u',
'description': 'The number of replicated bytes this OSD has received.',
'groups': 'osd'}
d8 = {'name': 'bytes_received',
'call_back': BytesReceived,
'time_max': 90,
'value_type': 'uint',
'units': 'Megabytes',
'slope': 'positive',
'format': '%u',
'description': 'The number of bytes this OSD has received.',
'groups': 'osd'}
d9 = {'name': 'bytes_transmitted',
'call_back': BytesTransmitted,
'time_max': 90,
'value_type': 'uint',
'units': 'Megabytes',
'slope': 'positive',
'format': '%u',
'description': 'The number of bytes this OSD has transmitted.',
'groups': 'osd'}
d10 = {'name': 'preproc_queue_length',
'call_back': PreprocQueueLength,
'time_max': 90,
'value_type': 'uint',
'units': 'requests',
'slope': 'both',
'format': '%u',
'description': 'The length of the preprocessing stage queue of this OSD.',
'groups': 'osd'}
d11 = {'name': 'storage_queue_length',
'call_back': StorageQueueLength,
'time_max': 90,
'value_type': 'uint',
'units': 'requests',
'slope': 'positive',
'format': '%u',
'description': 'The length of the storage stage queue of this OSD.',
'groups': 'osd'}
d12 = {'name': 'deletion_queue_length',
'call_back': DeletionQueueLength,
'time_max': 90,
'value_type': 'uint',
'units': 'requests',
'slope': 'both',
'format': '%u',
'description': 'The length of the deletion stage queue of this OSD.',
'groups': 'osd'}
d13 = {'name': 'storage_queue_length',
'call_back': StorageQueueLength,
'time_max': 90,
'value_type': 'uint',
'units': 'requests',
'slope': 'both',
'format': '%u',
'description': 'The length of the storage stage queue of this OSD.',
'groups': 'osd'}
d14 = {'name': 'open_files',
'call_back': OsdOpenFiles,
'time_max': 90,
'value_type': 'uint',
'units': 'files',
'slope': 'both',
'format': '%u',
'description': 'The number of file this OSD has currently opened.',
'groups': 'osd'}
d15 = {'name': 'deleted_files',
'call_back': OsdDeletedFiles,
'time_max': 90,
'value_type': 'uint',
'units': 'files',
'slope': 'positive',
'format': '%u',
'description': 'The number of deleted files on this OSD',
'groups': 'osd'}
d16 = {'name': 'free_space',
'call_back': OsdFreeSpace,
'time_max': 90,
#value_type: string | uint | float | double
'value_type': 'uint',
#units: unit of your metric
'units': 'Megabytes',
#slope: zero | positive | negative | both
#This value maps to the data source types defined for RRDTool
#If 'positive', RRD file generated will be of COUNTER type (calculating the rate of change)
#If 'negative', ????
#'both' will be of GAUGE type (no calculations are performed, graphing only the value reported)
#If 'zero', the metric will appear in the "Time and String Metrics" or the "Constant Metrics" depending on the value_type of the m
'slope': 'both',
#format: format string of your metric
#Must correspond to value_type otherwise value of your metric will be unpredictable (reference: http://docs.python.org/library/stdtypes.html#string-formatting)
'format': '%u',
#description: description of your metric
'description': 'The free disc space on the partition this OSD stores the object files.',
#groups (optional): groups your metric belongs to
'groups': 'osd'}
d17 = {'name': 'osd_status',
'call_back': Status,
'time_max': 90,
'value_type': 'string',
'units': '',
'slope': 'zero',
'format': '%s',
'description': 'ONLINE if this OSD is running correctly, OFFLINE otherwise',
'groups': 'osd'}
d18 = {'name': 'osd_uuid',
'call_back': Uuid,
'time_max': 90,
'value_type': 'string',
'units': '',
'slope': 'zero',
'format': '%s',
'description': 'UUID of the OSD running on this host',
'groups': 'osd'}
descriptors = [d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, d10, d11, d12, d13, d14, d15, d16, d17, d18]
return descriptors
def metric_cleanup():
'''Clean up the metric module.'''
pass
#for debugging purpose
if __name__ == '__main__':
params = {'CommunityString': 'public', 'Host': 'localhost', 'Port': 9003}
metric_init(params)
for d in descriptors:
v = d['call_back'](d['name'])
print 'value for %s is' % (d['name'])
print v

View File

@ -0,0 +1,37 @@
#!/bin/bash
OBJECT_DIR=$1
# get device for object_dir
IFS=' ' read -r DEVICE TMP <<< $(df $OBJECT_DIR | grep dev)
# Determine device type
if [[ $DEVICE == *md* ]]; then
# DEVICE is a RAID configuration
DEVICES=$(IFS=' ' read -a TMP <<< $(cat /proc/mdstat | grep $DEVICE))
DEVICES=${DEVICES[@]:4}
elif [[ $DEVICE == *sd* || $DEVICE == *hd* ]]; then
# DEVICE is a single disk
DEVICES=$DEVICE
else
# unsupported device type
echo "unsupported device type"
exit 3
fi
for DEVICE in $DEVICES; do
SMART_STATUS="$(sudo smartctl --health $DEVICE)"
echo $SMART_STATUS
if [[ $SMART_STATUS == *PASSED* ]]
then
continue;
elif [[ $SMART_STATUS == *FAILED* ]]
then
exit 1
else
exit 3
fi
done
# If no device's health test failed, return 0 (i.e. health test PASSED).
exit 0

View File

@ -0,0 +1,32 @@
Copyright (c) 2008-2011, Jan Stender, Bjoern Kolbeck, Mikael Hoegqvist,
Felix Hupfeld, Felix Langner, Zuse Institute Berlin
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above
copyright notice, this list of conditions and the
following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of the Zuse Institute Berlin nor the
names of its contributors may be used to endorse or promote
products derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

View File

@ -0,0 +1,3 @@
For further details on how to use the BabuDB replication plug-in, please refer to the BabuDB Wiki:
http://code.google.com/p/babudb/wiki/UsageReplicationForJava

View File

@ -0,0 +1,82 @@
#####################################################################
# BabuDB replication plugin configuration (DIR replication) #
#####################################################################
#####################################################################
# List of replicas and replication configuration
#####################################################################
# participants of the replication including this replica
babudb.repl.participant.0 = first-DIR-replica
babudb.repl.participant.0.port = 35678
babudb.repl.participant.1 = second-DIR-replica
babudb.repl.participant.1.port = 35678
babudb.repl.participant.2 = third-DIR-replica
babudb.repl.participant.2.port = 35678
# number of servers that at least have to be up to date
# To have a fault-tolerant system, this value has to be set to the
# majority of nodes i.e., if you have three replicas, set this to 2
# Please note that a setup with two nodes provides no fault-tolerance.
babudb.repl.sync.n = 2
#####################################################################
# Advanced Options (usually you do NOT have to edit these)
#####################################################################
# It's possible to set the local address and port of this server explicitly.
# If not, it will be chosen from the list of participants.
#babudb.repl.localhost = localhost
#babudb.repl.localport = 35678
# Choose here one of the predefined policies for handling database requests:
#
# MasterOnly - Redirect any kind of request to the master.
# Provides strong consistency.
# WriteRestriction - Same as MasterOnly plus lookup operations are also permitted on the slaves.
# Consequently, clients may read stale values from a backup replica.
# NoRestriction - Allows any kind of request to be performed at the local BabuDB instance.
# May result into conflicts which are not resolved.
#
# default setting is MasterOnly.
#babudb.repl.policy = MasterOnly
# DB backup directory - needed for the initial loading of the BabuDB from the
# master in replication context
babudb.repl.backupDir = /var/lib/xtreemfs/server-repl-dir
#####################################################################
# SSL options (disabled by default)
#####################################################################
# specify whether SSL is required
#babudb.ssl.enabled = false
# server credentials for SSL handshakes
#babudb.ssl.service_creds = /etc/xos/xtreemfs/truststore/certs/osd.p12
#babudb.ssl.service_creds.pw = xtreemfs
#babudb.ssl.service_creds.container = pkcs12
# trusted certificates for SSL handshakes
#babudb.ssl.trusted_certs = /etc/xos/xtreemfs/truststore/certs/xosrootca.jks
#babudb.ssl.trusted_certs.pw = xtreemfs
#babudb.ssl.trusted_certs.container = jks
#babudb.ssl.authenticationWithoutEncryption = false
#####################################################################
# Internal options (usually do not have to be touched)
#####################################################################
plugin.jar = /usr/share/java/BabuDB_replication_plugin.jar
# paths to libraries this plugin depends on
babudb.repl.dependency.0 = /usr/share/java/Flease.jar
# local time renew in milliseconds
#babudb.localTimeRenew = 0
# chunk size, for initial load of file chunks
#babudb.repl.chunkSize = 5242880
# decides whether redirects should be handled by the user-application or not
#babudb.repl.redirectIsVisible = false

View File

@ -0,0 +1,82 @@
#####################################################################
# BabuDB replication plugin configuration (MRC replication) #
#####################################################################
#####################################################################
# List of replicas and replication configuration
#####################################################################
# participants of the replication including this replica
babudb.repl.participant.0 = first-MRC-replica
babudb.repl.participant.0.port = 35676
babudb.repl.participant.1 = second-MRC-replica
babudb.repl.participant.1.port = 35676
babudb.repl.participant.2 = third-MRC-replica
babudb.repl.participant.2.port = 35676
# number of servers that at least have to be up to date
# To have a fault-tolerant system, this value has to be set to the
# majority of nodes i.e., if you have three replicas, set this to 2
# Please note that a setup with two nodes provides no fault-tolerance.
babudb.repl.sync.n = 2
#####################################################################
# Advanced Options (usually you do NOT have to edit these)
#####################################################################
# It's possible to set the local address and port of this server explicitly.
# If not, it will be chosen from the list of participants.
#babudb.repl.localhost = localhost
#babudb.repl.localport = 35676
# Choose here one of the predefined policies for handling database requests:
#
# MasterOnly - Redirect any kind of request to the master.
# Provides strong consistency.
# WriteRestriction - Same as MasterOnly plus lookup operations are also permitted on the slaves.
# Consequently, clients may read stale values from a backup replica.
# NoRestriction - Allows any kind of request to be performed at the local BabuDB instance.
# May result into conflicts which are not resolved.
#
# default setting is MasterOnly.
#babudb.repl.policy = MasterOnly
# DB backup directory - needed for the initial loading of the BabuDB from the
# master in replication context
babudb.repl.backupDir = /var/lib/xtreemfs/server-repl-mrc
#####################################################################
# SSL options (disabled by default)
#####################################################################
# specify whether SSL is required
#babudb.ssl.enabled = false
# server credentials for SSL handshakes
#babudb.ssl.service_creds = /etc/xos/xtreemfs/truststore/certs/osd.p12
#babudb.ssl.service_creds.pw = xtreemfs
#babudb.ssl.service_creds.container = pkcs12
# trusted certificates for SSL handshakes
#babudb.ssl.trusted_certs = /etc/xos/xtreemfs/truststore/certs/xosrootca.jks
#babudb.ssl.trusted_certs.pw = xtreemfs
#babudb.ssl.trusted_certs.container = jks
#babudb.ssl.authenticationWithoutEncryption = false
#####################################################################
# Internal options (usually do not have to be touched)
#####################################################################
plugin.jar = /usr/share/java/BabuDB_replication_plugin.jar
# paths to libraries this plugin depends on
babudb.repl.dependency.0 = /usr/share/java/Flease.jar
# local time renew in milliseconds
#babudb.localTimeRenew = 0
# chunk size, for initial load of file chunks
#babudb.repl.chunkSize = 5242880
# decides whether redirects should be handled by the user-application or not
#babudb.repl.redirectIsVisible = false

View File

@ -0,0 +1,60 @@
#!/bin/bash
# Copyright (c) 2012 Michael Berlin, Zuse Institute Berlin
# Licensed under the BSD License, see LICENSE file for details.
set -e
trap onexit 1 2 3 15 ERR
function onexit() {
local exit_status=${1:-$?}
echo ERROR: Exiting $0 with $exit_status
exit $exit_status
}
replication_dir_in_babudb_trunk="java/replication"
cat <<EOF
This script updates the binary .jar file which contains the BabuDB replication plugin.
EOF
if [ -z "$BABUDB" ]
then
known_babudb_dirs="../../../../googlecode-svn-babudb/trunk"
for dir in $known_babudb_dirs
do
if [ -d "$dir" ]
then
BABUDB="$dir"
fi
done
fi
if [ -z "$BABUDB" ]
then
echo "The environment variable BABUDB was not set. Please point it to a checkout directory of the SVN trunk of the BabuDB project (svn checkout http://babudb.googlecode.com/svn/trunk/ babudb)."
exit 1
fi
if [ ! -d "$BABUDB" ]
then
echo "The environment variable BABUDB does not point to an existing directory. BABUDB = ${BABUDB}"
exit 1
fi
echo "Updating the .jar files required by the BabuDB replication code first..."
${BABUDB}/${replication_dir_in_babudb_trunk}/update_jar_dependencies.sh
echo "Finished updating the .jar files required by the BabuDB replication code."
echo "compiling BabuDB replication plugion (BabuDB_replication_plugin.jar)"
babudb_replication_buildfile="${BABUDB}/${replication_dir_in_babudb_trunk}/build.xml"
babudb_replication_jar_source="${BABUDB}/${replication_dir_in_babudb_trunk}/../dist/replication/BabuDB_replication_plugin.jar"
babudb_replication_jar_dest=$(dirname "$0")
# ant clean -f "$babudb_replication_buildfile" >/dev/null
ant jar -f "$babudb_replication_buildfile" >/dev/null
cp -a "$babudb_replication_jar_source" "$babudb_replication_jar_dest"
echo "finished compiling BabuDB replication plugion (BabuDB_replication_plugin.jar)"

34
contrib/travis/parse_results.py Executable file
View File

@ -0,0 +1,34 @@
#!/usr/bin/env python
# Copyright (c) 2014 by Johannes Dillmann, Zuse Institute Berlin
# Licensed under the BSD License, see LICENSE file for details.
import sys
import argparse
import json
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("file", type=argparse.FileType('r'))
parser.add_argument("test")
args = parser.parse_args()
results = json.load(args.file)
result = None
if args.test in results:
result = results[args.test]
if type(result) == bool and result:
print "true"
sys.exit(0)
if type(result) == dict and all(result.values()):
print "true"
sys.exit(0)
print "false"
sys.exit(1)

View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
echo "Installing XtreemFS build dependencies"
apt-get -y update
apt-get -y install openjdk-7-jdk ant build-essential libssl-dev libfuse-dev libattr1-dev cmake libboost-regex-dev libboost-program-options-dev libboost-thread-dev libboost-system-dev valgrind
echo "export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64" >> /etc/bash.bashrc
echo "export BUILD_CLIENT_TESTS=true" >> /etc/bash.bashrc

View File

@ -0,0 +1,223 @@
#!/bin/bash
### BEGIN INIT INFO
# Provides: xtreemfs-osd-farm
# Required-Start: $network $remote_fs
# Required-Stop: $network $remote_fs
# Should-Start: xtreemfs-dir
# Should-Stop: $null
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: XtreemFS OSD init.d script which can start multiple OSDs on the same machine in contrast to xtreemfs-osd
# Description: XtreemFS Object Storage Device (OSD). http://www.xtreemfs.org/
### END INIT INFO
# Source function library.
if [ -e /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
else
. /etc/init.d/functions
fi
XTREEMFS_USER=xtreemfs
# List of OSD instances which shall be started, seperated by spaces.
# For every OSD there has to be a configuration file.
OSD_INSTANCES="osd1 osd2 osd3"
# OSD specific options. Use %OSDNAME% which will be substituted.
PID_OSD_GENERIC=/var/run/xtreemfs_%OSDNAME%.pid
CONFIG_OSD_GENERIC=/etc/xos/xtreemfs/%OSDNAME%.config.properties
LOG_OSD_GENERIC=/var/log/xtreemfs/%OSDNAME%.log
if [ -z $JAVA_HOME ]; then
export JAVA_HOME=/usr
fi
JAVA_CALL="$JAVA_HOME/bin/java -ea -cp /usr/share/java/XtreemFS.jar:/usr/share/java/BabuDB.jar:/usr/share/java/Flease.jar:/usr/share/java/protobuf-java-2.5.0.jar:/usr/share/java/Foundation.jar:/usr/share/java/jdmkrt.jar:/usr/share/java/jdmktk.jar:/usr/share/java/commons-codec-1.3.jar"
# For SELinux we need to use 'runuser' not 'su'
if [ -x "/sbin/runuser" ]; then
SU="/sbin/runuser"
else
SU="/bin/su"
fi
pre_check() {
LOG_OSD="$1"
CONFIG_OSD="$2"
exists=`grep -c $XTREEMFS_USER /etc/passwd`
if [ $exists -eq 0 ]; then
echo "User $XTREEMFS_USER does not exist. Create it first."
exit 1
fi
log_directory=`dirname $LOG_OSD`
if [ ! -e $log_directory ]; then
echo "Directory for logfiles $log_directory does not exist. Create it first."
exit 1
fi
if [ ! -f "$CONFIG_OSD" ]; then
echo -e "Config file not found: $CONFIG_OSD"
echo
exit 1
fi
}
get_osd_list() {
OSD_LIST=""
if [ -n "$1" ]; then
# Check if given OSD name in list of allowed OSDs.
for osd in $OSD_INSTANCES; do
[ "$osd" = "$1" ] && OSD_LIST="$1" && return 0
done
echo "OSD \"$1\" is not part of the list OSD_INSTANCES."
exit 1
else
OSD_LIST=$OSD_INSTANCES
return 0
fi
}
substitute_osdname() {
echo "$1" | sed -e "s/%OSDNAME%/$2/g"
}
pre_check_vars() {
for var in $LOG_OSD_GENERIC $PID_OSD_GENERIC $CONFIG_OSD_GENERIC; do
echo "$var" | grep %OSDNAME% >/dev/null || {
echo "%OSDNAME% parameter not found in variable: $var"
exit 1
}
done
}
start() {
get_osd_list "$1"
pre_check_vars
for osdname in $OSD_LIST; do
LOG_OSD=$(substitute_osdname "$LOG_OSD_GENERIC" "$osdname")
PID_OSD=$(substitute_osdname "$PID_OSD_GENERIC" "$osdname")
CONFIG_OSD=$(substitute_osdname "$CONFIG_OSD_GENERIC" "$osdname")
pre_check "$LOG_OSD" "$CONFIG_OSD"
echo >> $LOG_OSD
date >> $LOG_OSD
echo -e "Starting XtreemFS Object Storage Device (OSD): $osdname ... \n\n" >> $LOG_OSD
echo -n "Starting XtreemFS Object Storage Device (OSD): $osdname ... "
$SU -s /bin/bash $XTREEMFS_USER -c "$JAVA_CALL org.xtreemfs.osd.OSD $CONFIG_OSD" >> $LOG_OSD 2>&1 &
PROCPID=$!
echo $PROCPID > $PID_OSD
sleep 1s
if [ -e /proc/$PROCPID ]; then
echo "success"
else
echo "failed"
return 1
fi
done
return 0
}
stop() {
get_osd_list "$1"
pre_check_vars
for osdname in $OSD_LIST; do
LOG_OSD=$(substitute_osdname "$LOG_OSD_GENERIC" "$osdname")
PID_OSD=$(substitute_osdname "$PID_OSD_GENERIC" "$osdname")
CONFIG_OSD=$(substitute_osdname "$CONFIG_OSD_GENERIC" "$osdname")
result=0
if [ -f $PID_OSD ]; then
echo -n "Stopping XtreemFS Object Storage Device (OSD): $osdname ... "
killproc -p $PID_OSD $SU
result=$?
if [ $result -eq 0 ]; then
rm -f $PID_OSD
echo "success"
else
echo "failed"
fi
else
echo "XtreemFS Object Storage Device (OSD) is not running"
fi
done
return $result
}
status() {
get_osd_list "$1"
pre_check_vars
rc=0
for osdname in $OSD_LIST; do
LOG_OSD=$(substitute_osdname "$LOG_OSD_GENERIC" "$osdname")
PID_OSD=$(substitute_osdname "$PID_OSD_GENERIC" "$osdname")
CONFIG_OSD=$(substitute_osdname "$CONFIG_OSD_GENERIC" "$osdname")
if [ -f $PID_OSD ]; then
PROCPID=`cat $PID_OSD`
if [ ! -e /proc/$PROCPID ]; then
echo "XtreemFS Object Storage Device (OSD): $osdname has crashed"
rc=1
else
echo "XtreemFS Object Storage Device (OSD): $osdname is running"
fi
else
echo "XtreemFS Object Storage Device (OSD): $osdname is not running"
rc=3
fi
done
return $rc
}
# See how we were called.
case "$1" in
start)
start "$2"
result=$?
;;
stop)
stop "$2"
result=$?
;;
status)
status "$2"
result=$?
;;
reload)
result=0
;;
restart)
stop "$2" && sleep 1 && start "$2"
result=$?
;;
try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
$0 status "$2" >/dev/null
if [ $? -eq 0 ]; then
$0 restart "$2"
result=$?
else
result=0
fi
;;
*)
echo -e "Usage: $0 {start|stop|restart|reload|status|try-restart}\n"
result=1
;;
esac
exit $result

397
cpp/CMakeLists.txt Normal file
View File

@ -0,0 +1,397 @@
cmake_minimum_required(VERSION 2.6)
PROJECT(cpp CXX C)
#SET (CMAKE_VERBOSE_MAKEFILE true)
# used for everything, but the preload library (which struggles with implicitly
# generated symbols suffixed with 64, e.g. open64)
set(COMPILE_DEFS "_FILE_OFFSET_BITS=64")
# Uncomment this to enable boost::asio debug output.
#add_definitions(-DBOOST_ASIO_ENABLE_HANDLER_TRACKING)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Set variables and required libraries.
##########################################
if (CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "-Wall -Wno-unused-function -Wno-sign-compare -pthread")
endif(CMAKE_COMPILER_IS_GNUCXX)
if (MSVC)
# Windows uses Unicode internally, so we also use Unicode instead of the default multi-byte character set.
add_definitions(-DUNICODE -D_UNICODE)
# Require at least Windows XP.
add_definitions(-D_WIN32_WINNT=0x0501)
# autolink for boost::asio does wrongfully require date_time and regex libraries.
# See: http://www.boost.org/doc/libs/1_46_1/doc/html/boost_asio/using.html
add_definitions(-DBOOST_DATE_TIME_NO_LIB -DBOOST_REGEX_NO_LIB)
ADD_DEFINITIONS(/D _CRT_SECURE_NO_WARNINGS)
endif(MSVC)
if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
set (SOLARIS true)
endif(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
if (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set (FREEBSD true)
endif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
# Set paths for required thirdparty libraries.
set(CLIENT_GOOGLE_PROTOBUF_CPP "${CMAKE_SOURCE_DIR}/thirdparty/protobuf-2.5.0")
if (WIN32)
set(CLIENT_GOOGLE_PROTOBUF_CPP_LIBRARY "${CLIENT_GOOGLE_PROTOBUF_CPP}/vsprojects/Release/libprotobuf.lib")
else()
FIND_FILE(CLIENT_GOOGLE_PROTOBUF_CPP_LIBRARY
"libprotobuf.a"
PATHS "${CLIENT_GOOGLE_PROTOBUF_CPP}/src/.libs/")
FIND_FILE(CLIENT_GOOGLE_PROTOBUF_CPP_DYNAMIC_LIBRARY
"libprotobuf.so"
PATHS "${CLIENT_GOOGLE_PROTOBUF_CPP}/src/.libs/")
endif(WIN32)
set(CLIENT_GOOGLE_TEST_CPP "${CMAKE_SOURCE_DIR}/thirdparty/gtest-1.7.0")
if (WIN32)
set(CLIENT_GOOGLE_TEST_CPP_LIBRARY "${CLIENT_GOOGLE_TEST_CPP}/msvc/gtest-md/Debug/gtestd.lib")
else()
set(CLIENT_GOOGLE_TEST_CPP_LIBRARY "${CLIENT_GOOGLE_TEST_CPP}/lib/.libs/libgtest.a")
endif(WIN32)
if (WIN32)
set(CLIENT_GOOGLE_TEST_CPP_MAIN "${CLIENT_GOOGLE_TEST_CPP}/msvc/gtest-md/Debug/gtest_main-mdd.lib")
else()
set(CLIENT_GOOGLE_TEST_CPP_MAIN "${CLIENT_GOOGLE_TEST_CPP}/lib/.libs/libgtest_main.a")
endif(WIN32)
# Windows requires for a Debug build also debug libraries from protobuf & co.
STRING(REPLACE "Release" "Debug" CLIENT_GOOGLE_PROTOBUF_CPP_LIBRARY_DEBUG ${CLIENT_GOOGLE_PROTOBUF_CPP_LIBRARY})
STRING(REPLACE "Release" "Debug" TEMP ${CLIENT_GOOGLE_TEST_CPP_LIBRARY})
STRING(REPLACE ".lib" "d.lib" CLIENT_GOOGLE_TEST_CPP_LIBRARY_DEBUG ${TEMP})
STRING(REPLACE "Release" "Debug" TEMP ${CLIENT_GOOGLE_TEST_CPP_MAIN})
STRING(REPLACE ".lib" "d.lib" CLIENT_GOOGLE_TEST_CPP_MAIN_DEBUG ${TEMP})
# Set required libraries.
if (NOT WIN32)
set(LIBFUSE "fuse")
SET(LIBATTR "attr")
SET(LIBPTHREAD "pthread")
endif(NOT WIN32)
if (SOLARIS)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthreads")
SET(LIBSOCKET_SOLARIS "socket")
SET(LIBNSL_SOLARIS "nsl")
# No libattr on Solaris.
SET(LIBATTR "")
endif(SOLARIS)
IF (APPLE OR FREEBSD)
SET(LIBATTR "")
ENDIF(APPLE OR FREEBSD)
IF (WIN32 OR APPLE OR SOLARIS)
# Run cmake with -DBOOST_ROOT=<root path of local boost installation> on Windows, Solaris and MacOSX.
# We link against the boost libraries found in BOOST_ROOT.
SET(Boost_USE_STATIC_LIBS true)
ENDIF(WIN32 OR APPLE OR SOLARIS)
IF (APPLE)
# Update 8/12/2011: Setting macosx-version-min does break mount.xtreemfs for unknown reasons - so disabled for now.
# Tell gcc to compile 10.4 compatible files (does not work otherwise on older Macs).
#SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.4")
SET(OSXFUSE_FUSE_H_INCLUDE_DIR "/usr/local/include/osxfuse/")
if (EXISTS ${OSXFUSE_FUSE_H_INCLUDE_DIR})
include_directories(${OSXFUSE_FUSE_H_INCLUDE_DIR})
endif(EXISTS ${OSXFUSE_FUSE_H_INCLUDE_DIR})
ENDIF(APPLE)
IF(WIN32)
SET(Boost_USE_STATIC_LIBS true)
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
SET(CBFS_LICENSE "include/cbfs/cbfs_license.h")
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${CBFS_LICENSE}")
## Find CbFS
# CBFS_ROOT - Input variable: Set to
# CBFS_FOUND - Output variable: CBFS was found.
# CBFS_INCLUDE_DIR - Output variable: Directory which contains the CbFS.h file.
# CBFS_LIBRARIES - Output variable: Will be set to CbFS.lib location.
find_path(CBFS_INCLUDE_DIR CbFS.h PATHS "$ENV{ProgramFiles}/EldoS/Callback File System/CPP/VC2010/32bit/dynamic_runtime(MD)" ${CBFS_ROOT})
find_library(CBFS_LIBRARY CbFS "$ENV{ProgramFiles}/EldoS/Callback File System/CPP/VC2010/32bit/dynamic_runtime(MD)" ${CBFS_ROOT})
include(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(CBFS DEFAULT_MSG CBFS_LIBRARY CBFS_INCLUDE_DIR)
if (CBFS_FOUND)
set(CBFS_LIBRARIES ${CBFS_LIBRARY})
include_directories(${CBFS_INCLUDE_DIR})
else(CBFS_FOUND)
message(FATAL_ERROR "The required library 'CbFS' was not found.")
endif (CBFS_FOUND)
mark_as_advanced(CBFS_LIBRARY)
ELSE()
message(STATUS "File ${CBFS_LICENSE} was not found. Compilation of the CbFSAdapter, which allows to mount XtreemFS volumes as network drive, will be skipped.\n\nPlease note: it is not possible to build the CbFSAdapter on your own unless you have a license for the CbFS library. The XtreemFS open-source project was granted a non-commercial license and therefore we can compile the CbFSAdapter and distribute binaries of it.\n")
ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${CBFS_LICENSE}")
ENDIF(WIN32)
# Set required thirdparty libraries.
# Boost
#set(Boost_DEBUG ON)
set(REQUIRED_BOOST_LIBRARIES "system" "thread" "program_options" "regex")
if (BOOST_ROOT)
message(STATUS "Info: BOOST_ROOT is set to: ${BOOST_ROOT}")
endif(BOOST_ROOT)
# Finding the boost libraries may fail. If existing, we point FIND_PACKAGE to /usr/lib64.
if(NOT BOOST_ROOT AND EXISTS "/usr/lib64/libboost_system.so")
set(BOOST_LIBRARYDIR "/usr/lib64")
endif(NOT BOOST_ROOT AND EXISTS "/usr/lib64/libboost_system.so")
# Initial find boost only to retrieve the version number.
FIND_PACKAGE(Boost)
# Unset the Boost_FOUND variable because the result of the second find will be checked.
set(Boost_FOUND)
if(WIN32 AND Boost_VERSION VERSION_GREATER "104900")
set(REQUIRED_BOOST_LIBRARIES ${REQUIRED_BOOST_LIBRARIES} "chrono")
endif(WIN32 AND Boost_VERSION VERSION_GREATER "104900")
# Actual find boost including all required libraries.
FIND_PACKAGE(Boost COMPONENTS ${REQUIRED_BOOST_LIBRARIES} REQUIRED)
if (NOT Boost_FOUND)
message(FATAL_ERROR "The boost library was not found on your system. If needed, you can also download and compile it on your own. After compiling boost locally, set the the environment variable BOOST_ROOT to the boost base directory before executing 'make' e.g., 'export BOOST_ROOT=/Users/xyz/boost_1_47_0'.")
endif(NOT Boost_FOUND)
include_directories(${Boost_INCLUDE_DIRS})
find_package(OpenSSL)
if (NOT OPENSSL_FOUND)
# OpenSSL find_package script cannot cope with /usr/lib64 directory under Cmake 2.8.3.
set(LIBCRYPTO "crypto")
set(LIBSSL "ssl")
set(OPENSSL_LIBRARIES ${LIBCRYPTO} ${LIBSSL})
endif(NOT OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIR})
# Comment this definition if the XtreemFS source should not depend on OpenSSL.
add_definitions(-DHAS_OPENSSL)
find_package(Valgrind)
if (VALGRIND_FOUND)
include_directories(${VALGRIND_INCLUDE_DIR})
add_definitions(-DHAS_VALGRIND)
else (VALGRIND_FOUND)
message(WARNING "Valgrind headers not found, running memcheck might report false positives.")
endif (VALGRIND_FOUND)
SET(REQUIRED_STATIC_LIBRARIES ${CLIENT_GOOGLE_PROTOBUF_CPP_LIBRARY})
if(BUILD_CLIENT_TESTS)
SET(REQUIRED_STATIC_LIBRARIES ${REQUIRED_STATIC_LIBRARIES} ${CLIENT_GOOGLE_TEST_CPP_LIBRARY} ${CLIENT_GOOGLE_TEST_CPP_MAIN})
endif(BUILD_CLIENT_TESTS)
foreach (STATIC_LIB_FULL_PATH ${REQUIRED_STATIC_LIBRARIES})
if(NOT EXISTS ${STATIC_LIB_FULL_PATH})
message(FATAL_ERROR "The file ${STATIC_LIB_FULL_PATH} was not found. Please run 'make client' or 'make' from the base directory in order to build the required static libraries.")
endif()
endforeach(STATIC_LIB_FULL_PATH)
CMAKE_POLICY(SET CMP0003 OLD)
ADD_LIBRARY(protobuf STATIC IMPORTED)
ADD_LIBRARY(protobuf_debug STATIC IMPORTED)
SET_PROPERTY(TARGET protobuf PROPERTY IMPORTED_LOCATION ${CLIENT_GOOGLE_PROTOBUF_CPP_LIBRARY})
SET_PROPERTY(TARGET protobuf_debug PROPERTY IMPORTED_LOCATION ${CLIENT_GOOGLE_PROTOBUF_CPP_LIBRARY_DEBUG})
include_directories(${CLIENT_GOOGLE_PROTOBUF_CPP}/src)
ADD_LIBRARY(gtest STATIC IMPORTED)
ADD_LIBRARY(gtest_debug STATIC IMPORTED)
ADD_LIBRARY(gtest_main STATIC IMPORTED)
ADD_LIBRARY(gtest_main_debug STATIC IMPORTED)
SET_PROPERTY(TARGET gtest PROPERTY IMPORTED_LOCATION ${CLIENT_GOOGLE_TEST_CPP_LIBRARY})
SET_PROPERTY(TARGET gtest_debug PROPERTY IMPORTED_LOCATION ${CLIENT_GOOGLE_TEST_CPP_LIBRARY_DEBUG})
SET_PROPERTY(TARGET gtest_main PROPERTY IMPORTED_LOCATION ${CLIENT_GOOGLE_TEST_CPP_MAIN})
SET_PROPERTY(TARGET gtest_main_debug PROPERTY IMPORTED_LOCATION ${CLIENT_GOOGLE_TEST_CPP_MAIN_DEBUG})
include_directories(${CLIENT_GOOGLE_TEST_CPP}/include)
# Check if this is a 64 Bit system
if(UNIX AND NOT WIN32)
if(APPLE)
set(LIBFUSE "osxfuse")
endif(APPLE)
endif(UNIX AND NOT WIN32)
SET(REQUIRED_LIBRARIES ${LIBATTR} ${LIBCRYPTO} ${LIBSSL} ${LIBPTHREAD})
if (SKIP_FUSE)
MESSAGE(STATUS "INFO: Skipping the XtreemFS Fuse Adapter (mount.xtreemfs) because SKIP_FUSE was defined.")
else()
SET(REQUIRED_LIBRARIES ${REQUIRED_LIBRARIES} ${LIBFUSE})
endif(SKIP_FUSE)
foreach(LIB ${REQUIRED_LIBRARIES})
#message(STATUS "checking for library: ${LIB}")
# For unknown reasons, setting "FIND_LIBRARY_USE_LIB64_PATHS" does not fix the issue that libraries in /usr/lib64/ are not found under openSuse.
# Therefore we just specify a list of possible library directories.
find_library(FOUND${LIB} ${LIB} PATHS "/lib64" "/usr/lib64")
if (NOT FOUND${LIB})
if (${LIB} STREQUAL ${LIBFUSE})
message(STATUS "INFO: If you want to skip the compilation of the FuseAdapter e.g., because your system does not provide Fuse (library: ${LIBFUSE}), please define SKIP_FUSE e.g., run: SKIP_FUSE=true make client")
endif (${LIB} STREQUAL ${LIBFUSE})
message(FATAL_ERROR "The required library '${LIB}' was not found. Please install it on your system first.")
#else()
# message(STATUS "Result of find_library: ${FOUND${LIB}}")
endif(NOT FOUND${LIB})
endforeach(LIB)
# Define building of binaries.
##########################################
MESSAGE(STATUS "Configuring XtreemFS Client Library (libxtreemfs) and Volume Tools ({mkfs,rmfs,lsfs}.xtreemfs).")
INCLUDE_DIRECTORIES(include generated)
file(GLOB_RECURSE SRCS_RPC src/rpc/*.cpp include/rpc/*.h)
file(GLOB_RECURSE SRCS_UTIL src/util/*.cpp include/util/*.h)
file(GLOB_RECURSE SRCS_GENERATED generated/*.cc generated/*.h)
file(GLOB_RECURSE SRCS_XTREEMFS src/libxtreemfs/*.cpp include/libxtreemfs/*.h)
add_library(xtreemfs ${SRCS_RPC} ${SRCS_UTIL} ${SRCS_GENERATED} ${SRCS_XTREEMFS})
# WARNING: The resulting static libxtreemfs does NOT contain the required static library protobuf.
# If you want to use a static libxtreemfs, you have to use a CMake file like this which does automatically add the static libxtreemfs and libprotobuf to the executable.
# An alternative would be to change this file in such a way that the static libxtreemfs and libprotobuf are merged together into a static libxtreemfs.
# But this would require additional CMake macros as presented here: http://www.mail-archive.com/cmake@cmake.org/msg28670.html
TARGET_LINK_LIBRARIES(xtreemfs optimized protobuf debug protobuf_debug ${Boost_LIBRARIES} ${LIBPTHREAD} ${OPENSSL_LIBRARIES} ${LIBSOCKET_SOLARIS} ${LIBNSL_SOLARIS})
ADD_EXECUTABLE(example_libxtreemfs src/example_libxtreemfs/example_libxtreemfs.cpp)
SET_TARGET_PROPERTIES(example_libxtreemfs PROPERTIES COMPILE_DEFINITIONS ${COMPILE_DEFS})
TARGET_LINK_LIBRARIES(example_libxtreemfs xtreemfs)
ADD_EXECUTABLE(example_replication src/example_libxtreemfs/example_replication.cpp)
SET_TARGET_PROPERTIES(example_replication PROPERTIES COMPILE_DEFINITIONS ${COMPILE_DEFS})
TARGET_LINK_LIBRARIES(example_replication xtreemfs)
file(GLOB_RECURSE SRCS_MKFS src/mkfs.xtreemfs/*.cpp)
ADD_EXECUTABLE(mkfs.xtreemfs ${SRCS_MKFS})
SET_TARGET_PROPERTIES(mkfs.xtreemfs PROPERTIES COMPILE_DEFINITIONS ${COMPILE_DEFS})
TARGET_LINK_LIBRARIES(mkfs.xtreemfs xtreemfs)
file(GLOB_RECURSE SRCS_RMFS src/rmfs.xtreemfs/*.cpp)
ADD_EXECUTABLE(rmfs.xtreemfs ${SRCS_RMFS})
SET_TARGET_PROPERTIES(rmfs.xtreemfs PROPERTIES COMPILE_DEFINITIONS ${COMPILE_DEFS})
TARGET_LINK_LIBRARIES(rmfs.xtreemfs xtreemfs)
file(GLOB_RECURSE SRCS_LSFS src/lsfs.xtreemfs/*.cpp)
ADD_EXECUTABLE(lsfs.xtreemfs ${SRCS_LSFS})
SET_TARGET_PROPERTIES(lsfs.xtreemfs PROPERTIES COMPILE_DEFINITIONS ${COMPILE_DEFS})
TARGET_LINK_LIBRARIES(lsfs.xtreemfs xtreemfs)
file(GLOB_RECURSE SRCS_XTFS_UTIL src/xtfsutil/xtfsutil_server.cpp)
file(GLOB_RECURSE SRCS_JSONCPP src/json/*.cpp)
if (NOT WIN32)
if (FOUND${LIBFUSE})
MESSAGE(STATUS "Configuring XtreemFS Fuse Adapter (mount.xtreemfs).")
file(GLOB_RECURSE SRCS_FUSE_ADAPTER src/fuse/fuse*.cpp)
file(GLOB_RECURSE SRCS_FUSE_ADAPTER_MAIN src/fuse/mount.xtreemfs.cpp)
ADD_EXECUTABLE(mount.xtreemfs ${SRCS_FUSE_ADAPTER} ${SRCS_FUSE_ADAPTER_MAIN} ${SRCS_XTFS_UTIL} ${SRCS_JSONCPP})
SET_TARGET_PROPERTIES(mount.xtreemfs PROPERTIES COMPILE_DEFINITIONS ${COMPILE_DEFS})
TARGET_LINK_LIBRARIES(mount.xtreemfs xtreemfs ${LIBFUSE})
set(UNITTESTS_REQUIRED_SOURCES_fuse ${SRCS_FUSE_ADAPTER} ${SRCS_XTFS_UTIL} ${SRCS_JSONCPP})
set(UNITTESTS_REQUIRED_LIBRARIES_fuse ${LIBFUSE})
endif(FOUND${LIBFUSE})
ADD_EXECUTABLE(xtfsutil src/xtfsutil/xtfsutil.cpp ${SRCS_JSONCPP})
TARGET_LINK_LIBRARIES(xtfsutil ${Boost_LIBRARIES} ${LIBATTR})
set(UNITTESTS_SKIP_cbfs true)
endif(NOT WIN32)
if(WIN32 AND CBFS_FOUND)
MESSAGE(STATUS "Configuring XtreemFS CbFS Adapter (mount.xtreemfs.exe).")
file(GLOB_RECURSE SRCS_CBFS_ADAPTER src/cbfs/*.cpp)
ADD_EXECUTABLE(mount.xtreemfs ${SRCS_CBFS_ADAPTER} ${SRCS_XTFS_UTIL} ${SRCS_JSONCPP})
TARGET_LINK_LIBRARIES(mount.xtreemfs xtreemfs ${CBFS_LIBRARIES})
set(UNITTESTS_SKIP_fuse true)
endif(WIN32 AND CBFS_FOUND)
function(find_source_files RESULT)
set(RESULT "")
foreach(GLOBEXPR ${ARGV})
file(GLOB_RECURSE FILES ${GLOBEXPR})
foreach(TEST ${FILES})
get_filename_component(DIRNAME ${TEST} PATH)
get_filename_component(COMPONENT ${DIRNAME} NAME)
get_filename_component(FILENAME ${TEST} NAME)
if (${FILENAME} MATCHES "_test.cpp$")
#skip
elseif (${FILENAME} MATCHES "_main.cpp$")
#skip
else()
LIST(APPEND RESULT ${TEST})
endif()
endforeach(TEST)
endforeach(GLOBEXPR)
set(FIND_RESULT ${RESULT} PARENT_SCOPE)
endfunction(find_source_files)
#SET(BUILD_PRELOAD TRUE)
if (BUILD_PRELOAD)
find_source_files("src/ld_preload/*.cpp" "include/ld_preload/*.h")
set(SRCS_PRELOAD ${FIND_RESULT})
# The LD_PRELOAD dynamic library
add_library(xtreemfs_preload SHARED ${SRCS_PRELOAD}
${SRCS_RPC} ${SRCS_UTIL} ${SRCS_GENERATED} ${SRCS_XTREEMFS})
IF(NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug")
SET_TARGET_PROPERTIES(xtreemfs_preload PROPERTIES COMPILE_DEFINITIONS "XTREEMFS_PRELOAD_QUIET")
ENDIF(NOT ${CMAKE_BUILD_TYPE} MATCHES "Debug")
SET_TARGET_PROPERTIES(xtreemfs_preload PROPERTIES LINKER_LANGUAGE C)
TARGET_LINK_LIBRARIES(xtreemfs_preload
xtreemfs
-ldl
${CLIENT_GOOGLE_PROTOBUF_CPP_DYNAMIC_LIBRARY})
ADD_EXECUTABLE(preload_test "test/ld_preload/preload_test.cpp")
endif(BUILD_PRELOAD)
################################################################################
# Define building of unittests.
################################################################################
#
# Unit tests are only compiled if the CMake variable BUILD_CLIENT_TESTS is set
# (passed by the top level Makefile if the environment variable
# BUILD_CLIENT_TESTS is set).
#
# The directory structure under test/ is identical to the one under src/ and
# include/.
# Since some components are not available on all plattforms, some variables
# are inspected for each component before the component's unit tests are
# compiled.
# A component here is given by the name of the directory below test/ i.e.,
# the component for the file test/fuse/fuse_options_test.cpp is "fuse".
#
# The following variables are inspected for each component:
# UNITTESTS_SKIP_${COMPONENT} - set if component unit tests must not be compiled
# UNITTESTS_REQUIRED_SOURCES_${COMPONENT} - list of source files which have to
# be compiled for the unit test
# UNITTESTS_REQUIRED_LIBRARIES_${COMPONENT} - list of libraries which have to be
# linked to the unit test.
################################################################################
if(BUILD_CLIENT_TESTS)
# enable_testing() will provide a target "test".
enable_testing()
include_directories("test")
MESSAGE(STATUS "Configuring libxtreemfs unittests.")
file(GLOB_RECURSE SRCS_TEST_COMMON test/common/*.cpp)
add_library(test_common ${SRCS_TEST_COMMON})
set (UNITTESTS_SKIP_common true)
file(GLOB_RECURSE SRCS_TESTS test/*.cpp)
foreach (TEST ${SRCS_TESTS})
get_filename_component(DIRNAME ${TEST} PATH)
get_filename_component(COMPONENT ${DIRNAME} NAME)
get_filename_component(FILENAME ${TEST} NAME)
if (NOT UNITTESTS_SKIP_${COMPONENT})
if (${FILENAME} MATCHES "_test.cpp$")
string(REGEX REPLACE "_test.cpp$" "" testname ${FILENAME})
set(testname "test_${testname}")
MESSAGE(STATUS "\tConfiguring test: ${testname}.")
add_executable(${testname} ${TEST} ${UNITTESTS_REQUIRED_SOURCES_${COMPONENT}})
SET_TARGET_PROPERTIES(${testname} PROPERTIES COMPILE_DEFINITIONS ${COMPILE_DEFS})
TARGET_LINK_LIBRARIES(${testname} gtest_main gtest test_common xtreemfs ${UNITTESTS_REQUIRED_LIBRARIES_${COMPONENT}})
ADD_TEST(${testname} ${testname})
else()
MESSAGE(STATUS "\tWARNING: Found file '${FILENAME}' below test/ does not end with '_test.cpp' and was therefore ignored as unit test.")
endif(${FILENAME} MATCHES "_test.cpp$")
endif(NOT UNITTESTS_SKIP_${COMPONENT})
endforeach(TEST)
endif(BUILD_CLIENT_TESTS)

1623
cpp/Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
find_path(VALGRIND_INCLUDE_DIR
NAMES
valgrind/valgrind.h
HINTS
/usr
/usr/local
PATH_SUFFIXES
include
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VALGRIND
DEFAULT_MSG
VALGRIND_INCLUDE_DIR
)
mark_as_advanced(VALGRIND_INCLUDE_DIR)

5
cpp/cpp_prj/.dep.inc Normal file
View File

@ -0,0 +1,5 @@
# This code depends on make tool being used
DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES}))
ifneq (${DEPFILES},)
include ${DEPFILES}
endif

View File

@ -0,0 +1,128 @@
#
# There exist several targets which are by default empty and which can be
# used for execution of your targets. These targets are usually executed
# before and after some main targets. They are:
#
# .build-pre: called before 'build' target
# .build-post: called after 'build' target
# .clean-pre: called before 'clean' target
# .clean-post: called after 'clean' target
# .clobber-pre: called before 'clobber' target
# .clobber-post: called after 'clobber' target
# .all-pre: called before 'all' target
# .all-post: called after 'all' target
# .help-pre: called before 'help' target
# .help-post: called after 'help' target
#
# Targets beginning with '.' are not intended to be called on their own.
#
# Main targets can be executed directly, and they are:
#
# build build a specific configuration
# clean remove built files from a configuration
# clobber remove all built files
# all build all configurations
# help print help mesage
#
# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
# .help-impl are implemented in nbproject/makefile-impl.mk.
#
# Available make variables:
#
# CND_BASEDIR base directory for relative paths
# CND_DISTDIR default top distribution directory (build artifacts)
# CND_BUILDDIR default top build directory (object files, ...)
# CONF name of current configuration
# CND_PLATFORM_${CONF} platform name (current configuration)
# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
#
# NOCDDL
# Environment
MKDIR=mkdir
CP=cp
CCADMIN=CCadmin
# build
build: .build-post
.build-pre:
# Add your pre 'build' code here...
.build-post: .build-impl
# Add your post 'build' code here...
# clean
clean: .clean-post
.clean-pre:
# Add your pre 'clean' code here...
.clean-post: .clean-impl
# Add your post 'clean' code here...
# clobber
clobber: .clobber-post
.clobber-pre:
# Add your pre 'clobber' code here...
.clobber-post: .clobber-impl
# Add your post 'clobber' code here...
# all
all: .all-post
.all-pre:
# Add your pre 'all' code here...
.all-post: .all-impl
# Add your post 'all' code here...
# build tests
build-tests: .build-tests-post
.build-tests-pre:
# Add your pre 'build-tests' code here...
.build-tests-post: .build-tests-impl
# Add your post 'build-tests' code here...
# run tests
test: .test-post
.test-pre:
# Add your pre 'test' code here...
.test-post: .test-impl
# Add your post 'test' code here...
# help
help: .help-post
.help-pre:
# Add your pre 'help' code here...
.help-post: .help-impl
# Add your post 'help' code here...
# include project implementation makefile
include nbproject/Makefile-impl.mk
# include project make variables
include nbproject/Makefile-variables.mk

View File

@ -0,0 +1,66 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a -pre and a -post target defined where you can add customized code.
#
# This makefile implements configuration specific macros and targets.
# Environment
MKDIR=mkdir
CP=cp
GREP=grep
NM=nm
CCADMIN=CCadmin
RANLIB=ranlib
CC=gcc
CCC=g++
CXX=g++
FC=
AS=as
# Macros
CND_PLATFORM=GNU-Linux-x86
CND_CONF=Default
CND_DISTDIR=dist
# Include project Makefile
include cpp_prj-Makefile.mk
# Object Directory
OBJECTDIR=build/${CND_CONF}/${CND_PLATFORM}
# Object Files
OBJECTFILES=
# C Compiler Flags
CFLAGS=
# CC Compiler Flags
CCFLAGS=
CXXFLAGS=
# Fortran Compiler Flags
FFLAGS=
# Assembler Flags
ASFLAGS=
# Link Libraries and Options
LDLIBSOPTIONS=
# Build Targets
.build-conf: ${BUILD_SUBPROJECTS}
cd .. && ${MAKE} -f Makefile
# Subprojects
.build-subprojects:
# Clean Targets
.clean-conf: ${CLEAN_SUBPROJECTS}
cd .. && ${MAKE} -f Makefile clean
# Subprojects
.clean-subprojects:

View File

@ -0,0 +1,133 @@
#
# Generated Makefile - do not edit!
#
# Edit the Makefile in the project folder instead (../Makefile). Each target
# has a pre- and a post- target defined where you can add customization code.
#
# This makefile implements macros and targets common to all configurations.
#
# NOCDDL
# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
# and .clean-reqprojects-conf unless SUB has the value 'no'
SUB_no=NO
SUBPROJECTS=${SUB_${SUB}}
BUILD_SUBPROJECTS_=.build-subprojects
BUILD_SUBPROJECTS_NO=
BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
CLEAN_SUBPROJECTS_=.clean-subprojects
CLEAN_SUBPROJECTS_NO=
CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
# Project Name
PROJECTNAME=cpp_prj
# Active Configuration
DEFAULTCONF=Default
CONF=${DEFAULTCONF}
# All Configurations
ALLCONFS=Default
# build
.build-impl: .build-pre .validate-impl .depcheck-impl
@#echo "=> Running $@... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf
# clean
.clean-impl: .clean-pre .validate-impl .depcheck-impl
@#echo "=> Running $@... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf
# clobber
.clobber-impl: .clobber-pre .depcheck-impl
@#echo "=> Running $@..."
for CONF in ${ALLCONFS}; \
do \
"${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
done
# all
.all-impl: .all-pre .depcheck-impl
@#echo "=> Running $@..."
for CONF in ${ALLCONFS}; \
do \
"${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \
done
# build tests
.build-tests-impl: .build-impl .build-tests-pre
@#echo "=> Running $@... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf
# run tests
.test-impl: .build-tests-impl .test-pre
@#echo "=> Running $@... Configuration=$(CONF)"
"${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf
# dependency checking support
.depcheck-impl:
@echo "# This code depends on make tool being used" >.dep.inc
@if [ -n "${MAKE_VERSION}" ]; then \
echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES}))" >>.dep.inc; \
echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
echo "include \$${DEPFILES}" >>.dep.inc; \
echo "endif" >>.dep.inc; \
else \
echo ".KEEP_STATE:" >>.dep.inc; \
echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
fi
# configuration validation
.validate-impl:
@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
then \
echo ""; \
echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
echo "See 'make help' for details."; \
echo "Current directory: " `pwd`; \
echo ""; \
fi
@if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
then \
exit 1; \
fi
# help
.help-impl: .help-pre
@echo "This makefile supports the following configurations:"
@echo " ${ALLCONFS}"
@echo ""
@echo "and the following targets:"
@echo " build (default target)"
@echo " clean"
@echo " clobber"
@echo " all"
@echo " help"
@echo ""
@echo "Makefile Usage:"
@echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
@echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
@echo " make [SUB=no] clobber"
@echo " make [SUB=no] all"
@echo " make help"
@echo ""
@echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
@echo " also build subprojects."
@echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
@echo " also clean subprojects."
@echo "Target 'clobber' will remove all built files from all configurations and,"
@echo " unless 'SUB=no', also from subprojects."
@echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
@echo " also build subprojects."
@echo "Target 'help' prints this message."
@echo ""

View File

@ -0,0 +1,16 @@
#
# Generated - do not edit!
#
# NOCDDL
#
CND_BASEDIR=`pwd`
CND_BUILDDIR=build
CND_DISTDIR=dist
# Default configuration
CND_PLATFORM_Default=GNU-Linux-x86
CND_ARTIFACT_DIR_Default=..
CND_ARTIFACT_NAME_Default=fusetest
CND_ARTIFACT_PATH_Default=../fusetest
CND_PACKAGE_DIR_Default=dist/Default/GNU-Linux-x86/package
CND_PACKAGE_NAME_Default=cppprj.tar
CND_PACKAGE_PATH_Default=dist/Default/GNU-Linux-x86/package/cppprj.tar

View File

@ -0,0 +1,74 @@
#!/bin/bash -x
#
# Generated - do not edit!
#
# Macros
TOP=`pwd`
CND_PLATFORM=GNU-Linux-x86
CND_CONF=Default
CND_DISTDIR=dist
NBTMPDIR=build/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
TMPDIRNAME=tmp-packaging
OUTPUT_PATH=../fusetest
OUTPUT_BASENAME=fusetest
PACKAGE_TOP_DIR=cppprj/
# Functions
function checkReturnCode
{
rc=$?
if [ $rc != 0 ]
then
exit $rc
fi
}
function makeDirectory
# $1 directory path
# $2 permission (optional)
{
mkdir -p "$1"
checkReturnCode
if [ "$2" != "" ]
then
chmod $2 "$1"
checkReturnCode
fi
}
function copyFileToTmpDir
# $1 from-file path
# $2 to-file path
# $3 permission
{
cp "$1" "$2"
checkReturnCode
if [ "$3" != "" ]
then
chmod $3 "$2"
checkReturnCode
fi
}
# Setup
cd "${TOP}"
mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
rm -rf ${NBTMPDIR}
mkdir -p ${NBTMPDIR}
# Copy files and create directories and links
cd "${TOP}"
makeDirectory "${NBTMPDIR}/cppprj/bin"
copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
# Generate tar file
cd "${TOP}"
rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/cppprj.tar
cd ${NBTMPDIR}
tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/cppprj.tar *
checkReturnCode
# Cleanup
cd "${TOP}"
rm -rf ${NBTMPDIR}

View File

@ -0,0 +1,137 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="69">
<logicalFolder name="root" displayName="root" projectFiles="true">
<df name="generated" root="../generated">
<df name="include" kind="SOURCE_LOGICAL_FOLDER">
<in>Common.pb.cc</in>
<in>Common.pb.h</in>
<in>PBRPC.pb.cc</in>
<in>PBRPC.pb.h</in>
</df>
<df name="pbrpc" kind="SOURCE_LOGICAL_FOLDER">
<in>Ping.pb.cc</in>
<in>Ping.pb.h</in>
<in>PingServiceClient.h</in>
<in>RPC.pb.cc</in>
<in>RPC.pb.h</in>
</df>
<df name="xtreemfs" kind="SOURCE_LOGICAL_FOLDER">
<in>DIR.pb.cc</in>
<in>DIR.pb.h</in>
<in>DIRServiceClient.h</in>
<in>GlobalTypes.pb.cc</in>
<in>GlobalTypes.pb.h</in>
<in>MRC.pb.cc</in>
<in>MRC.pb.h</in>
<in>MRCServiceClient.h</in>
<in>OSD.pb.cc</in>
<in>OSD.pb.h</in>
<in>OSDServiceClient.h</in>
</df>
</df>
<df name="include" root="../include">
<df name="rpc" kind="SOURCE_LOGICAL_FOLDER">
<in>abstract_socket_channel.h</in>
<in>callback_interface.h</in>
<in>client.h</in>
<in>client_connection.h</in>
<in>client_request.h</in>
<in>client_request_callback_interface.h</in>
<in>grid_ssl_socket_channel.h</in>
<in>record_marker.h</in>
<in>ssl_options.h</in>
<in>ssl_socket_channel.h</in>
<in>sync_callback.h</in>
<in>tcp_socket_channel.h</in>
</df>
<df name="util">
<in>logging.h</in>
<in>pbrpc_url.h</in>
<in>user_mapping.h</in>
</df>
</df>
<df name="src" root="../src">
<df name="fuse_test">
<in>fuse_client.cpp</in>
<in>mkvol_xtreemfs.cpp</in>
</df>
<df name="rpc" kind="SOURCE_LOGICAL_FOLDER">
<in>client.cpp</in>
<in>client_connection.cpp</in>
<in>client_request.cpp</in>
<in>record_marker.cpp</in>
</df>
<df name="util">
<in>logging.cpp</in>
<in>pbrpc_url.cpp</in>
<in>user_mapping.cpp</in>
</df>
<in>main.cpp</in>
</df>
<logicalFolder name="ExternalFiles"
displayName="Important Files"
projectFiles="false"
kind="IMPORTANT_FILES_FOLDER">
<itemPath>../CMakeLists.txt</itemPath>
<itemPath>../Makefile</itemPath>
<itemPath>cpp_prj-Makefile.mk</itemPath>
</logicalFolder>
</logicalFolder>
<sourceRootList>
<Elem>../src</Elem>
<Elem>../generated</Elem>
<Elem>../include</Elem>
</sourceRootList>
<projectmakefile>cpp_prj-Makefile.mk</projectmakefile>
<confs>
<conf name="Default" type="0">
<toolsSet>
<developmentServer>localhost</developmentServer>
<compilerSet>GNU|GNU</compilerSet>
<platform>2</platform>
</toolsSet>
<makefileType>
<makeTool>
<buildCommandWorkingDir>..</buildCommandWorkingDir>
<buildCommand>${MAKE} -f Makefile</buildCommand>
<cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
<executablePath>../fusetest</executablePath>
<ccTool>
<incDir>
<pElem>../generated</pElem>
<pElem>../include</pElem>
</incDir>
</ccTool>
</makeTool>
</makefileType>
<item path="../src/main.cpp" ex="false" tool="1">
<ccTool>
<incDir>
<pElem>../generated</pElem>
</incDir>
</ccTool>
</item>
<item path="../src/rpc/client_request.cpp" ex="false" tool="1">
<ccTool>
<incDir>
<pElem>../generated</pElem>
</incDir>
</ccTool>
</item>
<folder path="generated">
<ccTool>
<incDir>
<pElem>../generated</pElem>
</incDir>
</ccTool>
</folder>
<folder path="src">
<ccTool>
<incDir>
<pElem>../include/rpc</pElem>
</incDir>
</ccTool>
</folder>
</conf>
</confs>
</configurationDescriptor>

View File

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<configurationDescriptor version="69">
<projectmakefile>cpp_prj-Makefile.mk</projectmakefile>
<defaultConf>0</defaultConf>
<confs>
<conf name="Default" type="0">
<gizmo_options version="3">
</gizmo_options>
<runprofile version="6">
<args>/home/bjko/mnt</args>
<rundir></rundir>
<buildfirst>true</buildfirst>
<console-type>0</console-type>
<terminal-type>0</terminal-type>
<remove-instrumentation>0</remove-instrumentation>
<environment>
</environment>
</runprofile>
</conf>
</confs>
</configurationDescriptor>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<code-assistance-data xmlns="http://www.netbeans.org/ns/make-project-private/1">
<code-model-enabled>true</code-model-enabled>
</code-assistance-data>
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
</project-private>

View File

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://www.netbeans.org/ns/project/1">
<type>org.netbeans.modules.cnd.makeproject</type>
<configuration>
<data xmlns="http://www.netbeans.org/ns/make-project/1">
<name>cpp_prj</name>
<make-project-type>0</make-project-type>
<c-extensions/>
<cpp-extensions>cc,cpp</cpp-extensions>
<header-extensions>h</header-extensions>
<sourceEncoding>UTF-8</sourceEncoding>
<make-dep-projects/>
<sourceRootList>
<sourceRootElem>../src</sourceRootElem>
<sourceRootElem>../generated</sourceRootElem>
<sourceRootElem>../include</sourceRootElem>
</sourceRootList>
<confList>
<confElem>Default</confElem>
</confList>
</data>
</configuration>
</project>

View File

@ -0,0 +1,438 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: include/Common.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "include/Common.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
namespace xtreemfs {
namespace pbrpc {
namespace {
const ::google::protobuf::Descriptor* emptyRequest_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
emptyRequest_reflection_ = NULL;
const ::google::protobuf::Descriptor* emptyResponse_descriptor_ = NULL;
const ::google::protobuf::internal::GeneratedMessageReflection*
emptyResponse_reflection_ = NULL;
} // namespace
void protobuf_AssignDesc_include_2fCommon_2eproto() {
protobuf_AddDesc_include_2fCommon_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"include/Common.proto");
GOOGLE_CHECK(file != NULL);
emptyRequest_descriptor_ = file->message_type(0);
static const int emptyRequest_offsets_[1] = {
};
emptyRequest_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
emptyRequest_descriptor_,
emptyRequest::default_instance_,
emptyRequest_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(emptyRequest, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(emptyRequest, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(emptyRequest));
emptyResponse_descriptor_ = file->message_type(1);
static const int emptyResponse_offsets_[1] = {
};
emptyResponse_reflection_ =
new ::google::protobuf::internal::GeneratedMessageReflection(
emptyResponse_descriptor_,
emptyResponse::default_instance_,
emptyResponse_offsets_,
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(emptyResponse, _has_bits_[0]),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(emptyResponse, _unknown_fields_),
-1,
::google::protobuf::DescriptorPool::generated_pool(),
::google::protobuf::MessageFactory::generated_factory(),
sizeof(emptyResponse));
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_include_2fCommon_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
emptyRequest_descriptor_, &emptyRequest::default_instance());
::google::protobuf::MessageFactory::InternalRegisterGeneratedMessage(
emptyResponse_descriptor_, &emptyResponse::default_instance());
}
} // namespace
void protobuf_ShutdownFile_include_2fCommon_2eproto() {
delete emptyRequest::default_instance_;
delete emptyRequest_reflection_;
delete emptyResponse::default_instance_;
delete emptyResponse_reflection_;
}
void protobuf_AddDesc_include_2fCommon_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\024include/Common.proto\022\016xtreemfs.pbrpc\"\016"
"\n\014emptyRequest\"\017\n\remptyResponseB(\n&org.x"
"treemfs.pbrpc.generatedinterfaces", 113);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"include/Common.proto", &protobuf_RegisterTypes);
emptyRequest::default_instance_ = new emptyRequest();
emptyResponse::default_instance_ = new emptyResponse();
emptyRequest::default_instance_->InitAsDefaultInstance();
emptyResponse::default_instance_->InitAsDefaultInstance();
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_include_2fCommon_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_include_2fCommon_2eproto {
StaticDescriptorInitializer_include_2fCommon_2eproto() {
protobuf_AddDesc_include_2fCommon_2eproto();
}
} static_descriptor_initializer_include_2fCommon_2eproto_;
// ===================================================================
#ifndef _MSC_VER
#endif // !_MSC_VER
emptyRequest::emptyRequest()
: ::google::protobuf::Message() {
SharedCtor();
}
void emptyRequest::InitAsDefaultInstance() {
}
emptyRequest::emptyRequest(const emptyRequest& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void emptyRequest::SharedCtor() {
_cached_size_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
emptyRequest::~emptyRequest() {
SharedDtor();
}
void emptyRequest::SharedDtor() {
if (this != default_instance_) {
}
}
void emptyRequest::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* emptyRequest::descriptor() {
protobuf_AssignDescriptorsOnce();
return emptyRequest_descriptor_;
}
const emptyRequest& emptyRequest::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_include_2fCommon_2eproto();
return *default_instance_;
}
emptyRequest* emptyRequest::default_instance_ = NULL;
emptyRequest* emptyRequest::New() const {
return new emptyRequest;
}
void emptyRequest::Clear() {
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool emptyRequest::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
}
return true;
#undef DO_
}
void emptyRequest::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* emptyRequest::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int emptyRequest::ByteSize() const {
int total_size = 0;
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void emptyRequest::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const emptyRequest* source =
::google::protobuf::internal::dynamic_cast_if_available<const emptyRequest*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void emptyRequest::MergeFrom(const emptyRequest& from) {
GOOGLE_CHECK_NE(&from, this);
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void emptyRequest::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void emptyRequest::CopyFrom(const emptyRequest& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool emptyRequest::IsInitialized() const {
return true;
}
void emptyRequest::Swap(emptyRequest* other) {
if (other != this) {
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata emptyRequest::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = emptyRequest_descriptor_;
metadata.reflection = emptyRequest_reflection_;
return metadata;
}
// ===================================================================
#ifndef _MSC_VER
#endif // !_MSC_VER
emptyResponse::emptyResponse()
: ::google::protobuf::Message() {
SharedCtor();
}
void emptyResponse::InitAsDefaultInstance() {
}
emptyResponse::emptyResponse(const emptyResponse& from)
: ::google::protobuf::Message() {
SharedCtor();
MergeFrom(from);
}
void emptyResponse::SharedCtor() {
_cached_size_ = 0;
::memset(_has_bits_, 0, sizeof(_has_bits_));
}
emptyResponse::~emptyResponse() {
SharedDtor();
}
void emptyResponse::SharedDtor() {
if (this != default_instance_) {
}
}
void emptyResponse::SetCachedSize(int size) const {
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
}
const ::google::protobuf::Descriptor* emptyResponse::descriptor() {
protobuf_AssignDescriptorsOnce();
return emptyResponse_descriptor_;
}
const emptyResponse& emptyResponse::default_instance() {
if (default_instance_ == NULL) protobuf_AddDesc_include_2fCommon_2eproto();
return *default_instance_;
}
emptyResponse* emptyResponse::default_instance_ = NULL;
emptyResponse* emptyResponse::New() const {
return new emptyResponse;
}
void emptyResponse::Clear() {
::memset(_has_bits_, 0, sizeof(_has_bits_));
mutable_unknown_fields()->Clear();
}
bool emptyResponse::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!(EXPRESSION)) return false
::google::protobuf::uint32 tag;
while ((tag = input->ReadTag()) != 0) {
if (::google::protobuf::internal::WireFormatLite::GetTagWireType(tag) ==
::google::protobuf::internal::WireFormatLite::WIRETYPE_END_GROUP) {
return true;
}
DO_(::google::protobuf::internal::WireFormat::SkipField(
input, tag, mutable_unknown_fields()));
}
return true;
#undef DO_
}
void emptyResponse::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
if (!unknown_fields().empty()) {
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
unknown_fields(), output);
}
}
::google::protobuf::uint8* emptyResponse::SerializeWithCachedSizesToArray(
::google::protobuf::uint8* target) const {
if (!unknown_fields().empty()) {
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
unknown_fields(), target);
}
return target;
}
int emptyResponse::ByteSize() const {
int total_size = 0;
if (!unknown_fields().empty()) {
total_size +=
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
unknown_fields());
}
GOOGLE_SAFE_CONCURRENT_WRITES_BEGIN();
_cached_size_ = total_size;
GOOGLE_SAFE_CONCURRENT_WRITES_END();
return total_size;
}
void emptyResponse::MergeFrom(const ::google::protobuf::Message& from) {
GOOGLE_CHECK_NE(&from, this);
const emptyResponse* source =
::google::protobuf::internal::dynamic_cast_if_available<const emptyResponse*>(
&from);
if (source == NULL) {
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
MergeFrom(*source);
}
}
void emptyResponse::MergeFrom(const emptyResponse& from) {
GOOGLE_CHECK_NE(&from, this);
mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
void emptyResponse::CopyFrom(const ::google::protobuf::Message& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
void emptyResponse::CopyFrom(const emptyResponse& from) {
if (&from == this) return;
Clear();
MergeFrom(from);
}
bool emptyResponse::IsInitialized() const {
return true;
}
void emptyResponse::Swap(emptyResponse* other) {
if (other != this) {
_unknown_fields_.Swap(&other->_unknown_fields_);
std::swap(_cached_size_, other->_cached_size_);
}
}
::google::protobuf::Metadata emptyResponse::GetMetadata() const {
protobuf_AssignDescriptorsOnce();
::google::protobuf::Metadata metadata;
metadata.descriptor = emptyResponse_descriptor_;
metadata.reflection = emptyResponse_reflection_;
return metadata;
}
// @@protoc_insertion_point(namespace_scope)
} // namespace pbrpc
} // namespace xtreemfs
// @@protoc_insertion_point(global_scope)

View File

@ -0,0 +1,212 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: include/Common.proto
#ifndef PROTOBUF_include_2fCommon_2eproto__INCLUDED
#define PROTOBUF_include_2fCommon_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2005000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/unknown_field_set.h>
// @@protoc_insertion_point(includes)
namespace xtreemfs {
namespace pbrpc {
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_include_2fCommon_2eproto();
void protobuf_AssignDesc_include_2fCommon_2eproto();
void protobuf_ShutdownFile_include_2fCommon_2eproto();
class emptyRequest;
class emptyResponse;
// ===================================================================
class emptyRequest : public ::google::protobuf::Message {
public:
emptyRequest();
virtual ~emptyRequest();
emptyRequest(const emptyRequest& from);
inline emptyRequest& operator=(const emptyRequest& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const emptyRequest& default_instance();
void Swap(emptyRequest* other);
// implements Message ----------------------------------------------
emptyRequest* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const emptyRequest& from);
void MergeFrom(const emptyRequest& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:xtreemfs.pbrpc.emptyRequest)
private:
::google::protobuf::UnknownFieldSet _unknown_fields_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[1];
friend void protobuf_AddDesc_include_2fCommon_2eproto();
friend void protobuf_AssignDesc_include_2fCommon_2eproto();
friend void protobuf_ShutdownFile_include_2fCommon_2eproto();
void InitAsDefaultInstance();
static emptyRequest* default_instance_;
};
// -------------------------------------------------------------------
class emptyResponse : public ::google::protobuf::Message {
public:
emptyResponse();
virtual ~emptyResponse();
emptyResponse(const emptyResponse& from);
inline emptyResponse& operator=(const emptyResponse& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const emptyResponse& default_instance();
void Swap(emptyResponse* other);
// implements Message ----------------------------------------------
emptyResponse* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const emptyResponse& from);
void MergeFrom(const emptyResponse& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:xtreemfs.pbrpc.emptyResponse)
private:
::google::protobuf::UnknownFieldSet _unknown_fields_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[1];
friend void protobuf_AddDesc_include_2fCommon_2eproto();
friend void protobuf_AssignDesc_include_2fCommon_2eproto();
friend void protobuf_ShutdownFile_include_2fCommon_2eproto();
void InitAsDefaultInstance();
static emptyResponse* default_instance_;
};
// ===================================================================
// ===================================================================
// emptyRequest
// -------------------------------------------------------------------
// emptyResponse
// @@protoc_insertion_point(namespace_scope)
} // namespace pbrpc
} // namespace xtreemfs
#ifndef SWIG
namespace google {
namespace protobuf {
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_include_2fCommon_2eproto__INCLUDED

View File

@ -0,0 +1,111 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: include/PBRPC.proto
#define INTERNAL_SUPPRESS_PROTOBUF_FIELD_DEPRECATION
#include "include/PBRPC.pb.h"
#include <algorithm>
#include <google/protobuf/stubs/common.h>
#include <google/protobuf/stubs/once.h>
#include <google/protobuf/io/coded_stream.h>
#include <google/protobuf/wire_format_lite_inl.h>
#include <google/protobuf/descriptor.h>
#include <google/protobuf/generated_message_reflection.h>
#include <google/protobuf/reflection_ops.h>
#include <google/protobuf/wire_format.h>
// @@protoc_insertion_point(includes)
namespace xtreemfs {
namespace pbrpc {
namespace {
} // namespace
void protobuf_AssignDesc_include_2fPBRPC_2eproto() {
protobuf_AddDesc_include_2fPBRPC_2eproto();
const ::google::protobuf::FileDescriptor* file =
::google::protobuf::DescriptorPool::generated_pool()->FindFileByName(
"include/PBRPC.proto");
GOOGLE_CHECK(file != NULL);
}
namespace {
GOOGLE_PROTOBUF_DECLARE_ONCE(protobuf_AssignDescriptors_once_);
inline void protobuf_AssignDescriptorsOnce() {
::google::protobuf::GoogleOnceInit(&protobuf_AssignDescriptors_once_,
&protobuf_AssignDesc_include_2fPBRPC_2eproto);
}
void protobuf_RegisterTypes(const ::std::string&) {
protobuf_AssignDescriptorsOnce();
}
} // namespace
void protobuf_ShutdownFile_include_2fPBRPC_2eproto() {
}
void protobuf_AddDesc_include_2fPBRPC_2eproto() {
static bool already_here = false;
if (already_here) return;
already_here = true;
GOOGLE_PROTOBUF_VERIFY_VERSION;
::google::protobuf::protobuf_AddDesc_google_2fprotobuf_2fdescriptor_2eproto();
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
"\n\023include/PBRPC.proto\022\016xtreemfs.pbrpc\032 g"
"oogle/protobuf/descriptor.proto:1\n\007proc_"
"id\022\036.google.protobuf.MethodOptions\030\321\206\003 \001"
"(\007:1\n\007data_in\022\036.google.protobuf.MethodOp"
"tions\030\324\206\003 \001(\010:2\n\010data_out\022\036.google.proto"
"buf.MethodOptions\030\323\206\003 \001(\010:7\n\014interface_i"
"d\022\037.google.protobuf.ServiceOptions\030\322\206\003 \001"
"(\007B3\n1org.xtreemfs.foundation.pbrpc.gene"
"ratedinterfaces", 335);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"include/PBRPC.proto", &protobuf_RegisterTypes);
::google::protobuf::internal::ExtensionSet::RegisterExtension(
&::google::protobuf::MethodOptions::default_instance(),
50001, 7, false, false);
::google::protobuf::internal::ExtensionSet::RegisterExtension(
&::google::protobuf::MethodOptions::default_instance(),
50004, 8, false, false);
::google::protobuf::internal::ExtensionSet::RegisterExtension(
&::google::protobuf::MethodOptions::default_instance(),
50003, 8, false, false);
::google::protobuf::internal::ExtensionSet::RegisterExtension(
&::google::protobuf::ServiceOptions::default_instance(),
50002, 7, false, false);
::google::protobuf::internal::OnShutdown(&protobuf_ShutdownFile_include_2fPBRPC_2eproto);
}
// Force AddDescriptors() to be called at static initialization time.
struct StaticDescriptorInitializer_include_2fPBRPC_2eproto {
StaticDescriptorInitializer_include_2fPBRPC_2eproto() {
protobuf_AddDesc_include_2fPBRPC_2eproto();
}
} static_descriptor_initializer_include_2fPBRPC_2eproto_;
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MethodOptions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 7, false >
proc_id(kProcIdFieldNumber, 0u);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MethodOptions,
::google::protobuf::internal::PrimitiveTypeTraits< bool >, 8, false >
data_in(kDataInFieldNumber, false);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MethodOptions,
::google::protobuf::internal::PrimitiveTypeTraits< bool >, 8, false >
data_out(kDataOutFieldNumber, false);
::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::ServiceOptions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 7, false >
interface_id(kInterfaceIdFieldNumber, 0u);
// @@protoc_insertion_point(namespace_scope)
} // namespace pbrpc
} // namespace xtreemfs
// @@protoc_insertion_point(global_scope)

View File

@ -0,0 +1,78 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: include/PBRPC.proto
#ifndef PROTOBUF_include_2fPBRPC_2eproto__INCLUDED
#define PROTOBUF_include_2fPBRPC_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2005000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include "google/protobuf/descriptor.pb.h"
// @@protoc_insertion_point(includes)
namespace xtreemfs {
namespace pbrpc {
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_include_2fPBRPC_2eproto();
void protobuf_AssignDesc_include_2fPBRPC_2eproto();
void protobuf_ShutdownFile_include_2fPBRPC_2eproto();
// ===================================================================
// ===================================================================
static const int kProcIdFieldNumber = 50001;
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MethodOptions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 7, false >
proc_id;
static const int kDataInFieldNumber = 50004;
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MethodOptions,
::google::protobuf::internal::PrimitiveTypeTraits< bool >, 8, false >
data_in;
static const int kDataOutFieldNumber = 50003;
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MethodOptions,
::google::protobuf::internal::PrimitiveTypeTraits< bool >, 8, false >
data_out;
static const int kInterfaceIdFieldNumber = 50002;
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::ServiceOptions,
::google::protobuf::internal::PrimitiveTypeTraits< ::google::protobuf::uint32 >, 7, false >
interface_id;
// ===================================================================
// @@protoc_insertion_point(namespace_scope)
} // namespace pbrpc
} // namespace xtreemfs
#ifndef SWIG
namespace google {
namespace protobuf {
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_include_2fPBRPC_2eproto__INCLUDED

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,911 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: pbrpc/Ping.proto
#ifndef PROTOBUF_pbrpc_2fPing_2eproto__INCLUDED
#define PROTOBUF_pbrpc_2fPing_2eproto__INCLUDED
#include <string>
#include <google/protobuf/stubs/common.h>
#if GOOGLE_PROTOBUF_VERSION < 2005000
#error This file was generated by a newer version of protoc which is
#error incompatible with your Protocol Buffer headers. Please update
#error your headers.
#endif
#if 2005000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION
#error This file was generated by an older version of protoc which is
#error incompatible with your Protocol Buffer headers. Please
#error regenerate this file with a newer version of protoc.
#endif
#include <google/protobuf/generated_message_util.h>
#include <google/protobuf/message.h>
#include <google/protobuf/repeated_field.h>
#include <google/protobuf/extension_set.h>
#include <google/protobuf/unknown_field_set.h>
#include "include/PBRPC.pb.h"
// @@protoc_insertion_point(includes)
namespace xtreemfs {
namespace pbrpc {
// Internal implementation detail -- do not call these.
void protobuf_AddDesc_pbrpc_2fPing_2eproto();
void protobuf_AssignDesc_pbrpc_2fPing_2eproto();
void protobuf_ShutdownFile_pbrpc_2fPing_2eproto();
class PingRequest;
class PingResponse;
class PingResponse_PingResult;
class PingResponse_PingError;
class Ping_emptyRequest;
class Ping_emptyResponse;
// ===================================================================
class PingRequest : public ::google::protobuf::Message {
public:
PingRequest();
virtual ~PingRequest();
PingRequest(const PingRequest& from);
inline PingRequest& operator=(const PingRequest& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const PingRequest& default_instance();
void Swap(PingRequest* other);
// implements Message ----------------------------------------------
PingRequest* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const PingRequest& from);
void MergeFrom(const PingRequest& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required string text = 1;
inline bool has_text() const;
inline void clear_text();
static const int kTextFieldNumber = 1;
inline const ::std::string& text() const;
inline void set_text(const ::std::string& value);
inline void set_text(const char* value);
inline void set_text(const char* value, size_t size);
inline ::std::string* mutable_text();
inline ::std::string* release_text();
inline void set_allocated_text(::std::string* text);
// required bool sendError = 2;
inline bool has_senderror() const;
inline void clear_senderror();
static const int kSendErrorFieldNumber = 2;
inline bool senderror() const;
inline void set_senderror(bool value);
// @@protoc_insertion_point(class_scope:xtreemfs.pbrpc.PingRequest)
private:
inline void set_has_text();
inline void clear_has_text();
inline void set_has_senderror();
inline void clear_has_senderror();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::std::string* text_;
bool senderror_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
friend void protobuf_AddDesc_pbrpc_2fPing_2eproto();
friend void protobuf_AssignDesc_pbrpc_2fPing_2eproto();
friend void protobuf_ShutdownFile_pbrpc_2fPing_2eproto();
void InitAsDefaultInstance();
static PingRequest* default_instance_;
};
// -------------------------------------------------------------------
class PingResponse_PingResult : public ::google::protobuf::Message {
public:
PingResponse_PingResult();
virtual ~PingResponse_PingResult();
PingResponse_PingResult(const PingResponse_PingResult& from);
inline PingResponse_PingResult& operator=(const PingResponse_PingResult& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const PingResponse_PingResult& default_instance();
void Swap(PingResponse_PingResult* other);
// implements Message ----------------------------------------------
PingResponse_PingResult* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const PingResponse_PingResult& from);
void MergeFrom(const PingResponse_PingResult& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required string text = 1;
inline bool has_text() const;
inline void clear_text();
static const int kTextFieldNumber = 1;
inline const ::std::string& text() const;
inline void set_text(const ::std::string& value);
inline void set_text(const char* value);
inline void set_text(const char* value, size_t size);
inline ::std::string* mutable_text();
inline ::std::string* release_text();
inline void set_allocated_text(::std::string* text);
// @@protoc_insertion_point(class_scope:xtreemfs.pbrpc.PingResponse.PingResult)
private:
inline void set_has_text();
inline void clear_has_text();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::std::string* text_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
friend void protobuf_AddDesc_pbrpc_2fPing_2eproto();
friend void protobuf_AssignDesc_pbrpc_2fPing_2eproto();
friend void protobuf_ShutdownFile_pbrpc_2fPing_2eproto();
void InitAsDefaultInstance();
static PingResponse_PingResult* default_instance_;
};
// -------------------------------------------------------------------
class PingResponse_PingError : public ::google::protobuf::Message {
public:
PingResponse_PingError();
virtual ~PingResponse_PingError();
PingResponse_PingError(const PingResponse_PingError& from);
inline PingResponse_PingError& operator=(const PingResponse_PingError& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const PingResponse_PingError& default_instance();
void Swap(PingResponse_PingError* other);
// implements Message ----------------------------------------------
PingResponse_PingError* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const PingResponse_PingError& from);
void MergeFrom(const PingResponse_PingError& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// required string errorMessage = 1;
inline bool has_errormessage() const;
inline void clear_errormessage();
static const int kErrorMessageFieldNumber = 1;
inline const ::std::string& errormessage() const;
inline void set_errormessage(const ::std::string& value);
inline void set_errormessage(const char* value);
inline void set_errormessage(const char* value, size_t size);
inline ::std::string* mutable_errormessage();
inline ::std::string* release_errormessage();
inline void set_allocated_errormessage(::std::string* errormessage);
// @@protoc_insertion_point(class_scope:xtreemfs.pbrpc.PingResponse.PingError)
private:
inline void set_has_errormessage();
inline void clear_has_errormessage();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::std::string* errormessage_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(1 + 31) / 32];
friend void protobuf_AddDesc_pbrpc_2fPing_2eproto();
friend void protobuf_AssignDesc_pbrpc_2fPing_2eproto();
friend void protobuf_ShutdownFile_pbrpc_2fPing_2eproto();
void InitAsDefaultInstance();
static PingResponse_PingError* default_instance_;
};
// -------------------------------------------------------------------
class PingResponse : public ::google::protobuf::Message {
public:
PingResponse();
virtual ~PingResponse();
PingResponse(const PingResponse& from);
inline PingResponse& operator=(const PingResponse& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const PingResponse& default_instance();
void Swap(PingResponse* other);
// implements Message ----------------------------------------------
PingResponse* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const PingResponse& from);
void MergeFrom(const PingResponse& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
typedef PingResponse_PingResult PingResult;
typedef PingResponse_PingError PingError;
// accessors -------------------------------------------------------
// optional .xtreemfs.pbrpc.PingResponse.PingResult result = 1;
inline bool has_result() const;
inline void clear_result();
static const int kResultFieldNumber = 1;
inline const ::xtreemfs::pbrpc::PingResponse_PingResult& result() const;
inline ::xtreemfs::pbrpc::PingResponse_PingResult* mutable_result();
inline ::xtreemfs::pbrpc::PingResponse_PingResult* release_result();
inline void set_allocated_result(::xtreemfs::pbrpc::PingResponse_PingResult* result);
// optional .xtreemfs.pbrpc.PingResponse.PingError error = 2;
inline bool has_error() const;
inline void clear_error();
static const int kErrorFieldNumber = 2;
inline const ::xtreemfs::pbrpc::PingResponse_PingError& error() const;
inline ::xtreemfs::pbrpc::PingResponse_PingError* mutable_error();
inline ::xtreemfs::pbrpc::PingResponse_PingError* release_error();
inline void set_allocated_error(::xtreemfs::pbrpc::PingResponse_PingError* error);
// @@protoc_insertion_point(class_scope:xtreemfs.pbrpc.PingResponse)
private:
inline void set_has_result();
inline void clear_has_result();
inline void set_has_error();
inline void clear_has_error();
::google::protobuf::UnknownFieldSet _unknown_fields_;
::xtreemfs::pbrpc::PingResponse_PingResult* result_;
::xtreemfs::pbrpc::PingResponse_PingError* error_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[(2 + 31) / 32];
friend void protobuf_AddDesc_pbrpc_2fPing_2eproto();
friend void protobuf_AssignDesc_pbrpc_2fPing_2eproto();
friend void protobuf_ShutdownFile_pbrpc_2fPing_2eproto();
void InitAsDefaultInstance();
static PingResponse* default_instance_;
};
// -------------------------------------------------------------------
class Ping_emptyRequest : public ::google::protobuf::Message {
public:
Ping_emptyRequest();
virtual ~Ping_emptyRequest();
Ping_emptyRequest(const Ping_emptyRequest& from);
inline Ping_emptyRequest& operator=(const Ping_emptyRequest& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const Ping_emptyRequest& default_instance();
void Swap(Ping_emptyRequest* other);
// implements Message ----------------------------------------------
Ping_emptyRequest* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Ping_emptyRequest& from);
void MergeFrom(const Ping_emptyRequest& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:xtreemfs.pbrpc.Ping_emptyRequest)
private:
::google::protobuf::UnknownFieldSet _unknown_fields_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[1];
friend void protobuf_AddDesc_pbrpc_2fPing_2eproto();
friend void protobuf_AssignDesc_pbrpc_2fPing_2eproto();
friend void protobuf_ShutdownFile_pbrpc_2fPing_2eproto();
void InitAsDefaultInstance();
static Ping_emptyRequest* default_instance_;
};
// -------------------------------------------------------------------
class Ping_emptyResponse : public ::google::protobuf::Message {
public:
Ping_emptyResponse();
virtual ~Ping_emptyResponse();
Ping_emptyResponse(const Ping_emptyResponse& from);
inline Ping_emptyResponse& operator=(const Ping_emptyResponse& from) {
CopyFrom(from);
return *this;
}
inline const ::google::protobuf::UnknownFieldSet& unknown_fields() const {
return _unknown_fields_;
}
inline ::google::protobuf::UnknownFieldSet* mutable_unknown_fields() {
return &_unknown_fields_;
}
static const ::google::protobuf::Descriptor* descriptor();
static const Ping_emptyResponse& default_instance();
void Swap(Ping_emptyResponse* other);
// implements Message ----------------------------------------------
Ping_emptyResponse* New() const;
void CopyFrom(const ::google::protobuf::Message& from);
void MergeFrom(const ::google::protobuf::Message& from);
void CopyFrom(const Ping_emptyResponse& from);
void MergeFrom(const Ping_emptyResponse& from);
void Clear();
bool IsInitialized() const;
int ByteSize() const;
bool MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input);
void SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const;
::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const;
int GetCachedSize() const { return _cached_size_; }
private:
void SharedCtor();
void SharedDtor();
void SetCachedSize(int size) const;
public:
::google::protobuf::Metadata GetMetadata() const;
// nested types ----------------------------------------------------
// accessors -------------------------------------------------------
// @@protoc_insertion_point(class_scope:xtreemfs.pbrpc.Ping_emptyResponse)
private:
::google::protobuf::UnknownFieldSet _unknown_fields_;
mutable int _cached_size_;
::google::protobuf::uint32 _has_bits_[1];
friend void protobuf_AddDesc_pbrpc_2fPing_2eproto();
friend void protobuf_AssignDesc_pbrpc_2fPing_2eproto();
friend void protobuf_ShutdownFile_pbrpc_2fPing_2eproto();
void InitAsDefaultInstance();
static Ping_emptyResponse* default_instance_;
};
// ===================================================================
// ===================================================================
// PingRequest
// required string text = 1;
inline bool PingRequest::has_text() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void PingRequest::set_has_text() {
_has_bits_[0] |= 0x00000001u;
}
inline void PingRequest::clear_has_text() {
_has_bits_[0] &= ~0x00000001u;
}
inline void PingRequest::clear_text() {
if (text_ != &::google::protobuf::internal::kEmptyString) {
text_->clear();
}
clear_has_text();
}
inline const ::std::string& PingRequest::text() const {
return *text_;
}
inline void PingRequest::set_text(const ::std::string& value) {
set_has_text();
if (text_ == &::google::protobuf::internal::kEmptyString) {
text_ = new ::std::string;
}
text_->assign(value);
}
inline void PingRequest::set_text(const char* value) {
set_has_text();
if (text_ == &::google::protobuf::internal::kEmptyString) {
text_ = new ::std::string;
}
text_->assign(value);
}
inline void PingRequest::set_text(const char* value, size_t size) {
set_has_text();
if (text_ == &::google::protobuf::internal::kEmptyString) {
text_ = new ::std::string;
}
text_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* PingRequest::mutable_text() {
set_has_text();
if (text_ == &::google::protobuf::internal::kEmptyString) {
text_ = new ::std::string;
}
return text_;
}
inline ::std::string* PingRequest::release_text() {
clear_has_text();
if (text_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = text_;
text_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
inline void PingRequest::set_allocated_text(::std::string* text) {
if (text_ != &::google::protobuf::internal::kEmptyString) {
delete text_;
}
if (text) {
set_has_text();
text_ = text;
} else {
clear_has_text();
text_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
}
}
// required bool sendError = 2;
inline bool PingRequest::has_senderror() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void PingRequest::set_has_senderror() {
_has_bits_[0] |= 0x00000002u;
}
inline void PingRequest::clear_has_senderror() {
_has_bits_[0] &= ~0x00000002u;
}
inline void PingRequest::clear_senderror() {
senderror_ = false;
clear_has_senderror();
}
inline bool PingRequest::senderror() const {
return senderror_;
}
inline void PingRequest::set_senderror(bool value) {
set_has_senderror();
senderror_ = value;
}
// -------------------------------------------------------------------
// PingResponse_PingResult
// required string text = 1;
inline bool PingResponse_PingResult::has_text() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void PingResponse_PingResult::set_has_text() {
_has_bits_[0] |= 0x00000001u;
}
inline void PingResponse_PingResult::clear_has_text() {
_has_bits_[0] &= ~0x00000001u;
}
inline void PingResponse_PingResult::clear_text() {
if (text_ != &::google::protobuf::internal::kEmptyString) {
text_->clear();
}
clear_has_text();
}
inline const ::std::string& PingResponse_PingResult::text() const {
return *text_;
}
inline void PingResponse_PingResult::set_text(const ::std::string& value) {
set_has_text();
if (text_ == &::google::protobuf::internal::kEmptyString) {
text_ = new ::std::string;
}
text_->assign(value);
}
inline void PingResponse_PingResult::set_text(const char* value) {
set_has_text();
if (text_ == &::google::protobuf::internal::kEmptyString) {
text_ = new ::std::string;
}
text_->assign(value);
}
inline void PingResponse_PingResult::set_text(const char* value, size_t size) {
set_has_text();
if (text_ == &::google::protobuf::internal::kEmptyString) {
text_ = new ::std::string;
}
text_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* PingResponse_PingResult::mutable_text() {
set_has_text();
if (text_ == &::google::protobuf::internal::kEmptyString) {
text_ = new ::std::string;
}
return text_;
}
inline ::std::string* PingResponse_PingResult::release_text() {
clear_has_text();
if (text_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = text_;
text_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
inline void PingResponse_PingResult::set_allocated_text(::std::string* text) {
if (text_ != &::google::protobuf::internal::kEmptyString) {
delete text_;
}
if (text) {
set_has_text();
text_ = text;
} else {
clear_has_text();
text_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
}
}
// -------------------------------------------------------------------
// PingResponse_PingError
// required string errorMessage = 1;
inline bool PingResponse_PingError::has_errormessage() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void PingResponse_PingError::set_has_errormessage() {
_has_bits_[0] |= 0x00000001u;
}
inline void PingResponse_PingError::clear_has_errormessage() {
_has_bits_[0] &= ~0x00000001u;
}
inline void PingResponse_PingError::clear_errormessage() {
if (errormessage_ != &::google::protobuf::internal::kEmptyString) {
errormessage_->clear();
}
clear_has_errormessage();
}
inline const ::std::string& PingResponse_PingError::errormessage() const {
return *errormessage_;
}
inline void PingResponse_PingError::set_errormessage(const ::std::string& value) {
set_has_errormessage();
if (errormessage_ == &::google::protobuf::internal::kEmptyString) {
errormessage_ = new ::std::string;
}
errormessage_->assign(value);
}
inline void PingResponse_PingError::set_errormessage(const char* value) {
set_has_errormessage();
if (errormessage_ == &::google::protobuf::internal::kEmptyString) {
errormessage_ = new ::std::string;
}
errormessage_->assign(value);
}
inline void PingResponse_PingError::set_errormessage(const char* value, size_t size) {
set_has_errormessage();
if (errormessage_ == &::google::protobuf::internal::kEmptyString) {
errormessage_ = new ::std::string;
}
errormessage_->assign(reinterpret_cast<const char*>(value), size);
}
inline ::std::string* PingResponse_PingError::mutable_errormessage() {
set_has_errormessage();
if (errormessage_ == &::google::protobuf::internal::kEmptyString) {
errormessage_ = new ::std::string;
}
return errormessage_;
}
inline ::std::string* PingResponse_PingError::release_errormessage() {
clear_has_errormessage();
if (errormessage_ == &::google::protobuf::internal::kEmptyString) {
return NULL;
} else {
::std::string* temp = errormessage_;
errormessage_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
return temp;
}
}
inline void PingResponse_PingError::set_allocated_errormessage(::std::string* errormessage) {
if (errormessage_ != &::google::protobuf::internal::kEmptyString) {
delete errormessage_;
}
if (errormessage) {
set_has_errormessage();
errormessage_ = errormessage;
} else {
clear_has_errormessage();
errormessage_ = const_cast< ::std::string*>(&::google::protobuf::internal::kEmptyString);
}
}
// -------------------------------------------------------------------
// PingResponse
// optional .xtreemfs.pbrpc.PingResponse.PingResult result = 1;
inline bool PingResponse::has_result() const {
return (_has_bits_[0] & 0x00000001u) != 0;
}
inline void PingResponse::set_has_result() {
_has_bits_[0] |= 0x00000001u;
}
inline void PingResponse::clear_has_result() {
_has_bits_[0] &= ~0x00000001u;
}
inline void PingResponse::clear_result() {
if (result_ != NULL) result_->::xtreemfs::pbrpc::PingResponse_PingResult::Clear();
clear_has_result();
}
inline const ::xtreemfs::pbrpc::PingResponse_PingResult& PingResponse::result() const {
return result_ != NULL ? *result_ : *default_instance_->result_;
}
inline ::xtreemfs::pbrpc::PingResponse_PingResult* PingResponse::mutable_result() {
set_has_result();
if (result_ == NULL) result_ = new ::xtreemfs::pbrpc::PingResponse_PingResult;
return result_;
}
inline ::xtreemfs::pbrpc::PingResponse_PingResult* PingResponse::release_result() {
clear_has_result();
::xtreemfs::pbrpc::PingResponse_PingResult* temp = result_;
result_ = NULL;
return temp;
}
inline void PingResponse::set_allocated_result(::xtreemfs::pbrpc::PingResponse_PingResult* result) {
delete result_;
result_ = result;
if (result) {
set_has_result();
} else {
clear_has_result();
}
}
// optional .xtreemfs.pbrpc.PingResponse.PingError error = 2;
inline bool PingResponse::has_error() const {
return (_has_bits_[0] & 0x00000002u) != 0;
}
inline void PingResponse::set_has_error() {
_has_bits_[0] |= 0x00000002u;
}
inline void PingResponse::clear_has_error() {
_has_bits_[0] &= ~0x00000002u;
}
inline void PingResponse::clear_error() {
if (error_ != NULL) error_->::xtreemfs::pbrpc::PingResponse_PingError::Clear();
clear_has_error();
}
inline const ::xtreemfs::pbrpc::PingResponse_PingError& PingResponse::error() const {
return error_ != NULL ? *error_ : *default_instance_->error_;
}
inline ::xtreemfs::pbrpc::PingResponse_PingError* PingResponse::mutable_error() {
set_has_error();
if (error_ == NULL) error_ = new ::xtreemfs::pbrpc::PingResponse_PingError;
return error_;
}
inline ::xtreemfs::pbrpc::PingResponse_PingError* PingResponse::release_error() {
clear_has_error();
::xtreemfs::pbrpc::PingResponse_PingError* temp = error_;
error_ = NULL;
return temp;
}
inline void PingResponse::set_allocated_error(::xtreemfs::pbrpc::PingResponse_PingError* error) {
delete error_;
error_ = error;
if (error) {
set_has_error();
} else {
clear_has_error();
}
}
// -------------------------------------------------------------------
// Ping_emptyRequest
// -------------------------------------------------------------------
// Ping_emptyResponse
// @@protoc_insertion_point(namespace_scope)
} // namespace pbrpc
} // namespace xtreemfs
#ifndef SWIG
namespace google {
namespace protobuf {
} // namespace google
} // namespace protobuf
#endif // SWIG
// @@protoc_insertion_point(global_scope)
#endif // PROTOBUF_pbrpc_2fPing_2eproto__INCLUDED

View File

@ -0,0 +1,79 @@
//automatically generated from Ping.proto at Thu Dec 11 16:09:41 CET 2014
//(c) 2014. See LICENSE file for details.
#ifndef PINGSERVICECLIENT_H
#define PINGSERVICECLIENT_H
#include <stdint.h>
#include "pbrpc/RPC.pb.h"
#include "rpc/client.h"
#include "rpc/sync_callback.h"
#include "rpc/callback_interface.h"
#include "pbrpc/Ping.pb.h"
namespace xtreemfs {
namespace pbrpc {
using ::xtreemfs::rpc::Client;
using ::xtreemfs::rpc::CallbackInterface;
using ::xtreemfs::rpc::SyncCallback;
class PingServiceClient {
public:
PingServiceClient(Client* client) : client_(client) {
}
virtual ~PingServiceClient() {
}
void doPing(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::PingRequest* request,const char* data, uint32_t data_length,
CallbackInterface<xtreemfs::pbrpc::PingResponse> *callback, void *context = NULL) {
client_->sendRequest(address, 1, 1,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::PingResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::PingResponse>* doPing_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::PingRequest* request, const char* data, uint32_t data_length) {
SyncCallback<xtreemfs::pbrpc::PingResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::PingResponse>();
client_->sendRequest(address, 1, 1,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::PingResponse(),
NULL, sync_cb);
return sync_cb;
}
void emptyPing(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::Ping_emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::Ping_emptyRequest* request = NULL;
client_->sendRequest(address, 1, 2,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::Ping_emptyResponse>* emptyPing_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::Ping_emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::Ping_emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::Ping_emptyResponse>();
client_->sendRequest(address, 1, 2,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
private:
Client* client_;
};
}
}
#endif //PINGSERVICECLIENT_H

View File

@ -0,0 +1,18 @@
//automatically generated from Ping.proto at Thu Dec 11 16:09:41 CET 2014
//(c) 2014. See LICENSE file for details.
#ifndef PINGSERVICECONSTANTS_H_
#define PINGSERVICECONSTANTS_H_
#include <stdint.h>
namespace xtreemfs {
namespace pbrpc {
const uint32_t INTERFACE_ID_PING = 1;
const uint32_t PROC_ID_DOPING = 1;
const uint32_t PROC_ID_EMPTYPING = 2;
} // namespace pbrpc
} // namespace xtreemfs
#endif // PINGSERVICECLIENT_H_

File diff suppressed because it is too large Load Diff

1687
cpp/generated/pbrpc/RPC.pb.h Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,405 @@
//automatically generated from DIR.proto at Thu Dec 11 16:09:40 CET 2014
//(c) 2014. See LICENSE file for details.
#ifndef DIRSERVICECLIENT_H
#define DIRSERVICECLIENT_H
#include <stdint.h>
#include "pbrpc/RPC.pb.h"
#include "rpc/client.h"
#include "rpc/sync_callback.h"
#include "rpc/callback_interface.h"
#include "include/Common.pb.h"
#include "xtreemfs/GlobalTypes.pb.h"
#include "xtreemfs/DIR.pb.h"
namespace xtreemfs {
namespace pbrpc {
using ::xtreemfs::rpc::Client;
using ::xtreemfs::rpc::CallbackInterface;
using ::xtreemfs::rpc::SyncCallback;
class DIRServiceClient {
public:
DIRServiceClient(Client* client) : client_(client) {
}
virtual ~DIRServiceClient() {
}
void xtreemfs_address_mappings_get(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::addressMappingGetRequest* request,
CallbackInterface<xtreemfs::pbrpc::AddressMappingSet> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 1,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::AddressMappingSet(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::AddressMappingSet>* xtreemfs_address_mappings_get_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::addressMappingGetRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::AddressMappingSet>* sync_cb = new SyncCallback<xtreemfs::pbrpc::AddressMappingSet>();
client_->sendRequest(address, 10001, 1,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::AddressMappingSet(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_address_mappings_remove(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::addressMappingGetRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 2,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_address_mappings_remove_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::addressMappingGetRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 10001, 2,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_address_mappings_set(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::AddressMappingSet* request,
CallbackInterface<xtreemfs::pbrpc::addressMappingSetResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 3,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::addressMappingSetResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::addressMappingSetResponse>* xtreemfs_address_mappings_set_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::AddressMappingSet* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::addressMappingSetResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::addressMappingSetResponse>();
client_->sendRequest(address, 10001, 3,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::addressMappingSetResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_discover_dir(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::DirService> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 10001, 4,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::DirService(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::DirService>* xtreemfs_discover_dir_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::DirService>* sync_cb = new SyncCallback<xtreemfs::pbrpc::DirService>();
client_->sendRequest(address, 10001, 4,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::DirService(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_global_time_s_get(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::globalTimeSGetResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 10001, 5,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::globalTimeSGetResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::globalTimeSGetResponse>* xtreemfs_global_time_s_get_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::globalTimeSGetResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::globalTimeSGetResponse>();
client_->sendRequest(address, 10001, 5,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::globalTimeSGetResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_service_deregister(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::serviceDeregisterRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 6,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_service_deregister_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::serviceDeregisterRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 10001, 6,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_service_get_by_name(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::serviceGetByNameRequest* request,
CallbackInterface<xtreemfs::pbrpc::ServiceSet> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 7,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ServiceSet(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::ServiceSet>* xtreemfs_service_get_by_name_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::serviceGetByNameRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::ServiceSet>* sync_cb = new SyncCallback<xtreemfs::pbrpc::ServiceSet>();
client_->sendRequest(address, 10001, 7,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ServiceSet(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_service_get_by_type(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::serviceGetByTypeRequest* request,
CallbackInterface<xtreemfs::pbrpc::ServiceSet> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 8,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ServiceSet(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::ServiceSet>* xtreemfs_service_get_by_type_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::serviceGetByTypeRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::ServiceSet>* sync_cb = new SyncCallback<xtreemfs::pbrpc::ServiceSet>();
client_->sendRequest(address, 10001, 8,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ServiceSet(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_service_get_by_uuid(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::serviceGetByUUIDRequest* request,
CallbackInterface<xtreemfs::pbrpc::ServiceSet> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 9,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ServiceSet(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::ServiceSet>* xtreemfs_service_get_by_uuid_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::serviceGetByUUIDRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::ServiceSet>* sync_cb = new SyncCallback<xtreemfs::pbrpc::ServiceSet>();
client_->sendRequest(address, 10001, 9,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ServiceSet(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_service_offline(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::serviceGetByUUIDRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 10,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_service_offline_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::serviceGetByUUIDRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 10001, 10,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_service_register(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::serviceRegisterRequest* request,
CallbackInterface<xtreemfs::pbrpc::serviceRegisterResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 11,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::serviceRegisterResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::serviceRegisterResponse>* xtreemfs_service_register_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::serviceRegisterRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::serviceRegisterResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::serviceRegisterResponse>();
client_->sendRequest(address, 10001, 11,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::serviceRegisterResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_checkpoint(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 10001, 20,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_checkpoint_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 10001, 20,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_shutdown(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 10001, 21,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_shutdown_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 10001, 21,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_configuration_get(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::configurationGetRequest* request,
CallbackInterface<xtreemfs::pbrpc::Configuration> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 22,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::Configuration(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::Configuration>* xtreemfs_configuration_get_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::configurationGetRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::Configuration>* sync_cb = new SyncCallback<xtreemfs::pbrpc::Configuration>();
client_->sendRequest(address, 10001, 22,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::Configuration(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_configuration_set(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::Configuration* request,
CallbackInterface<xtreemfs::pbrpc::configurationSetResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 23,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::configurationSetResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::configurationSetResponse>* xtreemfs_configuration_set_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::Configuration* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::configurationSetResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::configurationSetResponse>();
client_->sendRequest(address, 10001, 23,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::configurationSetResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_vivaldi_client_update(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::VivaldiCoordinates* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 10001, 24,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_vivaldi_client_update_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::VivaldiCoordinates* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 10001, 24,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
private:
Client* client_;
};
}
}
#endif //DIRSERVICECLIENT_H

View File

@ -0,0 +1,32 @@
//automatically generated from DIR.proto at Thu Dec 11 16:09:40 CET 2014
//(c) 2014. See LICENSE file for details.
#ifndef DIRSERVICECONSTANTS_H_
#define DIRSERVICECONSTANTS_H_
#include <stdint.h>
namespace xtreemfs {
namespace pbrpc {
const uint32_t INTERFACE_ID_DIR = 10001;
const uint32_t PROC_ID_XTREEMFS_ADDRESS_MAPPINGS_GET = 1;
const uint32_t PROC_ID_XTREEMFS_ADDRESS_MAPPINGS_REMOVE = 2;
const uint32_t PROC_ID_XTREEMFS_ADDRESS_MAPPINGS_SET = 3;
const uint32_t PROC_ID_XTREEMFS_DISCOVER_DIR = 4;
const uint32_t PROC_ID_XTREEMFS_GLOBAL_TIME_S_GET = 5;
const uint32_t PROC_ID_XTREEMFS_SERVICE_DEREGISTER = 6;
const uint32_t PROC_ID_XTREEMFS_SERVICE_GET_BY_NAME = 7;
const uint32_t PROC_ID_XTREEMFS_SERVICE_GET_BY_TYPE = 8;
const uint32_t PROC_ID_XTREEMFS_SERVICE_GET_BY_UUID = 9;
const uint32_t PROC_ID_XTREEMFS_SERVICE_OFFLINE = 10;
const uint32_t PROC_ID_XTREEMFS_SERVICE_REGISTER = 11;
const uint32_t PROC_ID_XTREEMFS_CHECKPOINT = 20;
const uint32_t PROC_ID_XTREEMFS_SHUTDOWN = 21;
const uint32_t PROC_ID_XTREEMFS_CONFIGURATION_GET = 22;
const uint32_t PROC_ID_XTREEMFS_CONFIGURATION_SET = 23;
const uint32_t PROC_ID_XTREEMFS_VIVALDI_CLIENT_UPDATE = 24;
} // namespace pbrpc
} // namespace xtreemfs
#endif // DIRSERVICECLIENT_H_

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,981 @@
//automatically generated from MRC.proto at Thu Dec 11 16:09:40 CET 2014
//(c) 2014. See LICENSE file for details.
#ifndef MRCSERVICECLIENT_H
#define MRCSERVICECLIENT_H
#include <stdint.h>
#include "pbrpc/RPC.pb.h"
#include "rpc/client.h"
#include "rpc/sync_callback.h"
#include "rpc/callback_interface.h"
#include "xtreemfs/MRC.pb.h"
#include "include/Common.pb.h"
#include "xtreemfs/GlobalTypes.pb.h"
#include "xtreemfs/DIR.pb.h"
namespace xtreemfs {
namespace pbrpc {
using ::xtreemfs::rpc::Client;
using ::xtreemfs::rpc::CallbackInterface;
using ::xtreemfs::rpc::SyncCallback;
class MRCServiceClient {
public:
MRCServiceClient(Client* client) : client_(client) {
}
virtual ~MRCServiceClient() {
}
void fsetattr(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::fsetattrRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 2,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* fsetattr_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::fsetattrRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 20001, 2,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void ftruncate(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::XCap* request,
CallbackInterface<xtreemfs::pbrpc::XCap> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 3,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::XCap(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::XCap>* ftruncate_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::XCap* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::XCap>* sync_cb = new SyncCallback<xtreemfs::pbrpc::XCap>();
client_->sendRequest(address, 20001, 3,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::XCap(),
NULL, sync_cb);
return sync_cb;
}
void getattr(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::getattrRequest* request,
CallbackInterface<xtreemfs::pbrpc::getattrResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 4,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::getattrResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::getattrResponse>* getattr_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::getattrRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::getattrResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::getattrResponse>();
client_->sendRequest(address, 20001, 4,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::getattrResponse(),
NULL, sync_cb);
return sync_cb;
}
void getxattr(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::getxattrRequest* request,
CallbackInterface<xtreemfs::pbrpc::getxattrResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 5,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::getxattrResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::getxattrResponse>* getxattr_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::getxattrRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::getxattrResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::getxattrResponse>();
client_->sendRequest(address, 20001, 5,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::getxattrResponse(),
NULL, sync_cb);
return sync_cb;
}
void link(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::linkRequest* request,
CallbackInterface<xtreemfs::pbrpc::timestampResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 6,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::timestampResponse>* link_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::linkRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::timestampResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::timestampResponse>();
client_->sendRequest(address, 20001, 6,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
NULL, sync_cb);
return sync_cb;
}
void listxattr(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::listxattrRequest* request,
CallbackInterface<xtreemfs::pbrpc::listxattrResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 7,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::listxattrResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::listxattrResponse>* listxattr_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::listxattrRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::listxattrResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::listxattrResponse>();
client_->sendRequest(address, 20001, 7,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::listxattrResponse(),
NULL, sync_cb);
return sync_cb;
}
void mkdir(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::mkdirRequest* request,
CallbackInterface<xtreemfs::pbrpc::timestampResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 8,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::timestampResponse>* mkdir_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::mkdirRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::timestampResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::timestampResponse>();
client_->sendRequest(address, 20001, 8,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
NULL, sync_cb);
return sync_cb;
}
void open(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::openRequest* request,
CallbackInterface<xtreemfs::pbrpc::openResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 9,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::openResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::openResponse>* open_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::openRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::openResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::openResponse>();
client_->sendRequest(address, 20001, 9,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::openResponse(),
NULL, sync_cb);
return sync_cb;
}
void readdir(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::readdirRequest* request,
CallbackInterface<xtreemfs::pbrpc::DirectoryEntries> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 10,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::DirectoryEntries(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::DirectoryEntries>* readdir_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::readdirRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::DirectoryEntries>* sync_cb = new SyncCallback<xtreemfs::pbrpc::DirectoryEntries>();
client_->sendRequest(address, 20001, 10,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::DirectoryEntries(),
NULL, sync_cb);
return sync_cb;
}
void readlink(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::readlinkRequest* request,
CallbackInterface<xtreemfs::pbrpc::readlinkResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 11,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::readlinkResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::readlinkResponse>* readlink_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::readlinkRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::readlinkResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::readlinkResponse>();
client_->sendRequest(address, 20001, 11,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::readlinkResponse(),
NULL, sync_cb);
return sync_cb;
}
void removexattr(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::removexattrRequest* request,
CallbackInterface<xtreemfs::pbrpc::timestampResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 12,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::timestampResponse>* removexattr_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::removexattrRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::timestampResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::timestampResponse>();
client_->sendRequest(address, 20001, 12,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
NULL, sync_cb);
return sync_cb;
}
void rename(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::renameRequest* request,
CallbackInterface<xtreemfs::pbrpc::renameResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 13,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::renameResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::renameResponse>* rename_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::renameRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::renameResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::renameResponse>();
client_->sendRequest(address, 20001, 13,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::renameResponse(),
NULL, sync_cb);
return sync_cb;
}
void rmdir(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::rmdirRequest* request,
CallbackInterface<xtreemfs::pbrpc::timestampResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 14,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::timestampResponse>* rmdir_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::rmdirRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::timestampResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::timestampResponse>();
client_->sendRequest(address, 20001, 14,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
NULL, sync_cb);
return sync_cb;
}
void setattr(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::setattrRequest* request,
CallbackInterface<xtreemfs::pbrpc::timestampResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 15,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::timestampResponse>* setattr_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::setattrRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::timestampResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::timestampResponse>();
client_->sendRequest(address, 20001, 15,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
NULL, sync_cb);
return sync_cb;
}
void setxattr(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::setxattrRequest* request,
CallbackInterface<xtreemfs::pbrpc::timestampResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 16,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::timestampResponse>* setxattr_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::setxattrRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::timestampResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::timestampResponse>();
client_->sendRequest(address, 20001, 16,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
NULL, sync_cb);
return sync_cb;
}
void statvfs(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::statvfsRequest* request,
CallbackInterface<xtreemfs::pbrpc::StatVFS> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 17,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::StatVFS(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::StatVFS>* statvfs_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::statvfsRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::StatVFS>* sync_cb = new SyncCallback<xtreemfs::pbrpc::StatVFS>();
client_->sendRequest(address, 20001, 17,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::StatVFS(),
NULL, sync_cb);
return sync_cb;
}
void symlink(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::symlinkRequest* request,
CallbackInterface<xtreemfs::pbrpc::timestampResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 18,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::timestampResponse>* symlink_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::symlinkRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::timestampResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::timestampResponse>();
client_->sendRequest(address, 20001, 18,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
NULL, sync_cb);
return sync_cb;
}
void unlink(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::unlinkRequest* request,
CallbackInterface<xtreemfs::pbrpc::unlinkResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 19,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::unlinkResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::unlinkResponse>* unlink_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::unlinkRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::unlinkResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::unlinkResponse>();
client_->sendRequest(address, 20001, 19,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::unlinkResponse(),
NULL, sync_cb);
return sync_cb;
}
void access(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::accessRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 20,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* access_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::accessRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 20001, 20,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_checkpoint(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 20001, 30,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_checkpoint_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 20001, 30,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_check_file_exists(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_check_file_existsRequest* request,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_check_file_existsResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 31,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_check_file_existsResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_check_file_existsResponse>* xtreemfs_check_file_exists_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_check_file_existsRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::xtreemfs_check_file_existsResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_check_file_existsResponse>();
client_->sendRequest(address, 20001, 31,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_check_file_existsResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_dump_database(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_dump_restore_databaseRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 32,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_dump_database_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_dump_restore_databaseRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 20001, 32,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_get_suitable_osds(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_get_suitable_osdsRequest* request,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_get_suitable_osdsResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 33,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_get_suitable_osdsResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_get_suitable_osdsResponse>* xtreemfs_get_suitable_osds_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_get_suitable_osdsRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::xtreemfs_get_suitable_osdsResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_get_suitable_osdsResponse>();
client_->sendRequest(address, 20001, 33,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_get_suitable_osdsResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_internal_debug(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::stringMessage* request,
CallbackInterface<xtreemfs::pbrpc::stringMessage> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 34,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::stringMessage(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::stringMessage>* xtreemfs_internal_debug_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::stringMessage* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::stringMessage>* sync_cb = new SyncCallback<xtreemfs::pbrpc::stringMessage>();
client_->sendRequest(address, 20001, 34,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::stringMessage(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_listdir(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_listdirRequest* request,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_listdirResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 35,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_listdirResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_listdirResponse>* xtreemfs_listdir_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_listdirRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::xtreemfs_listdirResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_listdirResponse>();
client_->sendRequest(address, 20001, 35,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_listdirResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_lsvol(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::Volumes> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 20001, 36,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::Volumes(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::Volumes>* xtreemfs_lsvol_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::Volumes>* sync_cb = new SyncCallback<xtreemfs::pbrpc::Volumes>();
client_->sendRequest(address, 20001, 36,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::Volumes(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_mkvol(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::Volume* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 47,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_mkvol_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::Volume* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 20001, 47,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_renew_capability(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::XCap* request,
CallbackInterface<xtreemfs::pbrpc::XCap> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 37,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::XCap(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::XCap>* xtreemfs_renew_capability_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::XCap* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::XCap>* sync_cb = new SyncCallback<xtreemfs::pbrpc::XCap>();
client_->sendRequest(address, 20001, 37,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::XCap(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_replication_to_master(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 20001, 38,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_replication_to_master_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 20001, 38,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_replica_add(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_replica_addRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 39,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_replica_add_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_replica_addRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 20001, 39,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_replica_list(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_replica_listRequest* request,
CallbackInterface<xtreemfs::pbrpc::Replicas> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 40,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::Replicas(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::Replicas>* xtreemfs_replica_list_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_replica_listRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::Replicas>* sync_cb = new SyncCallback<xtreemfs::pbrpc::Replicas>();
client_->sendRequest(address, 20001, 40,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::Replicas(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_replica_remove(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_replica_removeRequest* request,
CallbackInterface<xtreemfs::pbrpc::FileCredentials> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 41,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::FileCredentials(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::FileCredentials>* xtreemfs_replica_remove_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_replica_removeRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::FileCredentials>* sync_cb = new SyncCallback<xtreemfs::pbrpc::FileCredentials>();
client_->sendRequest(address, 20001, 41,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::FileCredentials(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_restore_database(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_dump_restore_databaseRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 42,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_restore_database_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_dump_restore_databaseRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 20001, 42,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_restore_file(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_restore_fileRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 43,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_restore_file_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_restore_fileRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 20001, 43,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_rmvol(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_rmvolRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 44,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_rmvol_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_rmvolRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 20001, 44,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_shutdown(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 20001, 45,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_shutdown_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 20001, 45,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_update_file_size(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_update_file_sizeRequest* request,
CallbackInterface<xtreemfs::pbrpc::timestampResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 46,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::timestampResponse>* xtreemfs_update_file_size_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_update_file_sizeRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::timestampResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::timestampResponse>();
client_->sendRequest(address, 20001, 46,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::timestampResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_set_replica_update_policy(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_set_replica_update_policyRequest* request,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_set_replica_update_policyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 48,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_set_replica_update_policyResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_set_replica_update_policyResponse>* xtreemfs_set_replica_update_policy_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_set_replica_update_policyRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::xtreemfs_set_replica_update_policyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_set_replica_update_policyResponse>();
client_->sendRequest(address, 20001, 48,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_set_replica_update_policyResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_set_read_only_xattr(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_set_read_only_xattrRequest* request,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_set_read_only_xattrResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 49,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_set_read_only_xattrResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_set_read_only_xattrResponse>* xtreemfs_set_read_only_xattr_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_set_read_only_xattrRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::xtreemfs_set_read_only_xattrResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_set_read_only_xattrResponse>();
client_->sendRequest(address, 20001, 49,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_set_read_only_xattrResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_get_file_credentials(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_get_file_credentialsRequest* request,
CallbackInterface<xtreemfs::pbrpc::FileCredentials> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 50,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::FileCredentials(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::FileCredentials>* xtreemfs_get_file_credentials_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_get_file_credentialsRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::FileCredentials>* sync_cb = new SyncCallback<xtreemfs::pbrpc::FileCredentials>();
client_->sendRequest(address, 20001, 50,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::FileCredentials(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_get_xlocset(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_get_xlocsetRequest* request,
CallbackInterface<xtreemfs::pbrpc::XLocSet> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 20001, 51,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::XLocSet(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::XLocSet>* xtreemfs_get_xlocset_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_get_xlocsetRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::XLocSet>* sync_cb = new SyncCallback<xtreemfs::pbrpc::XLocSet>();
client_->sendRequest(address, 20001, 51,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::XLocSet(),
NULL, sync_cb);
return sync_cb;
}
private:
Client* client_;
};
}
}
#endif //MRCSERVICECLIENT_H

View File

@ -0,0 +1,57 @@
//automatically generated from MRC.proto at Thu Dec 11 16:09:40 CET 2014
//(c) 2014. See LICENSE file for details.
#ifndef MRCSERVICECONSTANTS_H_
#define MRCSERVICECONSTANTS_H_
#include <stdint.h>
namespace xtreemfs {
namespace pbrpc {
const uint32_t INTERFACE_ID_MRC = 20001;
const uint32_t PROC_ID_FSETATTR = 2;
const uint32_t PROC_ID_FTRUNCATE = 3;
const uint32_t PROC_ID_GETATTR = 4;
const uint32_t PROC_ID_GETXATTR = 5;
const uint32_t PROC_ID_LINK = 6;
const uint32_t PROC_ID_LISTXATTR = 7;
const uint32_t PROC_ID_MKDIR = 8;
const uint32_t PROC_ID_OPEN = 9;
const uint32_t PROC_ID_READDIR = 10;
const uint32_t PROC_ID_READLINK = 11;
const uint32_t PROC_ID_REMOVEXATTR = 12;
const uint32_t PROC_ID_RENAME = 13;
const uint32_t PROC_ID_RMDIR = 14;
const uint32_t PROC_ID_SETATTR = 15;
const uint32_t PROC_ID_SETXATTR = 16;
const uint32_t PROC_ID_STATVFS = 17;
const uint32_t PROC_ID_SYMLINK = 18;
const uint32_t PROC_ID_UNLINK = 19;
const uint32_t PROC_ID_ACCESS = 20;
const uint32_t PROC_ID_XTREEMFS_CHECKPOINT = 30;
const uint32_t PROC_ID_XTREEMFS_CHECK_FILE_EXISTS = 31;
const uint32_t PROC_ID_XTREEMFS_DUMP_DATABASE = 32;
const uint32_t PROC_ID_XTREEMFS_GET_SUITABLE_OSDS = 33;
const uint32_t PROC_ID_XTREEMFS_INTERNAL_DEBUG = 34;
const uint32_t PROC_ID_XTREEMFS_LISTDIR = 35;
const uint32_t PROC_ID_XTREEMFS_LSVOL = 36;
const uint32_t PROC_ID_XTREEMFS_MKVOL = 47;
const uint32_t PROC_ID_XTREEMFS_RENEW_CAPABILITY = 37;
const uint32_t PROC_ID_XTREEMFS_REPLICATION_TO_MASTER = 38;
const uint32_t PROC_ID_XTREEMFS_REPLICA_ADD = 39;
const uint32_t PROC_ID_XTREEMFS_REPLICA_LIST = 40;
const uint32_t PROC_ID_XTREEMFS_REPLICA_REMOVE = 41;
const uint32_t PROC_ID_XTREEMFS_RESTORE_DATABASE = 42;
const uint32_t PROC_ID_XTREEMFS_RESTORE_FILE = 43;
const uint32_t PROC_ID_XTREEMFS_RMVOL = 44;
const uint32_t PROC_ID_XTREEMFS_SHUTDOWN = 45;
const uint32_t PROC_ID_XTREEMFS_UPDATE_FILE_SIZE = 46;
const uint32_t PROC_ID_XTREEMFS_SET_REPLICA_UPDATE_POLICY = 48;
const uint32_t PROC_ID_XTREEMFS_SET_READ_ONLY_XATTR = 49;
const uint32_t PROC_ID_XTREEMFS_GET_FILE_CREDENTIALS = 50;
const uint32_t PROC_ID_XTREEMFS_GET_XLOCSET = 51;
} // namespace pbrpc
} // namespace xtreemfs
#endif // MRCSERVICECLIENT_H_

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,838 @@
//automatically generated from OSD.proto at Thu Dec 11 16:09:41 CET 2014
//(c) 2014. See LICENSE file for details.
#ifndef OSDSERVICECLIENT_H
#define OSDSERVICECLIENT_H
#include <stdint.h>
#include "pbrpc/RPC.pb.h"
#include "rpc/client.h"
#include "rpc/sync_callback.h"
#include "rpc/callback_interface.h"
#include "xtreemfs/OSD.pb.h"
#include "xtreemfs/MRC.pb.h"
#include "include/Common.pb.h"
#include "xtreemfs/GlobalTypes.pb.h"
#include "xtreemfs/DIR.pb.h"
namespace xtreemfs {
namespace pbrpc {
using ::xtreemfs::rpc::Client;
using ::xtreemfs::rpc::CallbackInterface;
using ::xtreemfs::rpc::SyncCallback;
class OSDServiceClient {
public:
OSDServiceClient(Client* client) : client_(client) {
}
virtual ~OSDServiceClient() {
}
void read(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::readRequest* request,
CallbackInterface<xtreemfs::pbrpc::ObjectData> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 10,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ObjectData(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::ObjectData>* read_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::readRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::ObjectData>* sync_cb = new SyncCallback<xtreemfs::pbrpc::ObjectData>();
client_->sendRequest(address, 30001, 10,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ObjectData(),
NULL, sync_cb);
return sync_cb;
}
void truncate(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::truncateRequest* request,
CallbackInterface<xtreemfs::pbrpc::OSDWriteResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 11,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::OSDWriteResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::OSDWriteResponse>* truncate_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::truncateRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::OSDWriteResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::OSDWriteResponse>();
client_->sendRequest(address, 30001, 11,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::OSDWriteResponse(),
NULL, sync_cb);
return sync_cb;
}
void unlink(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::unlink_osd_Request* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 12,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* unlink_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::unlink_osd_Request* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 12,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void write(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::writeRequest* request,const char* data, uint32_t data_length,
CallbackInterface<xtreemfs::pbrpc::OSDWriteResponse> *callback, void *context = NULL) {
client_->sendRequest(address, 30001, 13,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::OSDWriteResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::OSDWriteResponse>* write_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::writeRequest* request, const char* data, uint32_t data_length) {
SyncCallback<xtreemfs::pbrpc::OSDWriteResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::OSDWriteResponse>();
client_->sendRequest(address, 30001, 13,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::OSDWriteResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_broadcast_gmax(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_broadcast_gmaxRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 20,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_broadcast_gmax_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_broadcast_gmaxRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 20,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_check_object(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_check_objectRequest* request,
CallbackInterface<xtreemfs::pbrpc::ObjectData> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 21,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ObjectData(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::ObjectData>* xtreemfs_check_object_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_check_objectRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::ObjectData>* sync_cb = new SyncCallback<xtreemfs::pbrpc::ObjectData>();
client_->sendRequest(address, 30001, 21,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ObjectData(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_cleanup_get_results(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_cleanup_get_resultsResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 30001, 30,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_cleanup_get_resultsResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_cleanup_get_resultsResponse>* xtreemfs_cleanup_get_results_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::xtreemfs_cleanup_get_resultsResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_cleanup_get_resultsResponse>();
client_->sendRequest(address, 30001, 30,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_cleanup_get_resultsResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_cleanup_is_running(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_cleanup_is_runningResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 30001, 31,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_cleanup_is_runningResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_cleanup_is_runningResponse>* xtreemfs_cleanup_is_running_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::xtreemfs_cleanup_is_runningResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_cleanup_is_runningResponse>();
client_->sendRequest(address, 30001, 31,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_cleanup_is_runningResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_cleanup_start(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_cleanup_startRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 32,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_cleanup_start_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_cleanup_startRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 32,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_cleanup_status(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_cleanup_statusResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 30001, 33,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_cleanup_statusResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_cleanup_statusResponse>* xtreemfs_cleanup_status_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::xtreemfs_cleanup_statusResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_cleanup_statusResponse>();
client_->sendRequest(address, 30001, 33,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_cleanup_statusResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_cleanup_stop(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 30001, 34,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_cleanup_stop_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 34,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_cleanup_versions_start(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 30001, 35,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_cleanup_versions_start_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 35,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_repair_object(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_repair_objectRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 36,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_repair_object_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_repair_objectRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 36,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_rwr_fetch(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_rwr_fetchRequest* request,
CallbackInterface<xtreemfs::pbrpc::ObjectData> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 73,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ObjectData(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::ObjectData>* xtreemfs_rwr_fetch_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_rwr_fetchRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::ObjectData>* sync_cb = new SyncCallback<xtreemfs::pbrpc::ObjectData>();
client_->sendRequest(address, 30001, 73,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ObjectData(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_rwr_flease_msg(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_rwr_flease_msgRequest* request,const char* data, uint32_t data_length,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
client_->sendRequest(address, 30001, 71,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_rwr_flease_msg_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_rwr_flease_msgRequest* request, const char* data, uint32_t data_length) {
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 71,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_rwr_notify(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::FileCredentials* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 75,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_rwr_notify_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::FileCredentials* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 75,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_rwr_set_primary_epoch(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_rwr_set_primary_epochRequest* request,
CallbackInterface<xtreemfs::pbrpc::ObjectData> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 78,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ObjectData(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::ObjectData>* xtreemfs_rwr_set_primary_epoch_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_rwr_set_primary_epochRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::ObjectData>* sync_cb = new SyncCallback<xtreemfs::pbrpc::ObjectData>();
client_->sendRequest(address, 30001, 78,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ObjectData(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_rwr_status(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_rwr_statusRequest* request,
CallbackInterface<xtreemfs::pbrpc::ReplicaStatus> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 76,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ReplicaStatus(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::ReplicaStatus>* xtreemfs_rwr_status_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_rwr_statusRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::ReplicaStatus>* sync_cb = new SyncCallback<xtreemfs::pbrpc::ReplicaStatus>();
client_->sendRequest(address, 30001, 76,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ReplicaStatus(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_rwr_truncate(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_rwr_truncateRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 74,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_rwr_truncate_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_rwr_truncateRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 74,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_rwr_update(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_rwr_updateRequest* request,const char* data, uint32_t data_length,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
client_->sendRequest(address, 30001, 72,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_rwr_update_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_rwr_updateRequest* request, const char* data, uint32_t data_length) {
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 72,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_rwr_auth_state(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_rwr_auth_stateRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 79,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_rwr_auth_state_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_rwr_auth_stateRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 79,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_rwr_reset_complete(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_rwr_reset_completeRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 80,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_rwr_reset_complete_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_rwr_reset_completeRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 80,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_internal_get_gmax(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_internal_get_gmaxRequest* request,
CallbackInterface<xtreemfs::pbrpc::InternalGmax> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 40,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::InternalGmax(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::InternalGmax>* xtreemfs_internal_get_gmax_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_internal_get_gmaxRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::InternalGmax>* sync_cb = new SyncCallback<xtreemfs::pbrpc::InternalGmax>();
client_->sendRequest(address, 30001, 40,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::InternalGmax(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_internal_truncate(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::truncateRequest* request,
CallbackInterface<xtreemfs::pbrpc::OSDWriteResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 41,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::OSDWriteResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::OSDWriteResponse>* xtreemfs_internal_truncate_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::truncateRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::OSDWriteResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::OSDWriteResponse>();
client_->sendRequest(address, 30001, 41,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::OSDWriteResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_internal_get_file_size(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_internal_get_file_sizeRequest* request,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_internal_get_file_sizeResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 42,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_internal_get_file_sizeResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_internal_get_file_sizeResponse>* xtreemfs_internal_get_file_size_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_internal_get_file_sizeRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::xtreemfs_internal_get_file_sizeResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_internal_get_file_sizeResponse>();
client_->sendRequest(address, 30001, 42,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_internal_get_file_sizeResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_internal_read_local(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_internal_read_localRequest* request,
CallbackInterface<xtreemfs::pbrpc::InternalReadLocalResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 43,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::InternalReadLocalResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::InternalReadLocalResponse>* xtreemfs_internal_read_local_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_internal_read_localRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::InternalReadLocalResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::InternalReadLocalResponse>();
client_->sendRequest(address, 30001, 43,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::InternalReadLocalResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_internal_get_object_set(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_internal_get_object_setRequest* request,
CallbackInterface<xtreemfs::pbrpc::ObjectList> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 44,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ObjectList(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::ObjectList>* xtreemfs_internal_get_object_set_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_internal_get_object_setRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::ObjectList>* sync_cb = new SyncCallback<xtreemfs::pbrpc::ObjectList>();
client_->sendRequest(address, 30001, 44,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::ObjectList(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_internal_get_fileid_list(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_internal_get_fileid_listResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 30001, 45,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_internal_get_fileid_listResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_internal_get_fileid_listResponse>* xtreemfs_internal_get_fileid_list_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::xtreemfs_internal_get_fileid_listResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_internal_get_fileid_listResponse>();
client_->sendRequest(address, 30001, 45,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_internal_get_fileid_listResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_lock_acquire(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::lockRequest* request,
CallbackInterface<xtreemfs::pbrpc::Lock> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 50,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::Lock(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::Lock>* xtreemfs_lock_acquire_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::lockRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::Lock>* sync_cb = new SyncCallback<xtreemfs::pbrpc::Lock>();
client_->sendRequest(address, 30001, 50,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::Lock(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_lock_check(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::lockRequest* request,
CallbackInterface<xtreemfs::pbrpc::Lock> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 51,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::Lock(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::Lock>* xtreemfs_lock_check_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::lockRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::Lock>* sync_cb = new SyncCallback<xtreemfs::pbrpc::Lock>();
client_->sendRequest(address, 30001, 51,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::Lock(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_lock_release(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::lockRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 52,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_lock_release_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::lockRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 52,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_ping(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_pingMesssage* request,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_pingMesssage> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 60,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_pingMesssage(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_pingMesssage>* xtreemfs_ping_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_pingMesssage* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::xtreemfs_pingMesssage>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_pingMesssage>();
client_->sendRequest(address, 30001, 60,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_pingMesssage(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_shutdown(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
client_->sendRequest(address, 30001, 70,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_shutdown_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds) {
const char* data = NULL; uint32_t data_length = 0;
xtreemfs::pbrpc::emptyRequest* request = NULL;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 70,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_xloc_set_invalidate(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_xloc_set_invalidateRequest* request,
CallbackInterface<xtreemfs::pbrpc::xtreemfs_xloc_set_invalidateResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 81,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_xloc_set_invalidateResponse(),
context, callback);
}
SyncCallback<xtreemfs::pbrpc::xtreemfs_xloc_set_invalidateResponse>* xtreemfs_xloc_set_invalidate_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_xloc_set_invalidateRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::xtreemfs_xloc_set_invalidateResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::xtreemfs_xloc_set_invalidateResponse>();
client_->sendRequest(address, 30001, 81,
creds, auth, request, data, data_length, new xtreemfs::pbrpc::xtreemfs_xloc_set_invalidateResponse(),
NULL, sync_cb);
return sync_cb;
}
void xtreemfs_rwr_auth_state_invalidated(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds,
const xtreemfs::pbrpc::xtreemfs_rwr_auth_stateRequest* request,
CallbackInterface<xtreemfs::pbrpc::emptyResponse> *callback, void *context = NULL) {
const char* data = NULL; uint32_t data_length = 0;
client_->sendRequest(address, 30001, 82,
creds, auth, request, data, data_length, NULL,
context, callback);
}
SyncCallback<xtreemfs::pbrpc::emptyResponse>* xtreemfs_rwr_auth_state_invalidated_sync(const std::string &address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials &creds
, const xtreemfs::pbrpc::xtreemfs_rwr_auth_stateRequest* request) {
const char* data = NULL; uint32_t data_length = 0;
SyncCallback<xtreemfs::pbrpc::emptyResponse>* sync_cb = new SyncCallback<xtreemfs::pbrpc::emptyResponse>();
client_->sendRequest(address, 30001, 82,
creds, auth, request, data, data_length, NULL,
NULL, sync_cb);
return sync_cb;
}
private:
Client* client_;
};
}
}
#endif //OSDSERVICECLIENT_H

View File

@ -0,0 +1,51 @@
//automatically generated from OSD.proto at Thu Dec 11 16:09:41 CET 2014
//(c) 2014. See LICENSE file for details.
#ifndef OSDSERVICECONSTANTS_H_
#define OSDSERVICECONSTANTS_H_
#include <stdint.h>
namespace xtreemfs {
namespace pbrpc {
const uint32_t INTERFACE_ID_OSD = 30001;
const uint32_t PROC_ID_READ = 10;
const uint32_t PROC_ID_TRUNCATE = 11;
const uint32_t PROC_ID_UNLINK = 12;
const uint32_t PROC_ID_WRITE = 13;
const uint32_t PROC_ID_XTREEMFS_BROADCAST_GMAX = 20;
const uint32_t PROC_ID_XTREEMFS_CHECK_OBJECT = 21;
const uint32_t PROC_ID_XTREEMFS_CLEANUP_GET_RESULTS = 30;
const uint32_t PROC_ID_XTREEMFS_CLEANUP_IS_RUNNING = 31;
const uint32_t PROC_ID_XTREEMFS_CLEANUP_START = 32;
const uint32_t PROC_ID_XTREEMFS_CLEANUP_STATUS = 33;
const uint32_t PROC_ID_XTREEMFS_CLEANUP_STOP = 34;
const uint32_t PROC_ID_XTREEMFS_CLEANUP_VERSIONS_START = 35;
const uint32_t PROC_ID_XTREEMFS_REPAIR_OBJECT = 36;
const uint32_t PROC_ID_XTREEMFS_RWR_FETCH = 73;
const uint32_t PROC_ID_XTREEMFS_RWR_FLEASE_MSG = 71;
const uint32_t PROC_ID_XTREEMFS_RWR_NOTIFY = 75;
const uint32_t PROC_ID_XTREEMFS_RWR_SET_PRIMARY_EPOCH = 78;
const uint32_t PROC_ID_XTREEMFS_RWR_STATUS = 76;
const uint32_t PROC_ID_XTREEMFS_RWR_TRUNCATE = 74;
const uint32_t PROC_ID_XTREEMFS_RWR_UPDATE = 72;
const uint32_t PROC_ID_XTREEMFS_RWR_AUTH_STATE = 79;
const uint32_t PROC_ID_XTREEMFS_RWR_RESET_COMPLETE = 80;
const uint32_t PROC_ID_XTREEMFS_INTERNAL_GET_GMAX = 40;
const uint32_t PROC_ID_XTREEMFS_INTERNAL_TRUNCATE = 41;
const uint32_t PROC_ID_XTREEMFS_INTERNAL_GET_FILE_SIZE = 42;
const uint32_t PROC_ID_XTREEMFS_INTERNAL_READ_LOCAL = 43;
const uint32_t PROC_ID_XTREEMFS_INTERNAL_GET_OBJECT_SET = 44;
const uint32_t PROC_ID_XTREEMFS_INTERNAL_GET_FILEID_LIST = 45;
const uint32_t PROC_ID_XTREEMFS_LOCK_ACQUIRE = 50;
const uint32_t PROC_ID_XTREEMFS_LOCK_CHECK = 51;
const uint32_t PROC_ID_XTREEMFS_LOCK_RELEASE = 52;
const uint32_t PROC_ID_XTREEMFS_PING = 60;
const uint32_t PROC_ID_XTREEMFS_SHUTDOWN = 70;
const uint32_t PROC_ID_XTREEMFS_XLOC_SET_INVALIDATE = 81;
const uint32_t PROC_ID_XTREEMFS_RWR_AUTH_STATE_INVALIDATED = 82;
} // namespace pbrpc
} // namespace xtreemfs
#endif // OSDSERVICECLIENT_H_

View File

@ -0,0 +1,420 @@
//automatically generated at Thu Dec 11 16:09:40 CET 2014
//(c) 2014. See LICENSE file for details.
#include "xtreemfs/get_request_message.h"
#include "xtreemfs/OSD.pb.h"
#include "xtreemfs/MRC.pb.h"
#include "include/Common.pb.h"
#include "xtreemfs/GlobalTypes.pb.h"
#include "xtreemfs/DIR.pb.h"
namespace xtreemfs {
namespace pbrpc {
google::protobuf::Message* GetMessageForProcID(uint32_t interface_id,
uint32_t proc_id) {
switch (interface_id) {
// Generated from DIR.proto
case 10001: {
switch (proc_id) {
case 1: {
return new xtreemfs::pbrpc::addressMappingGetRequest();
break;
}
case 2: {
return new xtreemfs::pbrpc::addressMappingGetRequest();
break;
}
case 3: {
return new xtreemfs::pbrpc::AddressMappingSet();
break;
}
case 4: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 5: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 6: {
return new xtreemfs::pbrpc::serviceDeregisterRequest();
break;
}
case 7: {
return new xtreemfs::pbrpc::serviceGetByNameRequest();
break;
}
case 8: {
return new xtreemfs::pbrpc::serviceGetByTypeRequest();
break;
}
case 9: {
return new xtreemfs::pbrpc::serviceGetByUUIDRequest();
break;
}
case 10: {
return new xtreemfs::pbrpc::serviceGetByUUIDRequest();
break;
}
case 11: {
return new xtreemfs::pbrpc::serviceRegisterRequest();
break;
}
case 20: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 21: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 22: {
return new xtreemfs::pbrpc::configurationGetRequest();
break;
}
case 23: {
return new xtreemfs::pbrpc::Configuration();
break;
}
case 24: {
return new xtreemfs::pbrpc::VivaldiCoordinates();
break;
}
default: {
return NULL;
}
}
break;
}
// Generated from MRC.proto
case 20001: {
switch (proc_id) {
case 2: {
return new xtreemfs::pbrpc::fsetattrRequest();
break;
}
case 3: {
return new xtreemfs::pbrpc::XCap();
break;
}
case 4: {
return new xtreemfs::pbrpc::getattrRequest();
break;
}
case 5: {
return new xtreemfs::pbrpc::getxattrRequest();
break;
}
case 6: {
return new xtreemfs::pbrpc::linkRequest();
break;
}
case 7: {
return new xtreemfs::pbrpc::listxattrRequest();
break;
}
case 8: {
return new xtreemfs::pbrpc::mkdirRequest();
break;
}
case 9: {
return new xtreemfs::pbrpc::openRequest();
break;
}
case 10: {
return new xtreemfs::pbrpc::readdirRequest();
break;
}
case 11: {
return new xtreemfs::pbrpc::readlinkRequest();
break;
}
case 12: {
return new xtreemfs::pbrpc::removexattrRequest();
break;
}
case 13: {
return new xtreemfs::pbrpc::renameRequest();
break;
}
case 14: {
return new xtreemfs::pbrpc::rmdirRequest();
break;
}
case 15: {
return new xtreemfs::pbrpc::setattrRequest();
break;
}
case 16: {
return new xtreemfs::pbrpc::setxattrRequest();
break;
}
case 17: {
return new xtreemfs::pbrpc::statvfsRequest();
break;
}
case 18: {
return new xtreemfs::pbrpc::symlinkRequest();
break;
}
case 19: {
return new xtreemfs::pbrpc::unlinkRequest();
break;
}
case 20: {
return new xtreemfs::pbrpc::accessRequest();
break;
}
case 30: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 31: {
return new xtreemfs::pbrpc::xtreemfs_check_file_existsRequest();
break;
}
case 32: {
return new xtreemfs::pbrpc::xtreemfs_dump_restore_databaseRequest();
break;
}
case 33: {
return new xtreemfs::pbrpc::xtreemfs_get_suitable_osdsRequest();
break;
}
case 34: {
return new xtreemfs::pbrpc::stringMessage();
break;
}
case 35: {
return new xtreemfs::pbrpc::xtreemfs_listdirRequest();
break;
}
case 36: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 47: {
return new xtreemfs::pbrpc::Volume();
break;
}
case 37: {
return new xtreemfs::pbrpc::XCap();
break;
}
case 38: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 39: {
return new xtreemfs::pbrpc::xtreemfs_replica_addRequest();
break;
}
case 40: {
return new xtreemfs::pbrpc::xtreemfs_replica_listRequest();
break;
}
case 41: {
return new xtreemfs::pbrpc::xtreemfs_replica_removeRequest();
break;
}
case 42: {
return new xtreemfs::pbrpc::xtreemfs_dump_restore_databaseRequest();
break;
}
case 43: {
return new xtreemfs::pbrpc::xtreemfs_restore_fileRequest();
break;
}
case 44: {
return new xtreemfs::pbrpc::xtreemfs_rmvolRequest();
break;
}
case 45: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 46: {
return new xtreemfs::pbrpc::xtreemfs_update_file_sizeRequest();
break;
}
case 48: {
return new xtreemfs::pbrpc::xtreemfs_set_replica_update_policyRequest();
break;
}
case 49: {
return new xtreemfs::pbrpc::xtreemfs_set_read_only_xattrRequest();
break;
}
case 50: {
return new xtreemfs::pbrpc::xtreemfs_get_file_credentialsRequest();
break;
}
case 51: {
return new xtreemfs::pbrpc::xtreemfs_get_xlocsetRequest();
break;
}
default: {
return NULL;
}
}
break;
}
// Generated from OSD.proto
case 30001: {
switch (proc_id) {
case 10: {
return new xtreemfs::pbrpc::readRequest();
break;
}
case 11: {
return new xtreemfs::pbrpc::truncateRequest();
break;
}
case 12: {
return new xtreemfs::pbrpc::unlink_osd_Request();
break;
}
case 13: {
return new xtreemfs::pbrpc::writeRequest();
break;
}
case 20: {
return new xtreemfs::pbrpc::xtreemfs_broadcast_gmaxRequest();
break;
}
case 21: {
return new xtreemfs::pbrpc::xtreemfs_check_objectRequest();
break;
}
case 30: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 31: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 32: {
return new xtreemfs::pbrpc::xtreemfs_cleanup_startRequest();
break;
}
case 33: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 34: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 35: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 36: {
return new xtreemfs::pbrpc::xtreemfs_repair_objectRequest();
break;
}
case 73: {
return new xtreemfs::pbrpc::xtreemfs_rwr_fetchRequest();
break;
}
case 71: {
return new xtreemfs::pbrpc::xtreemfs_rwr_flease_msgRequest();
break;
}
case 75: {
return new xtreemfs::pbrpc::FileCredentials();
break;
}
case 78: {
return new xtreemfs::pbrpc::xtreemfs_rwr_set_primary_epochRequest();
break;
}
case 76: {
return new xtreemfs::pbrpc::xtreemfs_rwr_statusRequest();
break;
}
case 74: {
return new xtreemfs::pbrpc::xtreemfs_rwr_truncateRequest();
break;
}
case 72: {
return new xtreemfs::pbrpc::xtreemfs_rwr_updateRequest();
break;
}
case 79: {
return new xtreemfs::pbrpc::xtreemfs_rwr_auth_stateRequest();
break;
}
case 80: {
return new xtreemfs::pbrpc::xtreemfs_rwr_reset_completeRequest();
break;
}
case 40: {
return new xtreemfs::pbrpc::xtreemfs_internal_get_gmaxRequest();
break;
}
case 41: {
return new xtreemfs::pbrpc::truncateRequest();
break;
}
case 42: {
return new xtreemfs::pbrpc::xtreemfs_internal_get_file_sizeRequest();
break;
}
case 43: {
return new xtreemfs::pbrpc::xtreemfs_internal_read_localRequest();
break;
}
case 44: {
return new xtreemfs::pbrpc::xtreemfs_internal_get_object_setRequest();
break;
}
case 45: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 50: {
return new xtreemfs::pbrpc::lockRequest();
break;
}
case 51: {
return new xtreemfs::pbrpc::lockRequest();
break;
}
case 52: {
return new xtreemfs::pbrpc::lockRequest();
break;
}
case 60: {
return new xtreemfs::pbrpc::xtreemfs_pingMesssage();
break;
}
case 70: {
return new xtreemfs::pbrpc::emptyRequest();
break;
}
case 81: {
return new xtreemfs::pbrpc::xtreemfs_xloc_set_invalidateRequest();
break;
}
case 82: {
return new xtreemfs::pbrpc::xtreemfs_rwr_auth_stateRequest();
break;
}
default: {
return NULL;
}
}
break;
}
default: {
return NULL;
}
}
}
} // namespace pbrpc
} // namespace xtreemfs

View File

@ -0,0 +1,24 @@
//automatically generated at Thu Dec 11 16:09:40 CET 2014
//(c) 2014. See LICENSE file for details.
#ifndef CPP_GENERATED_XTREEMFS_GET_REQUEST_MESSAGE_H_
#define CPP_GENERATED_XTREEMFS_GET_REQUEST_MESSAGE_H_
#include <stdint.h>
namespace google {
namespace protobuf {
class Message;
} // namespace protobuf
} // namespace google
namespace xtreemfs {
namespace pbrpc {
google::protobuf::Message* GetMessageForProcID(uint32_t interface_id,
uint32_t proc_id);
} // namespace pbrpc
} // namespace xtreemfs
#endif // CPP_GENERATED_XTREEMFS_GET_REQUEST_MESSAGE_H_

View File

@ -0,0 +1,274 @@
/*
* Copyright (c) 2012 by Michael Berlin, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef CPP_INCLUDE_CBFS_CBFS_ADAPTER_H_
#define CPP_INCLUDE_CBFS_CBFS_ADAPTER_H_
#define WIN32_LEAN_AND_MEAN
#include <windows.h> // required for CbFS.h
#include <boost/cstdint.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/thread/condition.hpp>
#include <boost/thread/mutex.hpp>
#include <CbFS.h>
#include "xtfsutil/xtfsutil_server.h"
#include "xtreemfs/GlobalTypes.pb.h"
namespace xtreemfs {
namespace pbrpc {
class Stat;
} // namespace pbrpc
class CbFSOptions;
class Client;
class SystemUserMapping;
class CbFSAdapter {
public:
/** Replace "\" path separator by "/" and convert UTF-16 to UTF-8. */
static std::string WindowsPathToUTF8Unix(const wchar_t* from);
static void DebugPrintCreateFile(
LPCWSTR OperationType,
LPCTSTR FileName,
ACCESS_MASK DesiredAccess,
DWORD FileAttributes,
DWORD ShareMode,
PVOID FileHandleContext);
/** Creates a new instance of CbFSAdapter, but does not create any
* libxtreemfs Client yet.
*
* Use Start() to actually create the client and mount the volume given in
* options. May modify options.
*/
explicit CbFSAdapter(CbFSOptions* options);
~CbFSAdapter();
/** Create client, open volume and start needed threads. */
void Start();
/** Shutdown threads, close Volume and Client and blocks until all threads
* are stopped. */
void Stop();
/** Same as Stop(), but does not call cbfs_.UnmountMedia(). */
void StopWithoutUnmount();
void GetVolumeSize(CallbackFileSystem* Sender,
__int64* TotalNumberOfSectors,
__int64* NumberOfFreeSectors);
void GetVolumeLabel(CallbackFileSystem* Sender, LPTSTR VolumeLabel);
void GetVolumeId(CallbackFileSystem* Sender, PDWORD VolumeID);
void CreateFile(CallbackFileSystem* Sender,
LPCTSTR FileName,
ACCESS_MASK DesiredAccess,
DWORD FileAttributes,
DWORD ShareMode,
PVOID* FileHandleContext);
void OpenFile(CallbackFileSystem* Sender,
LPCTSTR FileName,
ACCESS_MASK DesiredAccess,
DWORD ShareMode,
PVOID* FileHandleContext);
void CloseFile(CallbackFileSystem* Sender,
CbFsFileInfo* FileInfo,
PVOID FileHandleContext);
void GetFileInfo(CallbackFileSystem* Sender,
LPCTSTR FileName,
LPBOOL FileExists,
PFILETIME CreationTime,
PFILETIME LastAccessTime,
PFILETIME LastWriteTime,
__int64* EndOfFile,
__int64* AllocationSize,
__int64* FileId,
PDWORD FileAttributes,
LPTSTR LongFileName OPTIONAL,
PWORD LongFileNameLength OPTIONAL);
void EnumerateDirectory(CallbackFileSystem* Sender,
CbFsFileInfo* DirectoryInfo,
PVOID* EnumerationContext,
LPCTSTR Mask,
INT Index,
BOOL Restart,
LPBOOL FileFound,
LPTSTR FileName,
PDWORD FileNameLength,
LPTSTR ShortFileName OPTIONAL,
PUCHAR ShortFileNameLength OPTIONAL,
PFILETIME CreationTime,
PFILETIME LastAccessTime,
PFILETIME LastWriteTime,
__int64* EndOfFile,
__int64* AllocationSize,
__int64* FileId,
PDWORD FileAttributes);
void CloseEnumeration(CallbackFileSystem* Sender,
CbFsFileInfo* DirectoryInfo,
PVOID EnumerationContext);
void SetAllocationSize(CallbackFileSystem* Sender,
CbFsFileInfo* FileInfo,
PVOID FileHandleContext,
__int64 AllocationSize);
void SetEndOfFile(CallbackFileSystem* Sender,
CbFsFileInfo* FileInfo,
PVOID FileHandleContext,
__int64 EndOfFile);
void SetFileAttributes(CallbackFileSystem* Sender,
CbFsFileInfo* FileInfo,
PVOID FileHandleContext,
PFILETIME CreationTime,
PFILETIME LastAccessTime,
PFILETIME LastWriteTime,
DWORD FileAttributes);
void CanFileBeDeleted(CallbackFileSystem* Sender,
CbFsFileInfo* FileInfo,
BOOL* CanBeDeleted);
void DeleteFile(CallbackFileSystem* Sender, CbFsFileInfo* FileInfo);
void RenameOrMoveFile(CallbackFileSystem* Sender,
CbFsFileInfo* FileInfo,
LPCTSTR NewFileName);
void ReadFile(CallbackFileSystem* Sender,
CbFsFileInfo* FileInfo,
PVOID FileHandleContext,
__int64 Position,
PVOID Buffer,
DWORD BytesToRead,
PDWORD BytesRead);
void WriteFile(CallbackFileSystem* Sender,
CbFsFileInfo* FileInfo,
PVOID FileHandleContext,
__int64 Position,
PVOID Buffer,
DWORD BytesToWrite,
PDWORD BytesWritten);
void IsDirectoryEmpty(CallbackFileSystem* Sender,
LPWSTR FileName,
LPBOOL IsEmpty);
void StorageEjected(CallbackFileSystem* Sender);
/** Blocks until device was ejected by user. */
void WaitForEjection();
private:
static const DWORD kMaxFileNameLength = 32767;
static const size_t kMaxVolumeLabelLength = 32;
/** Print debug output to stdout. */
static void DbgPrint(LPCWSTR format, ...);
/** Output exception thrown by CBFS as string. */
static std::string ECBFSErrorToString(ECBFSError& e);
/** Maps XtreemFS return values to Windows specific ones. */
static int ConvertXtreemFSErrnoToWindows(
xtreemfs::pbrpc::POSIXErrno xtreemfs_errno);
/** Convert UNIX timestamp (in nanoseconds) to Windows time format. */
static void XtreemFSTimeToWinTime(uint64_t utime_ns,
DWORD* lower,
DWORD* upper);
/** Convert Windows timestamp to UNIX timestamp (in nanoseconds). */
static boost::uint64_t ConvertWinTimeToXtreemFSTime(DWORD lower,
DWORD upper);
/** Returns true if "stat" is a directory. */
static bool IsDirectory(const xtreemfs::pbrpc::Stat& stat);
/** Convert "desired_access", passed at Create and Open, to e.g., O_RDWR. */
static xtreemfs::pbrpc::SYSTEM_V_FCNTL ConvertFlagsWindowsToXtreemFS(
const ACCESS_MASK desired_access);
/** Provides the CBFS library the required license key. */
void SetRegistrationKey();
/** Returns true if "path" is a directory.
* @throws AddressToUUIDNotFoundException
* @throws IOException
* @throws PosixErrorException
* @throws UnknownAddressSchemeException
*/
bool IsDirectory(const std::string& path);
/** Same as GetFileInfo(), except that "path" is an UTF8 encoded UNIX path. */
void ConvertXtreemFSStatToCbFS(const xtreemfs::pbrpc::Stat& stat,
PFILETIME CreationTime,
PFILETIME LastAccessTime,
PFILETIME LastWriteTime,
__int64* EndOfFile,
__int64* AllocationSize,
__int64* FileId,
PDWORD FileAttributes,
LPTSTR LongFileName OPTIONAL,
PWORD LongFileNameLength OPTIONAL);
/** Contains all needed options to mount the requested volume. */
CbFSOptions* options_;
/** Volume Label generated from the given XtreemFS URL. */
std::wstring volume_label_;
/** The chosen UserMapping provides methods to translate between local and
* remote usernames and groups. */
boost::scoped_ptr<SystemUserMapping> system_user_mapping_;
/** Username and domain name of user executing the Dokan client. Will be used
* by all XtreemFS operations. */
xtreemfs::pbrpc::UserCredentials user_credentials_;
/** Created libxtreemfs Client. */
boost::scoped_ptr<Client> client_;
/** Opened libxtreemfs Volume. */
Volume* volume_;
/** Server for processing commands sent from the xtfsutil tool
via xctl files. */
XtfsUtilServer xctl_;
/** Callback Filesystem instance which provides a Windows user space
* file system interface. */
CallbackFileSystem cbfs_;
/** True if device was ejected by user. */
bool device_ejected_;
/** Guards device_ejected_. */
boost::mutex device_ejected_mutex_;
/** Used when waiting for a change of device_ejected_. */
boost::condition device_ejected_cond_;
};
} // namespace xtreemfs
#endif // CPP_INCLUDE_CBFS_CBFS_ADAPTER_H_

View File

@ -0,0 +1,39 @@
/*
* Copyright (c) 2012 by Michael Berlin, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef CPP_INCLUDE_CBFS_CBFS_ENUMERATION_CONTEXT_H_
#define CPP_INCLUDE_CBFS_CBFS_ENUMERATION_CONTEXT_H_
#include <boost/cstdint.hpp>
namespace xtreemfs {
namespace pbrpc {
class DirectoryEntries;
} // namespace pbrpc
struct CbFSEnumerationContext {
CbFSEnumerationContext();
~CbFSEnumerationContext();
/** Index in the complete directory listing where dir_entries starts. */
boost::uint64_t offset;
xtreemfs::pbrpc::DirectoryEntries* dir_entries;
/** Index of next entry which will be returned from dir_entries (starting from
* 0).
*
* @attention This is relative to dir_entries, not to the complete dir.
*/
int next_index;
};
} // namespace xtreemfs
#endif // CPP_INCLUDE_CBFS_CBFS_ENUMERATION_CONTEXT_H_

View File

@ -0,0 +1,51 @@
/*
* Copyright (c) 2012 by Michael Berlin, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef CPP_INCLUDE_CBFS_CBFS_OPTIONS_H_
#define CPP_INCLUDE_CBFS_CBFS_OPTIONS_H_
#include "libxtreemfs/options.h"
#include <boost/program_options.hpp>
#include <string>
#include <vector>
namespace xtreemfs {
class CbFSOptions : public Options {
public:
/** Sets the default values. */
CbFSOptions();
/** Set options parsed from command line which must contain at least the URL
* to a XtreemFS volume and a mount point.
*
* Calls Options::ParseCommandLine() to parse general options.
*
* @throws InvalidCommandLineParametersException
* @throws InvalidURLException */
void ParseCommandLine(int argc, char** argv);
/** Shows only the minimal help text describing the usage of mount.xtreemfs.*/
std::string ShowCommandLineUsage();
/** Outputs usage of the command line parameters. */
virtual std::string ShowCommandLineHelp();
// CbFS options.
private:
/** Contains all available CbFS options and its descriptions. */
boost::program_options::options_description cbfs_descriptions_;
/** Brief help text if there are no command line arguments. */
std::string helptext_usage_;
};
} // namespace xtreemfs
#endif // CPP_INCLUDE_CBFS_CBFS_OPTIONS_H_

View File

@ -0,0 +1,31 @@
/*
* Copyright (c) 2011 by Michael Berlin, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef CPP_INCLUDE_FUSE_CACHED_DIRECTORY_ENTRIES_H_
#define CPP_INCLUDE_FUSE_CACHED_DIRECTORY_ENTRIES_H_
#include <stdint.h>
#include <boost/thread/mutex.hpp>
namespace xtreemfs {
namespace pbrpc {
class DirectoryEntries;
} // namespace pbrpc
struct CachedDirectoryEntries {
uint64_t offset;
xtreemfs::pbrpc::DirectoryEntries* dir_entries;
boost::mutex mutex;
};
} // namespace xtreemfs
#endif // CPP_INCLUDE_FUSE_CACHED_DIRECTORY_ENTRIES_H_

View File

@ -0,0 +1,160 @@
/*
* Copyright (c) 2011 by Michael Berlin, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef CPP_INCLUDE_FUSE_FUSE_ADAPTER_H_
#define CPP_INCLUDE_FUSE_FUSE_ADAPTER_H_
#include <sys/types.h>
#define FUSE_USE_VERSION 26
#include <fuse.h>
#include <boost/scoped_ptr.hpp>
#include <list>
#include <string>
#include "libxtreemfs/system_user_mapping_unix.h"
#include "xtfsutil/xtfsutil_server.h"
#include "xtreemfs/GlobalTypes.pb.h"
namespace xtreemfs {
class Client;
class FuseOptions;
class UserMapping;
class Volume;
namespace pbrpc {
class Stat;
class UserCredentials;
} // namespace pbrpc
/** Uses fuse_interrupted() to check if an operation was cancelled by the user
* and stops retrying to execute the request then.
*
* Always returns 0, if called from a non-Fuse thread. */
int CheckIfOperationInterrupted();
class FuseAdapter {
public:
/** Creates a new instance of FuseAdapter, but does not create any libxtreemfs
* Client yet.
*
* Use Start() to actually create the client and mount the volume given in
* options. May modify options.
*/
explicit FuseAdapter(FuseOptions* options);
~FuseAdapter();
/** Create client, open volume and start needed threads.
* @return Returns a list of additional "-o<option>" Fuse options which may be
* generated after processing the "options" parameter and have to be
* considered before starting Fuse.
* @remark Ownership of the list elements is transferred to the caller. */
void Start(std::list<char*>* required_fuse_options);
/** Shutdown threads, close Volume and Client and blocks until all threads are
* stopped. */
void Stop();
/** After successfully executing fuse_new, tell libxtreemfs to use
* fuse_interrupted() if a request was cancelled by the user. */
void SetInterruptQueryFunction() const;
void GenerateUserCredentials(
uid_t uid,
gid_t gid,
pid_t pid,
xtreemfs::pbrpc::UserCredentials* user_credentials);
/** Generate UserCredentials using information from fuse context or the
* current process (in that case set fuse_context to NULL). */
void GenerateUserCredentials(
struct fuse_context* fuse_context,
xtreemfs::pbrpc::UserCredentials* user_credentials);
/** Fill a Fuse stat object with information from an XtreemFS stat. */
void ConvertXtreemFSStatToFuse(const xtreemfs::pbrpc::Stat& xtreemfs_stat,
struct stat* fuse_stat);
/** Converts given UNIX file handle flags into XtreemFS symbols. */
xtreemfs::pbrpc::SYSTEM_V_FCNTL ConvertFlagsUnixToXtreemFS(int flags);
/** Converts from XtreemFS error codes to the system ones. */
int ConvertXtreemFSErrnoToFuse(xtreemfs::pbrpc::POSIXErrno xtreemfs_errno);
// Fuse operations as called by placeholder functions in fuse_operations.h. */
int statfs(const char *path, struct statvfs *statv);
int getattr(const char *path, struct stat *statbuf);
int getxattr(const char *path, const char *name, char *value, size_t size);
/** Creates CachedDirectoryEntries struct and let fi->fh point to it. */
int opendir(const char *path, struct fuse_file_info *fi);
/** Uses the Fuse readdir offset approach to handle readdir requests in chunks
* instead of one large request. */
int readdir(const char *path, void *buf, fuse_fill_dir_t filler, off_t offset,
struct fuse_file_info *fi);
/** Deletes CachedDirectoryEntries struct which is hold by fi->fh. */
int releasedir(const char *path, struct fuse_file_info *fi);
int utime(const char *path, struct utimbuf *ubuf);
int utimens(const char *path, const struct timespec tv[2]);
int create(const char *path, mode_t mode, struct fuse_file_info *fi);
int mknod(const char *path, mode_t mode, dev_t device);
int mkdir(const char *path, mode_t mode);
int open(const char *path, struct fuse_file_info *fi);
int truncate(const char *path, off_t newsize);
int ftruncate(const char *path, off_t offset, struct fuse_file_info *fi);
int write(const char *path, const char *buf, size_t size, off_t offset,
struct fuse_file_info *fi);
int flush(const char *path, struct fuse_file_info *fi);
int read(const char *path, char *buf, size_t size, off_t offset,
struct fuse_file_info *fi);
int access(const char *path, int mask);
int unlink(const char *path);
int fgetattr(const char *path, struct stat *statbuf,
struct fuse_file_info *fi);
int release(const char *path, struct fuse_file_info *fi);
int readlink(const char *path, char *buf, size_t size);
int rmdir(const char *path);
int symlink(const char *path, const char *link);
int rename(const char *path, const char *newpath);
int link(const char *path, const char *newpath);
int chmod(const char *path, mode_t mode);
int chown(const char *path, uid_t uid, gid_t gid);
int setxattr(const char *path, const char *name, const char *value,
size_t size, int flags);
int listxattr(const char *path, char *list, size_t size);
int removexattr(const char *path, const char *name);
int lock(const char* path, struct fuse_file_info *fi, int cmd,
struct flock* flock);
private:
/** Contains all needed options to mount the requested volume. */
FuseOptions* options_;
/** Translates between local and remote usernames and groups. */
SystemUserMappingUnix system_user_mapping_;
/** Created libxtreemfs Client. */
boost::scoped_ptr<Client> client_;
/** Opened libxtreemfs Volume. */
Volume* volume_;
/** Server for processing commands sent from the xtfsutil tool
via xctl files. */
XtfsUtilServer xctl_;
};
} // namespace xtreemfs
#endif // CPP_INCLUDE_FUSE_FUSE_ADAPTER_H_

View File

@ -0,0 +1,106 @@
/*
* Copyright (c) 2011 by Michael Berlin, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef CPP_INCLUDE_FUSE_FUSE_OPERATIONS_H_
#define CPP_INCLUDE_FUSE_FUSE_OPERATIONS_H_
#include <sys/types.h>
#define FUSE_USE_VERSION 26
#include <fuse.h>
namespace xtreemfs {
class FuseAdapter;
}
/** Contains functions which are passed into fuse_operations struct.
* @file
*
* The functions in this file are merely placeholders which call the actual
* functions of the FuseAdapter instance pointed to by fuse_adapter.
*/
/** Points to the FuseAdapter instance created by mount.xtreemfs.cpp. */
extern xtreemfs::FuseAdapter* fuse_adapter;
extern "C" int xtreemfs_fuse_getattr(const char *path, struct stat *statbuf);
extern "C" int xtreemfs_fuse_readlink(const char *path, char *link,
size_t size);
extern "C" int xtreemfs_fuse_mknod(const char *path, mode_t mode, dev_t dev);
extern "C" int xtreemfs_fuse_mkdir(const char *path, mode_t mode);
extern "C" int xtreemfs_fuse_unlink(const char *path);
extern "C" int xtreemfs_fuse_rmdir(const char *path);
extern "C" int xtreemfs_fuse_symlink(const char *path, const char *link);
extern "C" int xtreemfs_fuse_rename(const char *path, const char *newpath);
extern "C" int xtreemfs_fuse_link(const char *path, const char *newpath);
extern "C" int xtreemfs_fuse_chmod(const char *path, mode_t mode);
extern "C" int xtreemfs_fuse_chown(const char *path, uid_t uid, gid_t gid);
extern "C" int xtreemfs_fuse_truncate(const char *path, off_t new_file_size);
extern "C" int xtreemfs_fuse_utime(const char *path, struct utimbuf *ubuf);
extern "C" int xtreemfs_fuse_lock(const char *, struct fuse_file_info *,
int cmd, struct flock *);
extern "C" int xtreemfs_fuse_utimens(const char *path,
const struct timespec tv[2]);
extern "C" int xtreemfs_fuse_open(const char *path, struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_read(const char *path, char *buf, size_t size,
off_t offset, struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_write(
const char *path,
const char *buf,
size_t size,
off_t offset,
struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_statfs(const char *path, struct statvfs *statv);
extern "C" int xtreemfs_fuse_flush(const char *path, struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_release(const char *path,
struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_fsync(const char *path, int datasync,
struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_setxattr(
const char *path,
const char *name,
const char *value,
size_t size,
int flags
#ifdef __APPLE__
, uint32_t position
#endif
);
extern "C" int xtreemfs_fuse_getxattr(const char *path, const char *name,
char *value, size_t size
#ifdef __APPLE__
, uint32_t position
#endif
);
extern "C" int xtreemfs_fuse_listxattr(const char *path, char *list,
size_t size);
extern "C" int xtreemfs_fuse_removexattr(const char *path, const char *name);
extern "C" int xtreemfs_fuse_opendir(const char *path,
struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_readdir(
const char *path,
void *buf,
fuse_fill_dir_t filler,
off_t offset,
struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_releasedir(const char *path,
struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_fsyncdir(const char *path, int datasync,
struct fuse_file_info *fi);
extern "C" void *xtreemfs_fuse_init(struct fuse_conn_info *conn);
extern "C" void xtreemfs_fuse_destroy(void *userdata);
extern "C" int xtreemfs_fuse_access(const char *path, int mask);
extern "C" int xtreemfs_fuse_create(const char *path, mode_t mode,
struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_ftruncate(const char *path, off_t new_file_size,
struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_fgetattr(const char *path, struct stat *statbuf,
struct fuse_file_info *fi);
extern "C" int xtreemfs_fuse_lock(const char* path, struct fuse_file_info *fi,
int cmd, struct flock* flock_);
#endif // CPP_INCLUDE_FUSE_FUSE_OPERATIONS_H_

View File

@ -0,0 +1,70 @@
/*
* Copyright (c) 2011 by Michael Berlin, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef CPP_INCLUDE_FUSE_FUSE_OPTIONS_H_
#define CPP_INCLUDE_FUSE_FUSE_OPTIONS_H_
#include "libxtreemfs/options.h"
#include <boost/program_options.hpp>
#include <string>
#include <vector>
namespace xtreemfs {
class FuseOptions : public Options {
public:
/** Sets the default values. */
FuseOptions();
/** Set options parsed from command line which must contain at least the URL
* to a XtreemFS volume and a mount point.
*
* Calls Options::ParseCommandLine() to parse general options.
*
* @throws InvalidCommandLineParametersException
* @throws InvalidURLException */
void ParseCommandLine(int argc, char** argv);
/** Shows only the minimal help text describing the usage of mount.xtreemfs.*/
std::string ShowCommandLineUsage();
/** Outputs usage of the command line parameters. */
virtual std::string ShowCommandLineHelp();
// Fuse options.
/** Execute extended attributes operations? */
bool enable_xattrs;
/** If -o default_permissions is passed to Fuse, there are no extra permission
* checks needed. */
bool use_fuse_permission_checks;
/** If requested by the user, do not pass -o default_permissions to Fuse. */
bool fuse_permission_checks_explicitly_disabled;
/** Run the adapter program in foreground or send it to background? */
bool foreground;
/** Fuse options specified by -o. */
std::vector<std::string> fuse_options;
#ifdef __APPLE__
/** Assumed (or if specified the set) timeout of a blocked operation after
* which MacFuse will on a) Tiger show a dialog if the user will still wait
* for the operation or b) >=Leopard just kill our Fuse implementation and
* call fuse_destroy.
*/
int daemon_timeout;
#endif // __APPLE__
private:
/** Contains all available Fuse options and its descriptions. */
boost::program_options::options_description fuse_descriptions_;
/** Brief help text if there are no command line arguments. */
std::string helptext_usage_;
};
} // namespace xtreemfs
#endif // CPP_INCLUDE_FUSE_FUSE_OPTIONS_H_

View File

@ -0,0 +1,249 @@
/// Json-cpp amalgated forward header (http://jsoncpp.sourceforge.net/).
/// It is intented to be used with #include <json/json-forwards.h>
/// This header provides forward declaration for all JsonCpp types.
// //////////////////////////////////////////////////////////////////////
// Beginning of content of file: LICENSE
// //////////////////////////////////////////////////////////////////////
/*
The JsonCpp library's source code, including accompanying documentation,
tests and demonstration applications, are licensed under the following
conditions...
The author (Baptiste Lepilleur) explicitly disclaims copyright in all
jurisdictions which recognize such a disclaimer. In such jurisdictions,
this software is released into the Public Domain.
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
released under the terms of the MIT License (see below).
In jurisdictions which recognize Public Domain property, the user of this
software may choose to accept it either as 1) Public Domain, 2) under the
conditions of the MIT License (see below), or 3) under the terms of dual
Public Domain/MIT License conditions described here, as they choose.
The MIT License is about as close to Public Domain as a license can get, and is
described in clear, concise terms at:
http://en.wikipedia.org/wiki/MIT_License
The full text of the MIT License follows:
========================================================================
Copyright (c) 2007-2010 Baptiste Lepilleur
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
(END LICENSE TEXT)
The MIT license is compatible with both the GPL and commercial
software, affording one all of the rights of Public Domain with the
minor nuisance of being required to keep the above copyright notice
and license text in the source code. Note also that by accepting the
Public Domain "license" you can re-license your copy using whatever
license you like.
*/
// //////////////////////////////////////////////////////////////////////
// End of content of file: LICENSE
// //////////////////////////////////////////////////////////////////////
#ifndef JSON_FORWARD_AMALGATED_H_INCLUDED
# define JSON_FORWARD_AMALGATED_H_INCLUDED
/// If defined, indicates that the source file is amalgated
/// to prevent private header inclusion.
#define JSON_IS_AMALGATED
// //////////////////////////////////////////////////////////////////////
// Beginning of content of file: include/json/config.h
// //////////////////////////////////////////////////////////////////////
// Copyright 2007-2010 Baptiste Lepilleur
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
#ifndef JSON_CONFIG_H_INCLUDED
# define JSON_CONFIG_H_INCLUDED
/// If defined, indicates that json library is embedded in CppTL library.
//# define JSON_IN_CPPTL 1
/// If defined, indicates that json may leverage CppTL library
//# define JSON_USE_CPPTL 1
/// If defined, indicates that cpptl vector based map should be used instead of std::map
/// as Value container.
//# define JSON_USE_CPPTL_SMALLMAP 1
/// If defined, indicates that Json specific container should be used
/// (hash table & simple deque container with customizable allocator).
/// THIS FEATURE IS STILL EXPERIMENTAL! There is know bugs: See #3177332
//# define JSON_VALUE_USE_INTERNAL_MAP 1
/// Force usage of standard new/malloc based allocator instead of memory pool based allocator.
/// The memory pools allocator used optimization (initializing Value and ValueInternalLink
/// as if it was a POD) that may cause some validation tool to report errors.
/// Only has effects if JSON_VALUE_USE_INTERNAL_MAP is defined.
//# define JSON_USE_SIMPLE_INTERNAL_ALLOCATOR 1
/// If defined, indicates that Json use exception to report invalid type manipulation
/// instead of C assert macro.
# define JSON_USE_EXCEPTION 1
/// If defined, indicates that the source file is amalgated
/// to prevent private header inclusion.
/// Remarks: it is automatically defined in the generated amalgated header.
// #define JSON_IS_AMALGAMATION
# ifdef JSON_IN_CPPTL
# include <cpptl/config.h>
# ifndef JSON_USE_CPPTL
# define JSON_USE_CPPTL 1
# endif
# endif
# ifdef JSON_IN_CPPTL
# define JSON_API CPPTL_API
# elif defined(JSON_DLL_BUILD)
# define JSON_API __declspec(dllexport)
# elif defined(JSON_DLL)
# define JSON_API __declspec(dllimport)
# else
# define JSON_API
# endif
// If JSON_NO_INT64 is defined, then Json only support C++ "int" type for integer
// Storages, and 64 bits integer support is disabled.
// #define JSON_NO_INT64 1
#if defined(_MSC_VER) && _MSC_VER <= 1200 // MSVC 6
// Microsoft Visual Studio 6 only support conversion from __int64 to double
// (no conversion from unsigned __int64).
#define JSON_USE_INT64_DOUBLE_CONVERSION 1
#endif // if defined(_MSC_VER) && _MSC_VER < 1200 // MSVC 6
#if defined(_MSC_VER) && _MSC_VER >= 1500 // MSVC 2008
/// Indicates that the following function is deprecated.
# define JSONCPP_DEPRECATED(message) __declspec(deprecated(message))
#endif
#if !defined(JSONCPP_DEPRECATED)
# define JSONCPP_DEPRECATED(message)
#endif // if !defined(JSONCPP_DEPRECATED)
namespace Json {
typedef int Int;
typedef unsigned int UInt;
# if defined(JSON_NO_INT64)
typedef int LargestInt;
typedef unsigned int LargestUInt;
# undef JSON_HAS_INT64
# else // if defined(JSON_NO_INT64)
// For Microsoft Visual use specific types as long long is not supported
# if defined(_MSC_VER) // Microsoft Visual Studio
typedef __int64 Int64;
typedef unsigned __int64 UInt64;
# else // if defined(_MSC_VER) // Other platforms, use long long
typedef long long int Int64;
typedef unsigned long long int UInt64;
# endif // if defined(_MSC_VER)
typedef Int64 LargestInt;
typedef UInt64 LargestUInt;
# define JSON_HAS_INT64
# endif // if defined(JSON_NO_INT64)
} // end namespace Json
#endif // JSON_CONFIG_H_INCLUDED
// //////////////////////////////////////////////////////////////////////
// End of content of file: include/json/config.h
// //////////////////////////////////////////////////////////////////////
// //////////////////////////////////////////////////////////////////////
// Beginning of content of file: include/json/forwards.h
// //////////////////////////////////////////////////////////////////////
// Copyright 2007-2010 Baptiste Lepilleur
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
#ifndef JSON_FORWARDS_H_INCLUDED
# define JSON_FORWARDS_H_INCLUDED
#if !defined(JSON_IS_AMALGAMATION)
//# include "config.h"
#endif // if !defined(JSON_IS_AMALGAMATION)
namespace Json {
// writer.h
class FastWriter;
class StyledWriter;
// reader.h
class Reader;
// features.h
class Features;
// value.h
typedef unsigned int ArrayIndex;
class StaticString;
class Path;
class PathArgument;
class Value;
class ValueIteratorBase;
class ValueIterator;
class ValueConstIterator;
#ifdef JSON_VALUE_USE_INTERNAL_MAP
class ValueMapAllocator;
class ValueInternalLink;
class ValueInternalArray;
class ValueInternalMap;
#endif // #ifdef JSON_VALUE_USE_INTERNAL_MAP
} // namespace Json
#endif // JSON_FORWARDS_H_INCLUDED
// //////////////////////////////////////////////////////////////////////
// End of content of file: include/json/forwards.h
// //////////////////////////////////////////////////////////////////////
#endif //ifndef JSON_FORWARD_AMALGATED_H_INCLUDED

1856
cpp/include/json/json.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,47 @@
/*
* Copyright (c) 2014 by Matthias Noack, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef PRELOAD_ENVIRONMENT_H_
#define PRELOAD_ENVIRONMENT_H_
#include <string>
#include <stdint.h>
#include <sys/types.h>
#include "libxtreemfs/system_user_mapping_unix.h"
#include "libxtreemfs/volume_implementation.h"
#include "ld_preload/open_file_table.h"
#include "ld_preload/path.h"
#include "ld_preload/preload_options.h"
namespace xtreemfs {
class Client;
class VolumeHandle;
}
class Environment {
public:
Environment();
~Environment();
//xtreemfs::Volume* GetVolume(const std::string& volume_name);
xtreemfs::Volume* GetVolume();
xtreemfs::SystemUserMappingUnix& GetSystemUserMapping();
xtreemfs::PreloadOptions options_;
xtreemfs::Client* client_;
xtreemfs::Volume* volume_;
std::string volume_name_;
/** Translates between local and remote usernames and groups. */
xtreemfs::SystemUserMappingUnix system_user_mapping_;
xtreemfs::pbrpc::UserCredentials user_creds_;
OpenFileTable open_file_table_;
};
#endif // PRELOAD_ENVIRONMENT_H_

View File

@ -0,0 +1,58 @@
/*
* Copyright (c) 2014 by Matthias Noack, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef PRELOAD_MISC_H_
#define PRELOAD_MISC_H_
#include <string>
#include <stdint.h>
#include <sys/types.h>
#include "libxtreemfs/pbrpc_url.h"
#include "xtreemfs/GlobalTypes.pb.h"
#include "ld_preload/environment.h"
#include "ld_preload/passthrough.h"
xtreemfs::pbrpc::SYSTEM_V_FCNTL ConvertFlagsUnixToXtreemFS(int flags);
int TranslateMode(const char* mode);
int ConvertXtreemFSErrnoToUnix(xtreemfs::pbrpc::POSIXErrno xtreemfs_errno);
template<class T>
void ConvertXtreemFSStatToUnix(const xtreemfs::pbrpc::Stat& xtreemfs_stat, T* unix_stat, xtreemfs::SystemUserMappingUnix& system_user_mapping) {
unix_stat->st_dev = xtreemfs_stat.dev();
unix_stat->st_blksize = 8 * 128 * 1024;
unix_stat->st_ino = xtreemfs_stat.ino(); // = fileId
unix_stat->st_mode = xtreemfs_stat.mode();
unix_stat->st_nlink = xtreemfs_stat.nlink();
// Map user- and groupnames.
unix_stat->st_uid = system_user_mapping.UsernameToUID(xtreemfs_stat.user_id());
unix_stat->st_gid = system_user_mapping.GroupnameToGID(xtreemfs_stat.group_id());
unix_stat->st_size = xtreemfs_stat.size();
#ifdef __linux
unix_stat->st_atim.tv_sec = xtreemfs_stat.atime_ns() / 1000000000;
unix_stat->st_atim.tv_nsec = xtreemfs_stat.atime_ns() % 1000000000;
unix_stat->st_mtim.tv_sec = xtreemfs_stat.mtime_ns() / 1000000000;
unix_stat->st_mtim.tv_nsec = xtreemfs_stat.mtime_ns() % 1000000000;
unix_stat->st_ctim.tv_sec = xtreemfs_stat.ctime_ns() / 1000000000;
unix_stat->st_ctim.tv_nsec = xtreemfs_stat.ctime_ns() % 1000000000;
#elif __APPLE__
unix_stat->st_atimespec.tv_sec = xtreemfs_stat.atime_ns() / 1000000000;
unix_stat->st_atimespec.tv_nsec = xtreemfs_stat.atime_ns() % 1000000000;
unix_stat->st_mtimespec.tv_sec = xtreemfs_stat.mtime_ns() / 1000000000;
unix_stat->st_mtimespec.tv_nsec = xtreemfs_stat.mtime_ns() % 1000000000;
unix_stat->st_ctimespec.tv_sec = xtreemfs_stat.ctime_ns() / 1000000000;
unix_stat->st_ctimespec.tv_nsec = xtreemfs_stat.ctime_ns() % 1000000000;
#endif
unix_stat->st_rdev = 0;
unix_stat->st_blocks = xtreemfs_stat.size() / 512;
}
#endif // PRELOAD_MISC_H_

View File

@ -0,0 +1,61 @@
/*
* Copyright (c) 2014 by Matthias Noack, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef PRELOAD_OPEN_FILE_TABLE_H_
#define PRELOAD_OPEN_FILE_TABLE_H_
#include <map>
#include <pthread.h>
#include <cstdio>
#include <stdint.h>
#include <boost/thread/mutex.hpp>
#include "libxtreemfs/file_handle.h"
namespace xtreemfs {
class Client;
class VolumeHandle;
}
class OpenFile {
public:
OpenFile(xtreemfs::FileHandle* fh);
void Initialise();
void Deinitialise();
int GetFileDescriptor();
xtreemfs::FileHandle* fh_;
uint64_t offset_;
private:
FILE * tmp_file_;
int tmp_file_fd_;
};
class OpenFileTable {
public:
OpenFileTable();
~OpenFileTable();
int Register(xtreemfs::FileHandle* handle);
void Unregister(int fd);
OpenFile Get(int fd);
int Set(int fd, xtreemfs::FileHandle* handle);
void SetOffset(int fd, uint64_t offset);
bool Has(int fd);
private:
boost::mutex mutex_;
typedef std::map<int, OpenFile> FileTable;
FileTable open_files_;// GUARDED_BY(mutex_);
FILE * tmp_file_;
int tmp_file_fd_;
int next_fd_;
};
#endif // PRELOAD_OPEN_FILE_TABLE_H_

View File

@ -0,0 +1,79 @@
/*
* Copyright (c) 2014 by Matthias Noack, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef PRELOAD_PASSTHROUGH_H_
#define PRELOAD_PASSTHROUGH_H_
#include <stdio.h>
#include <unistd.h>
typedef int (*funcptr_open)(const char*, int, int);
typedef int (*funcptr_close)(int);
typedef ssize_t (*funcptr_read)(int, void*, size_t);
typedef ssize_t (*funcptr_write)(int, const void*, size_t);
typedef ssize_t (*funcptr_pread)(int, void*, size_t, off_t);
typedef ssize_t (*funcptr_pwrite)(int, const void*, size_t, off_t);
typedef int (*funcptr_dup)(int);
typedef int (*funcptr_dup2)(int, int);
typedef off_t (*funcptr_lseek)(int, off_t, int);
typedef int (*funcptr_stat)(const char*, struct stat*);
typedef int (*funcptr_fstat)(int, struct stat*);
typedef int (*funcptr___xstat)(int, const char*, struct stat*);
typedef int (*funcptr___xstat64)(int, const char*, struct stat64*);
typedef int (*funcptr___fxstat)(int, int, struct stat*);
typedef int (*funcptr___fxstat64)(int, int, struct stat64*);
typedef int (*funcptr___lxstat)(int, const char*, struct stat*);
typedef int (*funcptr___lxstat64)(int, const char*, struct stat64*);
typedef FILE* (*funcptr_fopen)(const char*, const char*);
typedef int (*funcptr_truncate)(const char*, off_t);
typedef int (*funcptr_ftruncate)(int, off_t);
typedef int (*funcptr_setxattr)(const char*, const char*, const void*, size_t, int);
typedef int (*funcptr_fsetxattr)(int, const char*, const void*, size_t, int);
extern void* libc_open;
extern void* libc_close;
extern void* libc___close;
extern void* libc_pread;
extern void* libc_read;
extern void* libc_write;
extern void* libc_dup;
extern void* libc_dup2;
extern void* libc_lseek;
extern void* libc_stat;
extern void* libc_fstat;
extern void* libc___xstat;
extern void* libc___xstat64;
extern void* libc___fxstat;
extern void* libc___fxstat64;
extern void* libc___lxstat;
extern void* libc___lxstat64;
extern void* libc_fopen;
extern void* libc_truncate;
extern void* libc_ftruncate;
extern void* libattr_setxattr;
extern void* libattr_fsetxattr;
void initialize_passthrough_if_necessary();
#ifdef XTREEMFS_PRELOAD_QUIET
#define xprintf(...)
#else
#define xprintf(...) fprintf(xtreemfs_stdout() ? xtreemfs_stdout() : stdout, __VA_ARGS__)
#endif
FILE* xtreemfs_stdout();
#endif // PRELOAD_PASSTHROUGH_H_

View File

@ -0,0 +1,29 @@
/*
* Copyright (c) 2014 by Matthias Noack, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef PRELOAD_PATH_H_
#define PRELOAD_PATH_H_
#include <string>
class Path {
public:
Path(const char* pathname);
bool IsXtreemFS();
void Parse();
const char* GetXtreemFSPath();
static void SetXtreemFSPrefix(const std::string& prefix);
private:
static std::string& GetXtreemFSPrefix();
const char* pathname_;
const char* xtreemfs_path_;
};
#endif // PRELOAD_PATH_H_

View File

@ -0,0 +1,39 @@
/*
* Copyright (c) 2014 by Matthias Noack, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef PRELOAD_PRELOAD_H_
#define PRELOAD_PRELOAD_H_
#include <stdint.h>
#include <sys/types.h>
#include "ld_preload/environment.h"
bool overlay_initialized(bool toggle = false);
Environment* get_env();
bool is_xtreemfs_fd(int fd);
bool is_xtreemfs_path(const char *path);
int xtreemfs_open(const char* pathname, int flags, int mode);
int xtreemfs_close(int fd);
uint64_t xtreemfs_pread(int fd, void* buf, uint64_t nbyte, uint64_t offset);
uint64_t xtreemfs_read(int fd, void* buf, uint64_t nbyte);
uint64_t xtreemfs_write(int fd, const void* buf, uint64_t nbyte);
int xtreemfs_dup2(int oldfd, int newfd);
int xtreemfs_dup(int fd);
off_t xtreemfs_lseek(int fd, off_t offset, int mode);
int xtreemfs_stat(const char *path, struct stat *buf);
int xtreemfs_stat64(const char *pathname, struct stat64 *buf);
int xtreemfs_fstat(int fd, struct stat *buf);
int xtreemfs_fstat64(int fd, struct stat64 *buf);
int xtreemfs_setxattr(const char *pathname, const char *name, const void *value, size_t size, int flags);
int xtreemfs_fsetxattr(int fd, const char *name, const void *value, size_t size, int flags);
#endif // PRELOAD_PRELOAD_H_

View File

@ -0,0 +1,45 @@
/*
* Copyright (c) 2014 by Matthias Noack, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef CPP_INCLUDE_LD_PRELOAD_PRELOAD_OPTIONS_H_
#define CPP_INCLUDE_LD_PRELOAD_PRELOAD_OPTIONS_H_
#include "libxtreemfs/options.h"
#include <boost/program_options.hpp>
#include <string>
#include <vector>
namespace xtreemfs {
class PreloadOptions : public Options {
public:
/** Sets the default values. */
PreloadOptions();
/** Set options parsed from command line which must contain at least the URL
* to an XtreemFS volume.
*
* Calls Options::ParseCommandLine() to parse general options.
*
* @throws InvalidCommandLineParametersException
* @throws InvalidURLException */
void ParseCommandLine(int argc, char** argv);
/** Outputs usage of the command line parameters. */
virtual std::string ShowCommandLineHelp();
// TODO: add preload-specific options here
private:
/** Contains all available preload options and its descriptions. */
boost::program_options::options_description preload_descriptions_;
};
} // namespace xtreemfs
#endif // CPP_INCLUDE_LD_PRELOAD_PRELOAD_OPTIONS_H_

View File

@ -0,0 +1,90 @@
/*
* Copyright (c) 2011 by Michael Berlin, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef CPP_INCLUDE_LIBXTREEMFS_ASYNC_WRITE_BUFFER_H_
#define CPP_INCLUDE_LIBXTREEMFS_ASYNC_WRITE_BUFFER_H_
#include <boost/date_time/posix_time/posix_time_types.hpp>
#include <string>
namespace xtreemfs {
namespace pbrpc {
class writeRequest;
} // namespace pbrpc
class FileHandleImplementation;
class XCapHandler;
struct AsyncWriteBuffer {
/** Possible states of this object. */
enum State {
PENDING,
FAILED,
SUCCEEDED
};
/**
* @remark Ownership of write_request is transferred to this object.
*/
AsyncWriteBuffer(xtreemfs::pbrpc::writeRequest* write_request,
const char* data,
size_t data_length,
FileHandleImplementation* file_handle,
XCapHandler* xcap_handler);
/**
* @remark Ownership of write_request is transferred to this object.
*/
AsyncWriteBuffer(xtreemfs::pbrpc::writeRequest* write_request,
const char* data,
size_t data_length,
FileHandleImplementation* file_handle,
XCapHandler* xcap_handler,
const std::string& osd_uuid);
~AsyncWriteBuffer();
/** Additional information of the write request. */
xtreemfs::pbrpc::writeRequest* write_request;
/** Actual payload of the write request. */
char* data;
/** Length of the payload. */
size_t data_length;
/** FileHandle which did receive the Write() command. */
FileHandleImplementation* file_handle;
/** XCapHandler, used to update the XCap in case of retries. */
XCapHandler* xcap_handler_;
/** Set to false if the member "osd_uuid" is used instead of the FileInfo's
* osd_uuid_iterator in order to determine the OSD to be used. */
bool use_uuid_iterator;
/** UUID of the OSD which was used for the last retry or if use_uuid_iterator
* is false, this variable is initialized to the OSD to be used. */
std::string osd_uuid;
/** Resolved UUID */
std::string service_address;
/** Current state of the object. */
State state_;
/** Retry count.*/
int retry_count_;
/** Time when the request was sent */
boost::posix_time::ptime request_sent_time;
};
} // namespace xtreemfs
#endif // CPP_INCLUDE_LIBXTREEMFS_ASYNC_WRITE_BUFFER_H_

View File

@ -0,0 +1,300 @@
/*
* Copyright (c) 2011 by Michael Berlin, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef CPP_INCLUDE_LIBXTREEMFS_ASYNC_WRITE_HANDLER_H_
#define CPP_INCLUDE_LIBXTREEMFS_ASYNC_WRITE_HANDLER_H_
#include <boost/thread/condition.hpp>
#include <boost/thread/mutex.hpp>
#include <list>
#include "libxtreemfs/execute_sync_request.h"
#include "libxtreemfs/options.h"
#include "rpc/callback_interface.h"
#include "util/synchronized_queue.h"
namespace xtreemfs {
struct AsyncWriteBuffer;
class FileInfo;
class UUIDResolver;
class UUIDIterator;
namespace pbrpc {
class OSDServiceClient;
class OSDWriteResponse;
} // namespace pbrpc
class AsyncWriteHandler
: public xtreemfs::rpc::CallbackInterface<
xtreemfs::pbrpc::OSDWriteResponse> {
public:
struct CallbackEntry {
/**
* @remark Ownerships of response_message, data and error are transferred.
*/
CallbackEntry(AsyncWriteHandler* handler,
xtreemfs::pbrpc::OSDWriteResponse* response_message,
char* data,
uint32_t data_length,
xtreemfs::pbrpc::RPCHeader::ErrorResponse* error,
void* context)
: handler_(handler),
response_message_(response_message),
data_(data),
data_length_(data_length),
error_(error),
context_(context) {}
AsyncWriteHandler* handler_;
xtreemfs::pbrpc::OSDWriteResponse* response_message_;
char* data_;
uint32_t data_length_;
xtreemfs::pbrpc::RPCHeader::ErrorResponse* error_;
void* context_;
};
AsyncWriteHandler(
FileInfo* file_info,
UUIDIterator* uuid_iterator,
UUIDResolver* uuid_resolver,
xtreemfs::pbrpc::OSDServiceClient* osd_service_client,
const xtreemfs::pbrpc::Auth& auth_bogus,
const xtreemfs::pbrpc::UserCredentials& user_credentials_bogus,
const Options& volume_options,
util::SynchronizedQueue<CallbackEntry>& callback_queue_);
~AsyncWriteHandler();
/** Adds write_buffer to the list of pending writes and sends it to the OSD
* specified by write_buffer->uuid_iterator (or write_buffer->osd_uuid if
* write_buffer->use_uuid_iterator is false).
*
* Blocks if the number of pending bytes exceeds the maximum write-ahead
* or WaitForPendingWrites{NonBlocking}() was called beforehand.
*/
void Write(AsyncWriteBuffer* write_buffer);
/** Blocks until state changes back to IDLE and prevents allowing new writes.
* by blocking further Write() calls. */
void WaitForPendingWrites();
/** If waiting for pending writes would block, it returns true and adds
* the parameters to the list waiting_observers_ and calls notify_one()
* on condition_variable once state_ changed back to IDLE. */
bool WaitForPendingWritesNonBlocking(boost::condition* condition_variable,
bool* wait_completed,
boost::mutex* wait_completed_mutex);
/** This static method runs in its own thread and does the real callback
* handling to avoid load and blocking on the RPC thread. */
static void ProcessCallbacks(util::SynchronizedQueue<CallbackEntry>& callback_queue);
private:
/** Possible states of this object. */
enum State {
IDLE,
WRITES_PENDING,
HAS_FAILED_WRITES,
FINALLY_FAILED
};
/** Contains information about observer who has to be notified once all
* currently pending writes have finished. */
struct WaitForCompletionObserver {
WaitForCompletionObserver(boost::condition* condition_variable,
bool* wait_completed,
boost::mutex* wait_completed_mutex)
: condition_variable(condition_variable),
wait_completed(wait_completed),
wait_completed_mutex(wait_completed_mutex) {
assert(condition_variable && wait_completed && wait_completed_mutex);
}
boost::condition* condition_variable;
bool* wait_completed;
boost::mutex* wait_completed_mutex;
};
/** Implements callback for an async write request. This method just enqueues
* data. The actual handling of the callback is done by another thread via
* HandleCallback(). */
virtual void CallFinished(xtreemfs::pbrpc::OSDWriteResponse* response_message,
char* data,
uint32_t data_length,
xtreemfs::pbrpc::RPCHeader::ErrorResponse* error,
void* context);
/** Implements callback handling for an async write request. This method is
* called for all queued callbacks in a separate thread.*/
void HandleCallback(xtreemfs::pbrpc::OSDWriteResponse* response_message,
char* data,
uint32_t data_length,
xtreemfs::pbrpc::RPCHeader::ErrorResponse* error,
void* context);
/** Helper function which adds "write_buffer" to the list writes_in_flight_,
* increases the number of pending bytes and takes care of state changes.
*
* @remark Ownership is not transferred to the caller.
* @remark Requires a lock on mutex_.
*/
void IncreasePendingBytesHelper(AsyncWriteBuffer* write_buffer,
boost::mutex::scoped_lock* lock);
/** Helper function reduces the number of pending bytes and takes care
* of state changes.
* Depending on "delete_buffer" the buffer is deleted or not (which implies
* DeleteBufferHelper must be called later).
*
* @remark Ownership of "write_buffer" is transferred to the caller.
* @remark Requires a lock on mutex_.
*/
void DecreasePendingBytesHelper(AsyncWriteBuffer* write_buffer,
boost::mutex::scoped_lock* lock,
bool delete_buffer);
/** Helper function which removes all leading elements which were flagged
* as successfully sent from writes_in_flight_ and deletes them.
*
* @remark Requires a lock on mutex_.
*/
void DeleteBufferHelper(boost::mutex::scoped_lock* lock);
/** Helper to enter the FINALLY_FAILED state in a thread-safe way. CleanUp
* is done automatically when the last expected Callback arrives.
*/
void FailFinallyHelper();
/** This helper method is used to clean up after the AsyncWriteHandler
* reaches the finally failed state. So all write buffers are deleted,
* and waiting threads are notified.
*/
void CleanUp(boost::mutex::scoped_lock* lock);
/** This method is used to repeat failed writes which already are in the list
* of writes in flight. It bypasses the writeahead limitations.
*/
void ReWrite(AsyncWriteBuffer* write_buffer,
boost::mutex::scoped_lock* lock);
/** Common code, used by Write and ReWrite.
* Pay attention to the locking semantics:
* In case of a write (is_rewrite == false), WriteCommon() expects to be
* called from an unlocked context. In case of a rewrite, the opposite
* applies.
*/
void WriteCommon(AsyncWriteBuffer* write_buffer,
boost::mutex::scoped_lock* lock,
bool is_rewrite);
/** Calls notify_one() on all observers in waiting_observers_, frees each
* element in the list and clears the list afterwards.
*
* @remark Requires a lock on mutex_.
*/
void NotifyWaitingObserversAndClearAll(boost::mutex::scoped_lock* lock);
/** Use this when modifying the object. */
boost::mutex mutex_;
/** State of this object. */
State state_;
/** List of pending writes. */
std::list<AsyncWriteBuffer*> writes_in_flight_;
/** Number of pending bytes. */
int pending_bytes_;
/** Number of pending write requests
* NOTE: this does not equal writes_in_flight_.size(), since it also contains
* successfully sent entries which must be kept for consistent retries in
* case of failure. */
int pending_writes_;
/** Set by WaitForPendingWrites{NonBlocking}() to true if there are
* temporarily no new async writes allowed and will be set to false again
* once the state IDLE is reached. */
bool writing_paused_;
/** Used to notify blocked WaitForPendingWrites() callers for the state change
* back to IDLE. */
boost::condition all_pending_writes_did_complete_;
/** Number of threads blocked by WaitForPendingWrites() waiting on
* all_pending_writes_did_complete_ for a state change back to IDLE.
*
* This does not include the number of waiting threads which did call
* WaitForPendingWritesNonBlocking(). Therefore, see "waiting_observers_".
* The total number of all waiting threads is:
* waiting_blocking_threads_count_ + waiting_observers_.size()
*/
int waiting_blocking_threads_count_;
/** Used to notify blocked Write() callers that the number of pending bytes
* has decreased. */
boost::condition pending_bytes_were_decreased_;
/** List of WaitForPendingWritesNonBlocking() observers (specified by their
* boost::condition variable and their bool value which will be set to true
* if the state changed back to IDLE). */
std::list<WaitForCompletionObserver*> waiting_observers_;
/** FileInfo object to which this AsyncWriteHandler does belong. Accessed for
* file size updates. */
FileInfo* file_info_;
/** Pointer to the UUIDIterator of the FileInfo object. */
UUIDIterator* uuid_iterator_;
/** Required for resolving UUIDs to addresses. */
UUIDResolver* uuid_resolver_;
/** Options (Max retries, ...) used when resolving UUIDs. */
RPCOptions uuid_resolver_options_;
/** Client which is used to send out the writes. */
xtreemfs::pbrpc::OSDServiceClient* osd_service_client_;
/** Auth needed for ServiceClients. Always set to AUTH_NONE by Volume. */
const xtreemfs::pbrpc::Auth& auth_bogus_;
/** For same reason needed as auth_bogus_. Always set to user "xtreemfs". */
const xtreemfs::pbrpc::UserCredentials& user_credentials_bogus_;
const Options& volume_options_;
/** Maximum number in bytes which may be pending. */
const int max_writeahead_;
/** Maximum number of pending write requests. */
const int max_requests_;
/** Maximum number of attempts a write will be tried. */
const int max_write_tries_;
/** True after the first redirct, set back to false on error resolution */
bool redirected_;
/** Set to true in when redirected is set true for the first time. The retries
* wont be delayed if true. */
bool fast_redirect_;
/** A copy of the worst error which was detected. It determines the error
* handling. */
xtreemfs::pbrpc::RPCHeader::ErrorResponse worst_error_;
/** The write buffer to whom the worst_error_ belongs. */
AsyncWriteBuffer* worst_write_buffer_;
/** Used by CallFinished (enqueue) */
util::SynchronizedQueue<CallbackEntry>& callback_queue_;
};
} // namespace xtreemfs
#endif // CPP_INCLUDE_LIBXTREEMFS_ASYNC_WRITE_HANDLER_H_

View File

@ -0,0 +1,192 @@
/*
* Copyright (c) 2011 by Michael Berlin, Zuse Institute Berlin
*
* Licensed under the BSD License, see LICENSE file for details.
*
*/
#ifndef CPP_INCLUDE_LIBXTREEMFS_CLIENT_H_
#define CPP_INCLUDE_LIBXTREEMFS_CLIENT_H_
#include <list>
#include <string>
#include "libxtreemfs/typedefs.h"
#include "pbrpc/RPC.pb.h"
#include "xtreemfs/MRC.pb.h"
namespace xtreemfs {
class UUIDIterator;
namespace rpc {
class SSLOptions;
} // namespace rpc
class Options;
class UUIDResolver;
class Volume;
/**
* Provides methods to open, close, create, delete and list volumes and to
* instantiate a new client object, to start and shutdown a Client object.
*/
class Client {
public:
/** Available client implementations which are allowed by CreateClient(). */
enum ClientImplementationType {
kDefaultClient
};
/** Returns an instance of the default Client implementation.
* @param dir_service_addresses List of DIR replicas
* @param user_credentials Name and Groups of the user.
* @param ssl_options NULL if no SSL is used.
* @param options Has to contain loglevel string and logfile path.
*/
static Client* CreateClient(
const ServiceAddresses& dir_service_addresses,
const xtreemfs::pbrpc::UserCredentials& user_credentials,
const xtreemfs::rpc::SSLOptions* ssl_options,
const Options& options);
/** Returns an instance of the chosen Client implementation. */
static Client* CreateClient(
const ServiceAddresses& dir_service_addresses,
const xtreemfs::pbrpc::UserCredentials& user_credentials,
const xtreemfs::rpc::SSLOptions* ssl_options,
const Options& options,
ClientImplementationType type);
virtual ~Client() {}
/** Initialize a client.
*
* @remark Make sure initialize_logger was called before. */
virtual void Start() = 0;
/** A shutdown of a client will close all open volumes and block until all
* threads have exited.
*
* @throws OpenFileHandlesLeftException
*/
virtual void Shutdown() = 0;
/** Open a volume and use the returned class to access it.
* @remark Ownership is NOT transferred to the caller. Instead
* Volume->Close() has to be called to destroy the object.
*
* @throws AddressToUUIDNotFoundException
* @throws UnknownAddressSchemeException
* @throws VolumeNotFoundException
*/
virtual xtreemfs::Volume* OpenVolume(
const std::string& volume_name,
const xtreemfs::rpc::SSLOptions* ssl_options,
const Options& options) = 0;
// TODO(mberlin): Also provide a method which accepts a list of MRC addresses.
/** Creates a volume on the MRC at mrc_address using certain default values (
* POSIX access policy type, striping size = 128k and width = 1 (i.e. no
* striping), mode = 777 and owner username and groupname retrieved from the
* user_credentials.
*
* @param mrc_address One or several addresses of the form "hostname:port".
* @param auth Authentication data, e.g. of type AUTH_PASSWORD.
* @param user_credentials Username and groups of the user who executes
* CreateVolume(). Not checked so far?
* @param volume_name Name of the new volume.
*
* @throws IOException
* @throws PosixErrorException
*/
void CreateVolume(
const ServiceAddresses& mrc_address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials& user_credentials,
const std::string& volume_name);
// TODO(mberlin): Also provide a method which accepts a list of MRC addresses.
/** Creates a volume on the MRC at mrc_address.
*
* @param mrc_address String of the form "hostname:port".
* @param auth Authentication data, e.g. of type AUTH_PASSWORD.
* @param user_credentials Username and groups of the user who executes
* CreateVolume().
* @param volume_name Name of the new volume.
* @param mode Mode of the volume's root directory (in octal
* representation (e.g. 511), not decimal (777)).
* @param owner_username Name of the owner user.
* @param owner_groupname Name of the owner group.
* @param access_policy_type Access policy type (Null, Posix, Volume, ...).
* @param default_striping_policy_type Only RAID0 so far.
* @param default_stripe_size Size of an object on the OSD (in kBytes).
* @param default_stripe_width Number of OSDs objects of a file are striped
* across.
* @param volume_attributes Reference to a list of key-value pairs of volume
* attributes which will bet set at creation time
* of the volume.
*
* @throws IOException
* @throws PosixErrorException
*/
virtual void CreateVolume(
const ServiceAddresses& mrc_address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials& user_credentials,
const std::string& volume_name,
int mode,
const std::string& owner_username,
const std::string& owner_groupname,
const xtreemfs::pbrpc::AccessControlPolicyType& access_policy_type,
long quota,
const xtreemfs::pbrpc::StripingPolicyType& default_striping_policy_type,
int default_stripe_size,
int default_stripe_width,
const std::list<xtreemfs::pbrpc::KeyValuePair*>& volume_attributes) = 0;
// TODO(mberlin): Also provide a method which accepts a list of MRC addresses.
/** Deletes the volume "volume_name" at the MRC "mrc_address".
*
* @param mrc_address String of the form "hostname:port".
* @param auth Authentication data, e.g. of type AUTH_PASSWORD.
* @param user_credentials Username and groups of the user who executes
* CreateVolume().
* @param volume_name Name of the volume to be deleted.
*
* @throws IOException
* @throws PosixErrorException
*/
virtual void DeleteVolume(
const ServiceAddresses& mrc_address,
const xtreemfs::pbrpc::Auth& auth,
const xtreemfs::pbrpc::UserCredentials& user_credentials,
const std::string& volume_name) = 0;
/** Returns the available volumes on a MRC.
*
* @param mrc_addresses ServiceAddresses object which
* contains MRC addresses of the
* form "hostname:port".
* @param auth Authentication data, e.g. of type AUTH_PASSWORD.
*
* @throws AddressToUUIDNotFoundException
* @throws IOException
* @throws PosixErrorException
*
* @remark Ownership of the return value is transferred to the caller. */
virtual xtreemfs::pbrpc::Volumes* ListVolumes(
const ServiceAddresses& mrc_addresses,
const xtreemfs::pbrpc::Auth& auth) = 0;
/** Resolves the address (ip-address:port) for a given UUID.
*
* @throws AddressToUUIDNotFoundException
* @throws UnknownAddressSchemeException
*/
virtual std::string UUIDToAddress(const std::string& uuid) = 0;
};
} // namespace xtreemfs
#endif // CPP_INCLUDE_LIBXTREEMFS_CLIENT_H_

Some files were not shown because too many files have changed in this diff Show More