Reorganization of server options.

This commit is contained in:
Ulrich Germann 2015-08-02 21:26:54 +01:00
parent b7f517bafa
commit 511de3674e
4 changed files with 13 additions and 5 deletions

View File

@ -23,6 +23,7 @@ mingw/MosesGUI/Ui_mainWindow.py
moses/TranslationModel/UG
moses/server
moses/parameters
moses/thread_safe_container.h
phrase-extract/pcfg-common
phrase-extract/syntax-common
randlm
@ -34,3 +35,4 @@ srilm
util
xmlrpc-c
.git
util/ug_cache_with_timeout.h

View File

@ -154,7 +154,7 @@ run_as_server()
xmlrpc_c::registry myRegistry;
xmlrpc_c::methodPtr const
translator(new MosesServer::Translator(sopts.num_threads)),
translator(new MosesServer::Translator(sopts)),
updater(new MosesServer::Updater),
optimizer(new MosesServer::Optimizer);

View File

@ -1,4 +1,5 @@
// -*- mode: c++; cc-style: gnu -*-
#pragma once
#include <string>
#include "moses/Parameter.h"
namespace Moses

View File

@ -2,6 +2,8 @@
#pragma once
#include "moses/ThreadPool.h"
#include "moses/parameters/ServerOptions.h"
#include "session.h"
#include <xmlrpc-c/base.hpp>
#include <xmlrpc-c/registry.hpp>
#include <xmlrpc-c/server_abyss.hpp>
@ -11,16 +13,19 @@
namespace MosesServer
{
class
// MosesServer::
Translator : public xmlrpc_c::method
Translator : public xmlrpc_c::method
{
Moses::ServerOptions m_server_options;
public:
Translator(size_t numThreads = 10);
Translator(Moses::ServerOptions const& sopts);
void execute(xmlrpc_c::paramList const& paramList,
xmlrpc_c::value * const retvalP);
Session const& get_session(uint64_t session_id);
private:
Moses::ThreadPool m_threadPool;
SessionCache m_session_cache;
};
}