Skip to content

Commit

Permalink
Moved soa subdirectories elsewhere
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremybarnes committed Apr 2, 2018
1 parent 4afc3f1 commit 8c42ebc
Show file tree
Hide file tree
Showing 47 changed files with 90 additions and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Basic functionality to get credentials.
*/

#include "credential_provider.h"
#include "mldb/credentials/credential_provider.h"
#include "mldb/types/optional.h"
#include "mldb/base/exc_assert.h"
#include <mutex>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Credential provider structure and registration.
*/

#include "mldb/soa/credentials/credentials.h"
#include "mldb/credentials/credentials.h"

#pragma once

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "credentials.h"
#include "mldb/credentials/credentials.h"
#include "mldb/types/structure_description.h"

using namespace std;
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion mldb.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ MLDB_SUBDIRS := \
logging \
io \
http \
credentials \
vfs \
jml \
soa \
ml \
vfs_handlers \
utils \
Expand Down
2 changes: 1 addition & 1 deletion postgresql/postgresql_plugin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "mldb/core/procedure.h"
#include "mldb/core/function.h"
#include "mldb/core/dataset.h"
#include "mldb/soa/credentials/credentials.h"
#include "mldb/credentials/credentials.h"
#include "mldb/types/structure_description.h"
#include "mldb/types/any_impl.h"

Expand Down
File renamed without changes.
39 changes: 36 additions & 3 deletions soa/service/event_service.cc → rest/event_service.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

#include "event_service.h"
#include "multi_aggregator.h"
//#include "multi_aggregator.h"
#include <iostream>
#include "mldb/arch/demangle.h"
#include "mldb/base/exc_assert.h"
Expand Down Expand Up @@ -60,13 +60,13 @@ get(std::ostream & output) const {
return result;
}


/*****************************************************************************/
/* NULL EVENT SERVICE */
/*****************************************************************************/

NullEventService::
NullEventService()
: stats(new MultiAggregator())
{
}

Expand All @@ -83,15 +83,48 @@ onEvent(const std::string & name,
float value,
std::initializer_list<int>)
{
stats->record(name + "." + event, type, value);
}

void
NullEventService::
dump(std::ostream & stream) const
{
}

#if 0
/*****************************************************************************/
/* AGGREGATOR EVENT SERVICE */
/*****************************************************************************/

AggregatorEventService::
AggregatorEventService()
: stats(new MultiAggregator())
{
}

AggregatorEventService::
~AggregatorEventService()
{
}

void
AggregatorEventService::
onEvent(const std::string & name,
const char * event,
EventType type,
float value,
std::initializer_list<int>)
{
stats->record(name + "." + event, type, value);
}

void
AggregatorEventService::
dump(std::ostream & stream) const
{
stats->dumpSync(stream);
}
#endif


/*****************************************************************************/
Expand Down
27 changes: 23 additions & 4 deletions soa/service/event_service.h → rest/event_service.h
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
// This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved.

/* event_service.h -*- C++ -*-
Jeremy Barnes, 12 December 2014
Copyright (c) 2014 mldb.ai inc. All rights reserved.
This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved.
Service for high frequency logging of events.
*/

#pragma once

#include "mldb/soa/service/stats_events.h"
#include "stats_events.h"
#include "mldb/arch/format.h"
#include <map>
#include <string>
Expand Down Expand Up @@ -62,10 +61,30 @@ struct NullEventService : public EventService {
std::initializer_list<int> extra = DefaultOutcomePercentiles);

virtual void dump(std::ostream & stream) const;
};


#if 0
/*****************************************************************************/
/* AGGREGATOR EVENT SERVICE */
/*****************************************************************************/

struct AggregatorEventService : public EventService {

AggregatorEventService();
~AggregatorEventService();

virtual void onEvent(const std::string & name,
const char * event,
EventType type,
float value,
std::initializer_list<int> extra = DefaultOutcomePercentiles);

virtual void dump(std::ostream & stream) const;

std::unique_ptr<MultiAggregator> stats;
};

#endif

/*****************************************************************************/
/* EVENT RECORDER */
Expand Down
1 change: 0 additions & 1 deletion soa/service/connectfd.cc → rest/opstats/connectfd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

#include <netdb.h>
#include <string.h>
#include "mldb/soa/service/connectfd.h"
#include "mldb/arch/exception.h"
#include <unistd.h>

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include <mutex>
#include <thread>
#include <condition_variable>
#include "mldb/soa/service/stat_aggregator.h"
#include "stat_aggregator.h"
#include "mldb/arch/thread_specific.h"
#include <iostream>

Expand Down
13 changes: 0 additions & 13 deletions soa/service/service.mk → rest/opstats/opstats.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,3 @@ LIBOPSTATS_LINK := \

$(eval $(call library,opstats,$(LIBOPSTATS_SOURCES),$(LIBOPSTATS_LINK)))



# Services

LIBSERVICES_SOURCES := \
event_service.cc \

LIBSERVICES_LINK := opstats

$(eval $(call library,services,$(LIBSERVICES_SOURCES),$(LIBSERVICES_LINK)))


$(eval $(call include_sub_make,service_testing,testing,service_testing.mk))
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/


#include "mldb/soa/service/process_stats.h"
#include "process_stats.h"
#include "mldb/arch/exception.h"

#include <boost/algorithm/string/split.hpp>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved.
*/

#include "mldb/soa/service/stat_aggregator.h"
#include "mldb/rest/opstats/stat_aggregator.h"
#include "mldb/arch/exception.h"
#include "mldb/arch/format.h"
#include <iostream>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

#include "mldb/jml/stats/distribution.h"
#include "mldb/types/date.h"
#include "stats_events.h"
#include "mldb/rest/stats_events.h"
#include <unordered_map>
#include <map>
#include <deque>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
*/

#include "mldb/soa/service/statsd_connector.h"
#include "mldb/rest/opstats/statsd_connector.h"
#include "mldb/arch/exception.h"
#include "mldb/arch/format.h"
#include <iostream>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <string.h>
#include "mldb/soa/service/connectfd.h"
#include "connectfd.h"
#include <unistd.h>


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved.

/* statsd_connector.h -*- C++ -*-
Send messages to statsd.
This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved.
*/

#pragma once
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 6 additions & 3 deletions rest/rest.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
# Jeremy Barnes, 16 March 2015
# Copyright (c) 2015 mldb.ai inc. All rights reserved.

$(eval $(call include_sub_make,opstats))

LIBREST_SOURCES := \
rest_request.cc \
rest_request_router.cc \
Expand Down Expand Up @@ -38,12 +40,13 @@ LIBSERVICE_PEER_SOURCES := \
asio_peer_connection.cc \
standalone_peer_server.cc \
peer_info.cc \
event_service.cc


$(eval $(call library,rest,$(LIBREST_SOURCES),services log))
$(eval $(call library,rest,$(LIBREST_SOURCES),arch types utils log))
$(eval $(call library,link,$(LIBLINK_SOURCES),watch))
$(eval $(call library,rest_entity,$(LIBREST_ENTITY_SOURCES),services gc link any json_diff))
$(eval $(call library,service_peer,$(LIBSERVICE_PEER_SOURCES),rest services gc link rest_entity))
$(eval $(call library,rest_entity,$(LIBREST_ENTITY_SOURCES),gc link any json_diff))
$(eval $(call library,service_peer,$(LIBSERVICE_PEER_SOURCES),rest gc link rest_entity))


$(eval $(call include_sub_make,rest_testing,testing))
6 changes: 1 addition & 5 deletions soa/service/stats_events.h → rest/stats_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
Different types of stats events.
*/

#ifndef __logger__stats_events_h__
#define __logger__stats_events_h__
#pragma once

#include <utility>

Expand All @@ -27,6 +26,3 @@ static constexpr std::initializer_list<int> DefaultOutcomePercentiles =

} // namespace MLDB



#endif /* __logger__stats_events_h__ */
2 changes: 1 addition & 1 deletion server/credential_collection.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "mldb/rest/rest_request_binding.h"
#include "mldb/types/structure_description.h"
#include "mldb/types/pointer_description.h"
#include "mldb/soa/credentials/credential_provider.h"
#include "mldb/credentials/credential_provider.h"
#include "mldb/utils/log.h"
#include "mldb/utils/json_utils.h"
#include <signal.h>
Expand Down
4 changes: 2 additions & 2 deletions server/credential_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

#pragma once

#include "mldb/soa/service/event_service.h"
#include "mldb/rest/event_service.h"
#include "mldb/rest/rest_request_router.h"
#include "mldb/rest/rest_service_endpoint.h"
#include "mldb/soa/credentials/credentials.h"
#include "mldb/credentials/credentials.h"
#include "mldb/rest/rest_collection.h"
#include "mldb/utils/log_fwd.h"

Expand Down
4 changes: 2 additions & 2 deletions server/mldb_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include "mldb/server/credential_collection.h"
#include "mldb/vfs/filter_streams.h"
#include "mldb/utils/config.h"
#include "mldb/soa/credentials/credential_provider.h"
#include "mldb/soa/credentials/credentials.h"
#include "mldb/credentials/credential_provider.h"
#include "mldb/credentials/credentials.h"
#include <boost/filesystem.hpp>
#include <boost/program_options/cmdline.hpp>
#include <boost/program_options/options_description.hpp>
Expand Down
2 changes: 1 addition & 1 deletion server/mldb_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#include "mldb/rest/service_peer.h"
#include "mldb/rest/in_process_rest_connection.h"
#include "mldb/types/string.h"
#include "mldb/soa/service/event_service.h"
#include "mldb/rest/event_service.h"
#include "mldb/utils/log_fwd.h"


Expand Down
6 changes: 0 additions & 6 deletions soa/soa.mk

This file was deleted.

2 changes: 1 addition & 1 deletion testing/MLDB-1468-credentials-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def test_selection_of_creds_2(self):
with open(join(expanduser('~'), '.cloud_credentials')) as f:
creds = f.readlines()
for idx, cred in enumerate(creds):
type, version, key, secret = cred.split('\t')
type, version, key, secret,_,_,_,_ = cred.split('\t')

# store the credential for a specific path
resp = mldb.put("/v1/credentials/testcred" + str(idx), {
Expand Down
2 changes: 1 addition & 1 deletion testing/credentials_persistence_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "mldb/rest/collection_config_store.h"
#include "mldb/utils/runner.h"
#include "mldb/io/message_loop.h"
#include "mldb/soa/credentials/credentials.h"
#include "mldb/credentials/credentials.h"
#include "mldb/vfs/filter_streams.h"
#include "mldb/http/http_rest_proxy.h"
#include <boost/algorithm/string.hpp>
Expand Down
4 changes: 2 additions & 2 deletions vfs_handlers/aws/s3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "mldb/io/legacy_event_loop.h"
#include "mldb/io/message_loop.h"
#include "mldb/jml/utils/file_functions.h"
#include "mldb/soa/credentials/credentials.h"
#include "mldb/soa/credentials/credential_provider.h"
#include "mldb/credentials/credentials.h"
#include "mldb/credentials/credential_provider.h"
#include "mldb/utils/testing/print_utils.h"
#include "mldb/vfs_handlers/aws/xml_helpers.h"
#include "mldb/types/structure_description.h"
Expand Down
2 changes: 1 addition & 1 deletion vfs_handlers/azure_blob_storage.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "mldb/arch/format.h"
#include "mldb/base/exc_assert.h"
#include "mldb/jml/utils/string_functions.h"
#include "mldb/soa/credentials/credential_provider.h"
#include "mldb/credentials/credential_provider.h"
#include "mldb/types/date.h"
#include "mldb/vfs/filter_streams.h"
#include "mldb/vfs/filter_streams_registry.h"
Expand Down
2 changes: 1 addition & 1 deletion vfs_handlers/sftp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "mldb/vfs/filter_streams_registry.h"
#include "mldb/vfs/fs_utils.h"
#include "mldb/base/exc_assert.h"
#include "mldb/soa/credentials/credential_provider.h"
#include "mldb/credentials/credential_provider.h"
#include <thread>
#include <unordered_map>

Expand Down

0 comments on commit 8c42ebc

Please sign in to comment.