Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 0 additions & 46 deletions doc/developer-guide/api/types/TSRecordModeType.en.rst

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions include/records/I_RecDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,6 @@ enum RecSourceT {
REC_SOURCE_ENV ///< Process environment variable.
};

enum RecModeT {
RECM_NULL,
RECM_CLIENT,
RECM_SERVER,
RECM_STAND_ALONE, ///< The only option now as traffic_manager is no longer supported.
};

enum RecAccessT {
RECA_NULL,
RECA_NO_ACCESS,
Expand Down
4 changes: 2 additions & 2 deletions include/records/I_RecProcess.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@
//-------------------------------------------------------------------------
// Initialization/Starting
//-------------------------------------------------------------------------
int RecProcessInit(RecModeT mode_type, Diags *diags = nullptr);
int RecProcessInitMessage(RecModeT mode_type);
int RecProcessInit(Diags *diags = nullptr);
int RecProcessInitMessage();
int RecProcessStart();

//-------------------------------------------------------------------------
Expand Down
3 changes: 1 addition & 2 deletions include/records/P_RecCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ extern RecRecord *g_records;
extern std::unordered_map<std::string, RecRecord *> g_records_ht;
extern ink_rwlock g_records_rwlock;
extern int g_num_records;
extern RecModeT g_mode_type;

// records.yaml items
extern const char *g_rec_config_fpath;
Expand All @@ -52,7 +51,7 @@ extern ink_mutex g_rec_config_lock;
// Initialization
//-------------------------------------------------------------------------

int RecCoreInit(RecModeT mode_type, Diags *diags);
int RecCoreInit(Diags *diags);

//-------------------------------------------------------------------------
// Registration/Insertion
Expand Down
8 changes: 0 additions & 8 deletions include/ts/apidefs.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -751,14 +751,6 @@ typedef enum {
TS_RECORDCHECK_IP,
} TSRecordCheckType;

/* The values of this enum must match enum RecModeT in I_RecDefs.h */
typedef enum {
TS_RECORDMODE_NULL,
TS_RECORDMODE_CLIENT,
TS_RECORDMODE_SERVER,
TS_RECORDMODE_STAND_ALONE,
} TSRecordModeType;

/* The values of this enum must match enum RecAccessT in I_RecDefs.h */
typedef enum {
TS_RECORDACCESS_NULL,
Expand Down
2 changes: 1 addition & 1 deletion iocore/aio/test_AIO.cc
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ main(int /* argc ATS_UNUSED */, char *argv[])

Layout::create();
init_diags("", nullptr);
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();
ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION);
eventProcessor.start(ink_number_of_processors());

Expand Down
2 changes: 1 addition & 1 deletion iocore/cache/test/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase {

mime_init();
Layout::create(temp_prefix());
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();
LibRecordsConfigInit();
ink_net_init(ts::ModuleVersion(1, 0, ts::ModuleVersion::PRIVATE));
ink_assert(GLOBAL_DATA != nullptr);
Expand Down
2 changes: 1 addition & 1 deletion iocore/eventsystem/unit_tests/test_EventSystem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase {
{
Layout::create();
init_diags("", nullptr);
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();

ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION);
eventProcessor.start(TEST_THREADS, 1048576); // Hardcoded stacksize at 1MB
Expand Down
2 changes: 1 addition & 1 deletion iocore/eventsystem/unit_tests/test_IOBuffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase {
{
Layout::create();
init_diags("", nullptr);
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();

LibRecordsConfigInit();

Expand Down
3 changes: 1 addition & 2 deletions iocore/hostdb/test_RefCountCache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,9 @@ int
test()
{
// Initialize IOBufAllocator
RecModeT mode_type = RECM_STAND_ALONE;
Layout::create();
init_diags("", nullptr);
RecProcessInit(mode_type);
RecProcessInit();
ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION);

int ret = 0;
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/test/event_processor_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase {
diags()->show_location = SHOW_LOCATION_DEBUG;

Layout::create();
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();
LibRecordsConfigInit();

QUICConfig::startup();
Expand Down
2 changes: 1 addition & 1 deletion iocore/net/quic/test/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase {
diags()->show_location = SHOW_LOCATION_DEBUG;

Layout::create();
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();
LibRecordsConfigInit();

QUICConfig::startup();
Expand Down
4 changes: 1 addition & 3 deletions iocore/net/test_I_Net.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,8 @@ main()
setbuf(stdout, nullptr);
int nproc = ink_number_of_processors();

RecModeT mode_type = RECM_STAND_ALONE;

init_diags("net_test", nullptr);
RecProcessInit(mode_type);
RecProcessInit();
ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION);
ink_net_init(NET_SYSTEM_MODULE_PUBLIC_VERSION);

Expand Down
3 changes: 1 addition & 2 deletions iocore/net/test_I_UDPNet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ void
udp_echo_server()
{
Layout::create();
RecModeT mode_type = RECM_STAND_ALONE;
RecProcessInit(mode_type);
RecProcessInit();

Thread *main_thread = new EThread();
main_thread->set_specific();
Expand Down
2 changes: 1 addition & 1 deletion mgmt/rpc/server/unit_tests/test_rpcserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct RPCServerTestListener : Catch::TestEventListenerBase {
{
Layout::create();
init_diags("rpc|rpc.test", nullptr);
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();

signal(SIGPIPE, SIG_IGN);

Expand Down
2 changes: 1 addition & 1 deletion proxy/http/remap/unit-tests/test_PluginFactory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase {
{
Layout::create();
init_diags("", nullptr);
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();

ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION);
eventProcessor.start(TEST_THREADS, 1048576);
Expand Down
2 changes: 1 addition & 1 deletion proxy/http2/unit_tests/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase {
{
Layout::create();
init_diags("", nullptr);
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();
LibRecordsConfigInit();

ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION);
Expand Down
2 changes: 1 addition & 1 deletion proxy/http3/test/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase {
diags()->show_location = SHOW_LOCATION_DEBUG;

Layout::create();
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();
LibRecordsConfigInit();

ink_event_system_init(EVENT_SYSTEM_MODULE_PUBLIC_VERSION);
Expand Down
2 changes: 1 addition & 1 deletion proxy/http3/test/main_qpack.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ struct EventProcessorListener : Catch::TestEventListenerBase {
diags()->show_location = SHOW_LOCATION_DEBUG;

Layout::create();
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();
LibRecordsConfigInit();

QUICConfig::startup();
Expand Down
4 changes: 2 additions & 2 deletions proxy/logging/LogStandalone.cc
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ initialize_process_manager()
// diags should have been initialized by caller, e.g.: sac.cc
ink_assert(diags());

RecProcessInit(RECM_STAND_ALONE, diags());
RecProcessInit(diags());
LibRecordsConfigInit();

RecProcessInitMessage(RECM_STAND_ALONE);
RecProcessInitMessage();

//
// Define version info records
Expand Down
2 changes: 1 addition & 1 deletion proxy/logging/unit-tests/benchmark_LogObject.cc
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ TEST_CASE("LogObject", "[proxy/logging]")
diags()->dump();
}
Layout::create("/opt/ats");
RecProcessInit(RECM_STAND_ALONE);
RecProcessInit();

size_t stacksize;
REC_ReadConfigInteger(stacksize, "proxy.config.thread.default.stacksize");
Expand Down
42 changes: 16 additions & 26 deletions src/records/P_RecCore.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@

#include <fstream>

RecModeT g_mode_type = RECM_NULL;

//-------------------------------------------------------------------------
// RecRegisterStatXXX
//-------------------------------------------------------------------------
Expand Down Expand Up @@ -338,33 +336,25 @@ RecSyncStatsFile()
bool sync_to_disk;
ats_scoped_str snap_fpath(RecConfigReadPersistentStatsPath());

/*
* g_mode_type should be initialized by
* RecLocalInit() or RecProcessInit() earlier.
*/
ink_assert(g_mode_type != RECM_NULL);

if (g_mode_type == RECM_SERVER || g_mode_type == RECM_STAND_ALONE) {
m = RecMessageAlloc(RECG_NULL);
num_records = g_num_records;
sync_to_disk = false;
for (i = 0; i < num_records; i++) {
r = &(g_records[i]);
rec_mutex_acquire(&(r->lock));
if (REC_TYPE_IS_STAT(r->rec_type)) {
if (r->stat_meta.persist_type == RECP_PERSISTENT) {
m = RecMessageMarshal_Realloc(m, r);
sync_to_disk = true;
}
m = RecMessageAlloc(RECG_NULL);
num_records = g_num_records;
sync_to_disk = false;
for (i = 0; i < num_records; i++) {
r = &(g_records[i]);
rec_mutex_acquire(&(r->lock));
if (REC_TYPE_IS_STAT(r->rec_type)) {
if (r->stat_meta.persist_type == RECP_PERSISTENT) {
m = RecMessageMarshal_Realloc(m, r);
sync_to_disk = true;
}
rec_mutex_release(&(r->lock));
}
if (sync_to_disk) {
RecDebug(DL_Note, "Writing '%s' [%d bytes]", (const char *)snap_fpath, m->o_write - m->o_start + sizeof(RecMessageHdr));
RecMessageWriteToDisk(m, snap_fpath);
}
RecMessageFree(m);
rec_mutex_release(&(r->lock));
}
if (sync_to_disk) {
RecDebug(DL_Note, "Writing '%s' [%d bytes]", (const char *)snap_fpath, m->o_write - m->o_start + sizeof(RecMessageHdr));
RecMessageWriteToDisk(m, snap_fpath);
}
RecMessageFree(m);

return REC_ERR_OKAY;
}
Expand Down
Loading