1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Remove windows ifdefs

This commit is contained in:
Leonid Fedorov
2023-03-02 15:59:42 +00:00
parent 123c345b40
commit 56f2346083
328 changed files with 9 additions and 19602 deletions

View File

@ -33,11 +33,7 @@
#include <cerrno>
#include <cstdlib>
#include <sys/time.h>
#ifndef _MSC_VER
#include <sys/resource.h>
#else
#include <cstdio>
#endif
#include <boost/filesystem/path.hpp>
#include "idberrorinfo.h"
#include "we_simplesyslog.h"
@ -210,18 +206,6 @@ void handleControlC(int i)
BulkStatus::setJobStatus(EXIT_FAILURE);
}
#ifdef _MSC_VER
BOOL WINAPI HandlerCtrlCRoutine(_In_ DWORD dwCtrlType)
{
// Log to syslog
logging::Message::Args errMsgArgs;
errMsgArgs.add("Received Break to terminate the process");
SimpleSysLog::instance()->logMsg(errMsgArgs, logging::LOG_TYPE_DEBUG, logging::M0087);
handleControlC(dwCtrlType);
return true;
}
#endif
//------------------------------------------------------------------------------
// If error occurs during startup, this function is called to log the specified
@ -261,9 +245,6 @@ void startupError(const std::string& errMsg, bool showHint)
//------------------------------------------------------------------------------
void setupSignalHandlers()
{
#ifdef _MSC_VER
BOOL brtn = SetConsoleCtrlHandler(HandlerCtrlCRoutine, true);
#else
struct sigaction ign;
// Ignore SIGPIPE signal
@ -293,7 +274,6 @@ void setupSignalHandlers()
memset(&act, 0, sizeof(act));
act.sa_handler = handleSigTerm;
sigaction(SIGTERM, &act, 0);
#endif
}
//------------------------------------------------------------------------------
@ -1020,9 +1000,6 @@ void logInitiateMsg(const char* initText)
//------------------------------------------------------------------------------
int main(int argc, char** argv)
{
#ifdef _MSC_VER
_setmaxstdio(2048);
#endif
setupSignalHandlers();
// Set locale language
@ -1132,11 +1109,7 @@ int main(int argc, char** argv)
//--------------------------------------------------------------------------
// Set scheduling priority for this cpimport.bin process
//--------------------------------------------------------------------------
#ifdef _MSC_VER
// FIXME
#else
setpriority(PRIO_PROCESS, 0, Config::getBulkProcessPriority());
#endif
if (bDebug)
logInitiateMsg("Config cache initialized");

View File

@ -1364,12 +1364,7 @@ int BulkLoad::buildImportDataFileList(const std::string& location, const std::st
for (str = filenames;; str = NULL)
{
#ifdef _MSC_VER
// On Windows, only comma and vertbar can separate input files
token = strtok(str, ",|");
#else
token = strtok(str, ", |");
#endif
if (token == NULL)
break;
@ -1389,9 +1384,6 @@ int BulkLoad::buildImportDataFileList(const std::string& location, const std::st
fullPath += token;
}
#ifdef _MSC_VER
loadFiles.push_back(fullPath);
#else
// If running mode2, then support a filename with wildcards
if (fBulkMode == BULK_MODE_REMOTE_MULTIPLE_SRC)
@ -1476,7 +1468,6 @@ int BulkLoad::buildImportDataFileList(const std::string& location, const std::st
loadFiles.push_back(fullPath);
} // not mode2
#endif
} // loop through filename tokens
delete[] filenames;

View File

@ -22,9 +22,7 @@
/** @file */
#pragma once
#ifndef _MSC_VER
#include <pthread.h>
#endif
#include <fstream>
#include <string>
#include <vector>

View File

@ -49,33 +49,6 @@ using namespace std;
using namespace boost;
using namespace execplan;
#if defined(_MSC_VER) && !defined(isnan)
#define isnan _isnan
namespace
{
inline int __signbitf(float __x)
{
union
{
float __f;
int __i;
} __u;
__u.__f = __x;
return __u.__i < 0;
}
inline int __signbit(double __x)
{
union
{
double __d;
int __i[2];
} __u;
__u.__d = __x;
return __u.__i[1] < 0;
}
} // namespace
#define signbit(x) (sizeof(x) == sizeof(float) ? __signbitf(x) : __signbit(x))
#endif
namespace
{
@ -368,20 +341,11 @@ void BulkLoadBuffer::convert(char* field, int fieldLength, bool nullFlag, unsign
{
errno = 0;
#ifdef _MSC_VER
fVal = (float)strtod(field, 0);
#else
fVal = strtof(field, 0);
#endif
if (errno == ERANGE)
{
#ifdef _MSC_VER
if (abs(fVal) == HUGE_VAL)
#else
if (abs(fVal) == HUGE_VALF)
#endif
{
if (fVal > 0)
fVal = maxFltSat;
@ -473,12 +437,7 @@ void BulkLoadBuffer::convert(char* field, int fieldLength, bool nullFlag, unsign
if (errno == ERANGE)
{
#ifdef _MSC_VER
if (abs(dVal) == HUGE_VAL)
#else
if (abs(dVal) == HUGE_VALL)
#endif
{
if (dVal > 0)
dVal = column.fMaxDblSat;

View File

@ -30,11 +30,7 @@
#include <limits>
#include <stdint.h>
#include <set>
#ifdef _MSC_VER
#include <unordered_map>
#else
#include <tr1/unordered_map>
#endif
#include <boost/thread/mutex.hpp>
#include "brmtypes.h"

View File

@ -29,11 +29,7 @@
#include <string>
#include <vector>
#ifdef _MSC_VER
#include <unordered_map>
#else
#include <tr1/unordered_map>
#endif
#include <boost/thread/mutex.hpp>
#include "we_type.h"

View File

@ -37,11 +37,7 @@
// @bug 2099+
#include <iostream>
#include <libmarias3/marias3.h>
#ifdef _MSC_VER
#include <stdlib.h>
#else
#include <string.h>
#endif
using namespace std;
// @bug 2099-
@ -101,9 +97,6 @@ void TableInfo::sleepMS(long ms)
rm_ts.tv_sec = ms / 1000;
rm_ts.tv_nsec = ms % 1000 * 1000000;
#ifdef _MSC_VER
Sleep(ms);
#else
struct timespec abs_ts;
do
@ -112,7 +105,6 @@ void TableInfo::sleepMS(long ms)
abs_ts.tv_nsec = rm_ts.tv_nsec;
} while (nanosleep(&abs_ts, &rm_ts) < 0);
#endif
}
//------------------------------------------------------------------------------
@ -1115,11 +1107,7 @@ int TableInfo::getColumnForParse(const int& id, const int& bufferId, bool report
if (report)
{
#ifdef _MSC_VER
oss << " ----- " << GetCurrentThreadId() << ":fBuffers[" << bufferId <<
#else
oss << " ----- " << pthread_self() << ":fBuffers[" << bufferId <<
#endif
"]: (colLocker,status,lasttime)- ";
}
@ -1204,11 +1192,7 @@ bool TableInfo::bufferReadyForParse(const int& bufferId, bool report) const
ostringstream oss;
string bufStatusStr;
ColumnInfo::convertStatusToString(stat, bufStatusStr);
#ifdef _MSC_VER
oss << " --- " << GetCurrentThreadId() <<
#else
oss << " --- " << pthread_self() <<
#endif
":fBuffers[" << bufferId << "]=" << bufStatusStr << " (" << stat << ")" << std::endl;
cout << oss.str();
}
@ -1225,17 +1209,6 @@ bool TableInfo::bufferReadyForParse(const int& bufferId, bool report) const
int TableInfo::initializeBuffers(int noOfBuffers, const JobFieldRefList& jobFieldRefList,
unsigned int fixedBinaryRecLen)
{
#ifdef _MSC_VER
//@bug 3751
// When reading from STDIN, Windows doesn't like the huge default buffer of
// 1M, so turn it down.
if (fReadFromStdin)
{
fBufferSize = std::min(10240, fBufferSize);
}
#endif
fReadBufCount = noOfBuffers;
@ -1293,19 +1266,10 @@ int TableInfo::openTableFile()
{
fHandle = stdin;
#ifdef _MSC_VER
// If this is a binary import from STDIN, then set stdin to binary
if (fImportDataMode != IMPORT_DATA_TEXT)
_setmode(_fileno(stdin), _O_BINARY);
fFileBuffer = 0;
#else
// Not 100% sure that calling setvbuf on stdin does much, but in
// some tests, it made a slight difference.
fFileBuffer = new char[fFileBufSize];
setvbuf(fHandle, fFileBuffer, _IOFBF, fFileBufSize);
#endif
ostringstream oss;
oss << BOLD_START << "Reading input from STDIN to import into table " << fTableName << "..." << BOLD_STOP;
fLog->logMsg(oss.str(), MSGLVL_INFO1);
@ -1441,14 +1405,7 @@ void TableInfo::writeBadRows(const std::vector<std::string>* errorDatRows, bool
if (fErrorDir.size() > 0)
{
#ifdef _MSC_VER
char filename[_MAX_FNAME];
char ext[_MAX_EXT];
_splitpath(const_cast<char*>(getFileName().c_str()), NULL, NULL, filename, ext);
rejectFileName << fErrorDir << "\\" << filename << ext;
#else
rejectFileName << fErrorDir << basename(getFileName().c_str());
#endif
}
else
{
@ -1547,14 +1504,7 @@ void TableInfo::writeErrReason(const std::vector<std::pair<RID, string> >* error
if (fErrorDir.size() > 0)
{
#ifdef _MSC_VER
char filename[_MAX_FNAME];
char ext[_MAX_EXT];
_splitpath(const_cast<char*>(getFileName().c_str()), NULL, NULL, filename, ext);
errFileName << fErrorDir << "\\" << filename << ext;
#else
errFileName << fErrorDir << basename(getFileName().c_str());
#endif
}
else
{

View File

@ -642,15 +642,8 @@ inline void TableInfo::setJobUUID(const boost::uuids::uuid& jobUUID)
inline void TableInfo::setErrorDir(const std::string& errorDir)
{
fErrorDir = errorDir;
#ifdef _MSC_VER
if (fErrorDir.length() > 0 && *(--(fErrorDir.end())) != '/' && *(--(fErrorDir.end())) != '\\')
fErrorDir.push_back('\\');
}
#else
if (fErrorDir.length() > 0 && *(--(fErrorDir.end())) != '/')
fErrorDir.push_back('/');
}
#endif
} // namespace WriteEngine

View File

@ -41,9 +41,6 @@ void BulkLoad::sleepMS(long ms)
rm_ts.tv_sec = ms / 1000;
rm_ts.tv_nsec = ms % 1000 * 1000000;
#ifdef _MSC_VER
Sleep(ms);
#else
struct timespec abs_ts;
do
@ -52,7 +49,6 @@ void BulkLoad::sleepMS(long ms)
abs_ts.tv_nsec = rm_ts.tv_nsec;
} while (nanosleep(&abs_ts, &rm_ts) < 0);
#endif
}
//------------------------------------------------------------------------------
@ -274,11 +270,7 @@ void BulkLoad::parse(int id)
<< endl
<< timeString << ": BulkLoad::parse(" << id << "); "
<<
#ifdef _MSC_VER
" Worker Thread " << GetCurrentThreadId() <<
#else
" Worker Thread " << pthread_self() <<
#endif
":" << endl
<< "---------------------------------------"
"-------------------"
@ -444,11 +436,7 @@ bool BulkLoad::lockColumnForParse(int thrdId, int& tableId, int& columnId, int&
std::string bufStatusStr;
Status stat = fTableInfo[i].getStatusTI();
ColumnInfo::convertStatusToString(stat, bufStatusStr);
#ifdef _MSC_VER
oss << " - " << GetCurrentThreadId() <<
#else
oss << " - " << pthread_self() <<
#endif
":fTableInfo[" << i << "]" << bufStatusStr << " (" << stat << ")";
if (stat != WriteEngine::PARSE_COMPLETE)

View File

@ -26,12 +26,10 @@
#include <ctime>
#include <algorithm>
#include <unistd.h>
#ifndef _MSC_VER
#include <arpa/inet.h>
#if __FreeBSD__
#include <sys/socket.h>
#endif
#endif
using namespace std;
#include <boost/thread/mutex.hpp>

View File

@ -36,11 +36,7 @@
#include "rwlock_local.h"
#include "resourcemanager.h"
#if defined(_MSC_VER) && defined(xxxWECLIENTS_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{

View File

@ -27,11 +27,7 @@
#include "liboamcpp.h"
#include "writeengine.h"
#if defined(_MSC_VER) && defined(xxxWE_DDLCOMMANDCLIENT_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#include "dataconvert.h"

View File

@ -27,11 +27,7 @@
#include "liboamcpp.h"
#include "writeengine.h"
#if defined(_MSC_VER) && defined(xxxWE_DDLCOMMANDCLIENT_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#include "dataconvert.h"

View File

@ -36,11 +36,7 @@
#include "we_brm.h"
#include "bytestream.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -20,9 +20,7 @@
*
*******************************************************************************/
#include <string.h>
#ifndef _MSC_VER
#include <inttypes.h>
#endif
#define WRITEENGINEDCTSTORE_DLLEXPORT
#include "we_dctnrystore.h"
#undef WRITEENGINEDCTSTORE_DLLEXPORT

View File

@ -41,11 +41,7 @@
#include "we_type.h"
#include "we_dctnry.h"
#if defined(_MSC_VER) && defined(WRITEENGINEDCTSTORE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/**@brief Namespace WriteEngine */

View File

@ -25,9 +25,7 @@
/* ========================================================================== */
#include <stdio.h>
#include <string.h>
#ifndef _MSC_VER
#include <inttypes.h>
#endif
#include "we_indexlist.h"
using namespace std;

View File

@ -25,9 +25,7 @@
/* ========================================================================== */
#include <stdio.h>
#include <string.h>
#ifndef _MSC_VER
#include <inttypes.h>
#endif
#include "we_indexlist.h"
using namespace std;

View File

@ -25,9 +25,7 @@
/* ========================================================================== */
#include <stdio.h>
#include <string.h>
#ifndef _MSC_VER
#include <inttypes.h>
#endif
#include "we_indextree.h"
#include "we_indexlist.h"

View File

@ -25,9 +25,7 @@
/* ========================================================================== */
#include <stdio.h>
#include <string.h>
#ifndef _MSC_VER
#include <inttypes.h>
#endif
#include "we_indexlist.h"
using namespace std;

View File

@ -26,9 +26,7 @@
#include <stdio.h>
//#include <pthread.h>
#include <string.h>
#ifndef _MSC_VER
#include <inttypes.h>
#endif
#include <math.h>
#include "we_indextree.h"
#include "we_indexlist.h"

View File

@ -25,9 +25,7 @@
/************************************************************************** */
#include <stdio.h>
#include <string.h>
#ifndef _MSC_VER
#include <inttypes.h>
#endif
#include "we_indexlist.h"
using namespace std;

View File

@ -30,11 +30,7 @@
#include <we_freemgr.h>
#include <we_indexlist.h>
#if defined(_MSC_VER) && defined(WRITEENGINEINDEXTREE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -246,16 +246,12 @@ int RedistributeWorkerThread::grabTableLock()
// always wait long enough for ddl/dml/cpimport to get table lock
// for now, triple the ddl/dml/cpimport retry interval: 3 * 100ms
#ifdef _MSC_VER
Sleep(ts.tv_nsec * 1000);
#else
struct timespec tmp = ts;
while (nanosleep(&tmp, &ts) < 0)
;
tmp = ts;
#endif
try
{

View File

@ -33,15 +33,7 @@
#include <cerrno>
#include <unistd.h> //pipe() && fork()
#if defined(__linux__)
#include <wait.h> //wait()
#elif defined(__FreeBSD__)
#include <sys/types.h>
#include <sys/stat.h> // For stat().
#include <sys/wait.h>
#include <sys/time.h>
#include <sys/resource.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
@ -168,10 +160,8 @@ WEDataLoader::~WEDataLoader()
void WEDataLoader::setupSignalHandlers()
{
#ifndef _MSC_VER
signal(SIGPIPE, SIG_IGN);
signal(SIGCHLD, WEDataLoader::onSigChild);
#endif
}
//------------------------------------------------------------------------------
// handles on signal Terminate

View File

@ -30,11 +30,7 @@
#include "dataconvert.h"
#include "writeengine.h"
#if defined(_MSC_VER) && defined(xxxDDLPKGPROC_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{

View File

@ -43,11 +43,7 @@
#include "brmtypes.h"
#include "joblist.h"
#if defined(_MSC_VER) && defined(xxxDDLPKGPROC_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#include <boost/algorithm/string/case_conv.hpp>

View File

@ -40,11 +40,7 @@
#include "rowgroup.h"
#include "we_log.h"
#if defined(_MSC_VER) && defined(xxxDDLPKGPROC_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{

View File

@ -357,9 +357,6 @@ int WE_GetFileSizes::processTable(messageqcpp::ByteStream& bs, std::string& errM
while (currentActiveThreads > 0)
{
#ifdef _MSC_VER
Sleep(sleepTime);
#else
struct timespec abs_ts;
do
@ -368,7 +365,6 @@ int WE_GetFileSizes::processTable(messageqcpp::ByteStream& bs, std::string& errM
abs_ts.tv_nsec = rm_ts.tv_nsec;
} while (nanosleep(&abs_ts, &rm_ts) < 0);
#endif
currentActiveThreads = activeThreadCounter->cur();
}
}

View File

@ -24,14 +24,10 @@
#include <iostream>
#include <string>
#include <sstream>
#ifndef _MSC_VER
#include <signal.h>
#include <stdexcept>
#include "logger.h"
#endif
#ifndef _MSC_VER
#include <sys/resource.h>
#endif
using namespace std;
#include "messagequeue.h"
@ -129,7 +125,6 @@ void added_a_pm(int)
int ServiceWriteEngine::setupResources()
{
#ifndef _MSC_VER
struct rlimit rlim;
if (getrlimit(RLIMIT_NOFILE, &rlim) != 0)
@ -153,13 +148,11 @@ int ServiceWriteEngine::setupResources()
{
return -4;
}
#endif
return 0;
}
void ServiceWriteEngine::setupChildSignalHandlers()
{
#ifndef _MSC_VER
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = added_a_pm;
@ -172,7 +165,6 @@ void ServiceWriteEngine::setupChildSignalHandlers()
sigaction(SIGSEGV, &sa, 0);
sigaction(SIGABRT, &sa, 0);
sigaction(SIGFPE, &sa, 0);
#endif
}
int ServiceWriteEngine::Child()
@ -182,11 +174,6 @@ int ServiceWriteEngine::Child()
// Init WriteEngine Wrapper (including Config Columnstore.xml cache)
WriteEngine::WriteEngineWrapper::init(WriteEngine::SUBSYSTEM_ID_WE_SRV);
#ifdef _MSC_VER
// In windows, initializing the wrapper (A dll) does not set the static variables
// in the main program
idbdatafile::IDBPolicy::configIDBPolicy();
#endif
Config weConfig;
ostringstream serverParms;

View File

@ -25,11 +25,7 @@
#include <we_obj.h>
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -60,9 +60,6 @@ BRMWrapper* volatile BRMWrapper::m_instance = NULL;
boost::thread_specific_ptr<int> BRMWrapper::m_ThreadDataPtr;
boost::mutex BRMWrapper::m_instanceCreateMutex;
#ifdef _MSC_VER
__declspec(dllexport)
#endif
bool BRMWrapper::m_useVb = true;
OID BRMWrapper::m_curVBOid = INVALID_NUM;

View File

@ -38,11 +38,7 @@
#include "IDBDataFile.h"
#include "IDBPolicy.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine
@ -470,9 +466,6 @@ class BRMWrapper : public WEObj
static boost::thread_specific_ptr<int> m_ThreadDataPtr;
static boost::mutex m_instanceCreateMutex;
#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT)
__declspec(dllimport)
#endif
EXPORT static bool m_useVb;
static OID m_curVBOid;

View File

@ -26,12 +26,6 @@
#pragma once
#ifdef _MSC_VER
#define WIN32_LEAN_AND_MEAN
#define NOMINMAX
#include <windows.h>
#include <boost/thread/mutex.hpp>
#endif
#include <set>
#include <string>
#include <sstream>
@ -41,11 +35,7 @@
#include "messagelog.h"
#include "messageobj.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{

View File

@ -31,9 +31,6 @@ CacheControl* Cache::m_cacheParam = NULL;
FreeBufList* Cache::m_freeList = NULL;
CacheMap* Cache::m_lruList = NULL;
CacheMap* Cache::m_writeList = NULL;
#ifdef _MSC_VER
__declspec(dllexport)
#endif
bool Cache::m_useCache = false;
/***********************************************************
* DESCRIPTION:

View File

@ -23,25 +23,17 @@
#pragma once
#include <iostream>
#ifdef _MSC_VER
#include <unordered_map>
#else
#if __GNUC__ == 4 && __GNUC_MINOR__ < 2
#include <ext/hash_map>
#else
#include <tr1/unordered_map>
#endif
#endif
#include <map>
#include <we_obj.h>
#include <we_convertor.h>
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine
{
@ -223,9 +215,6 @@ class Cache
static CacheMap* m_lruList; // LRU buffer list
static CacheMap* m_writeList; // Write buffer list
#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT)
__declspec(dllimport)
#endif
EXPORT static bool m_useCache; // Use cache flag
private:
};

View File

@ -2018,14 +2018,6 @@ int ChunkManager::reallocateChunks(CompFileData* fileData)
if (rc == NO_ERROR)
{
#ifdef _MSC_VER
// We need to do this early on so the ::rename() call below will work on Windows
// we'll do it again later on, but that's life...
// FIXME: there's a race here that a query will re-open the files before we can jigger
// them around. We need to make sure PP is opening these files with the right perms
// to allow another process to delete them.
cacheutils::dropPrimProcFdCache();
#endif
// @bug3913, keep the original file until the new file is properly renamed.
// 1. check the new file size is NOT 0, matching ptr[k].

View File

@ -33,17 +33,8 @@
#include "idbcompress.h"
#include "IDBFileSystem.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#ifdef _MSC_VER
#define WE_COMP_DBG(x) \
{ \
}
#else
//#define IDB_COMP_DEBUG
#ifdef IDB_COMP_DEBUG
#define WE_COMP_DBG(x) \
@ -55,7 +46,6 @@
{ \
}
#endif
#endif
namespace logging
{

View File

@ -119,9 +119,7 @@ void Config::checkReload()
if (m_bulkRoot.length() == 0)
{
m_bulkRoot = "/var/log/mariadb/columnstore";
#ifndef _MSC_VER
m_bulkRoot += "/data";
#endif
m_bulkRoot += "/bulk";
}

View File

@ -32,11 +32,7 @@
//#define SHARED_NOTHING_DEMO_2
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -24,11 +24,7 @@
#include "IDBFileSystem.h"
#include "we_type.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{

View File

@ -26,9 +26,6 @@
#include <limits>
#include <cstring>
#include <vector>
#ifdef _MSC_VER
#include <cstdio>
#endif
#include "mcsconfig.h"
#include "we_convertor.h"

View File

@ -35,11 +35,7 @@
#include "we_obj.h"
#include "we_config.h"
#include "calpontsystemcatalog.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -26,11 +26,7 @@
#include "we_blockop.h"
#include "we_cache.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -40,11 +40,7 @@
#include "we_type.h"
#include "brmtypes.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{

View File

@ -26,11 +26,7 @@
#include <map>
#include <stdint.h>
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -30,7 +30,7 @@
#if defined(__FreeBSD__)
#include <sys/param.h>
#include <sys/mount.h>
#elif !defined(_MSC_VER)
#else
#include <sys/vfs.h>
#endif
#include <boost/filesystem/operations.hpp>
@ -737,13 +737,7 @@ int FileOp::extendFile(OID oid, const uint8_t* emptyVal, int width,
}
}
#ifdef _MSC_VER
// Need to call the win version with a dir, not a file
if (!isDiskSpaceAvail(Config::getDBRootByNum(dbRoot), allocSize))
#else
if (!isDiskSpaceAvail(segFile, allocSize))
#endif
{
return ERR_FILE_DISK_SPACE;
}
@ -868,13 +862,7 @@ int FileOp::addExtentExactFile(OID oid, const uint8_t* emptyVal, int width, int&
}
}
#ifdef _MSC_VER
// Need to call the win version with a dir, not a file
if (!isDiskSpaceAvail(Config::getDBRootByNum(dbRoot), allocSize))
#else
if (!isDiskSpaceAvail(segFile, allocSize))
#endif
{
return ERR_FILE_DISK_SPACE;
}
@ -2556,25 +2544,6 @@ bool FileOp::isDiskSpaceAvail(const std::string& fileName, int nBlocks) const
if (maxDiskUsage < 100) // 100% means to disable the check
{
#ifdef _MSC_VER
ULARGE_INTEGER freeBytesAvail;
ULARGE_INTEGER totalBytesAvail;
if (GetDiskFreeSpaceEx(fileName.c_str(), &freeBytesAvail, &totalBytesAvail, 0) != 0)
{
double avail = (double)freeBytesAvail.QuadPart;
double total = (double)totalBytesAvail.QuadPart;
double wanted = (double)nBlocks * (double)BYTE_PER_BLOCK;
// If we want more than there is, return an error
if (wanted > avail)
bSpaceAvail = false;
// If the remaining bytes would be too few, return an error
else if ((total - (avail - wanted)) / total * 100.0 > maxDiskUsage)
bSpaceAvail = false;
}
#else
struct statfs fStats;
int rc = statfs(fileName.c_str(), &fStats);
@ -2596,7 +2565,6 @@ bool FileOp::isDiskSpaceAvail(const std::string& fileName, int nBlocks) const
//"; bAvail: " << bSpaceAvail << std::endl;
}
#endif
}
return bSpaceAvail;

View File

@ -27,15 +27,6 @@
#include <map>
#include <boost/thread.hpp>
#ifdef _MSC_VER
#include <direct.h>
#define S_IRWXU 0
#define S_IRWXG 0
#ifndef S_IROTH
#define S_IROTH 0
#endif
#define S_IXOTH 0
#endif
#include "we_blockop.h"
#include "we_brm.h"
@ -44,11 +35,7 @@
#include "idbcompress.h"
#include "calpontsystemcatalog.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#define MAX_NBLOCKS 8192

View File

@ -70,11 +70,7 @@ void Log::formatMsg(const std::string& msg, MsgLevel level, std::ostringstream&
if (isDebug(DEBUG_2))
{
oss << " (" << m_pid << ":" <<
#ifdef _MSC_VER
GetCurrentThreadId()
#else
pthread_self()
#endif
<< ") " << MSG_LEVEL_STR[level] << " : " << msg;
}
else
@ -155,19 +151,6 @@ void Log::setLogFileName(const char* logfile, const char* errlogfile, bool conso
m_logFileName = logfile;
m_errlogFileName = errlogfile;
m_bConsoleOutput = consoleFlag;
#ifdef _MSC_VER
// cpimport.bin calls BulkLoad::loadJobInfo() before calling
// BulkLoad::processJob(). loadJobInfo() attempts to write to this log
// before it's opened (by processJob()). This doesn't seem to bother Linux
// but puts Windows in a bad state. Once this logic is fixed, this hack can
// go away.
// This code probably wouldn't hurt if run on Linux, but I'll leave this
// here as a reminder to fix the logic for all platforms.
m_logFile.close();
m_logFile.clear();
m_errLogFile.close();
m_errLogFile.clear();
#endif
m_logFile.open(m_logFileName.c_str(), std::ofstream::out | std::ofstream::app);
m_errLogFile.open(m_errlogFileName.c_str(), std::ofstream::out | std::ofstream::app);
}

View File

@ -35,11 +35,7 @@
#include <boost/thread.hpp>
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -1147,13 +1147,6 @@ int RBMetaWriter::writeHWMChunk(bool bColumnFile, // is this a column (vs dic
// IDBDataFile flush() does a sync where appropriate
delete backupFile;
#ifdef _MSC_VER
// Windows rename() behaves differently from Linux: it will return an error
// if the target exists
// FIXME: The Linux version seems a bit safer, perhaps implement a better
// Windows port?
unlink(fileName.c_str());
#endif
// Rename HWM backup file to final name.
if (fs.rename(fileNameTmp.c_str(), fileName.c_str()))

View File

@ -40,11 +40,7 @@
#include "brmtypes.h"
#include "we_fileop.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
#define DBROOT_BULK_ROLLBACK_SUBDIR "bulkRollback"

View File

@ -28,11 +28,7 @@
#include "messagelog.h"
#include "messageobj.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -43,9 +43,6 @@ using namespace messageqcpp;
#include <fstream>
#include <istream>
#include <list>
#ifdef _MSC_VER
#include <io.h>
#endif
using namespace std;
#include "we_filereadthread.h"
@ -554,19 +551,6 @@ void WEFileReadThread::openInFile()
fInFile.rdbuf(fIfFile.rdbuf()); //@BUG 4326
}
#ifdef _MSC_VER
else // @bug 5193: binary import
{
if (fSdh.getImportDataMode() != IMPORT_DATA_TEXT)
{
if (_setmode(_fileno(stdin), _O_BINARY) == -1)
{
throw runtime_error("Could not change stdin to binary");
}
}
}
#endif
//@BUG 4326 -below three lines commented out
// if (!fInFile.is_open()) fInFile.open(fInFileName.c_str());
// if (!fInFile.good())

View File

@ -151,9 +151,6 @@ WESplitterApp::~WESplitterApp()
void WESplitterApp::setupSignalHandlers()
{
#ifdef _MSC_VER
// FIXME
#else
struct sigaction sa;
memset(&sa, 0, sizeof(sa));
sa.sa_handler = WESplitterApp::onSigInterrupt;
@ -171,7 +168,6 @@ void WESplitterApp::setupSignalHandlers()
signal(SIGINT, WESplitterApp::onSigInterrupt);
signal(SIGTERM, WESplitterApp::onSigTerminate);
signal(SIGHUP, WESplitterApp::onSigHup); */
#endif
}
//------------------------------------------------------------------------------
// handles on signal Terminate

View File

@ -29,11 +29,7 @@
#include "we_tablemetadata.h"
#include "../dictionary/we_dctnry.h"
#include "stopwatch.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -27,11 +27,7 @@
#include "we_chunkmanager.h"
#include "calpontsystemcatalog.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -25,11 +25,7 @@
#include "../dictionary/we_dctnry.h"
#include "we_chunkmanager.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine

View File

@ -27,11 +27,7 @@
#include <map>
#include <vector>
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{

View File

@ -65,9 +65,6 @@ using namespace idbdatafile;
#include "dataconvert.h"
#include "string_prefixes.h"
#ifdef _MSC_VER
#define isnan _isnan
#endif
namespace WriteEngine
//#define PROFILE 1

View File

@ -29,11 +29,7 @@
#include <fcntl.h>
// end
#include <boost/lexical_cast.hpp>
#ifdef _MSC_VER
#include <unordered_set>
#else
#include <tr1/unordered_set>
#endif
#include "we_brm.h"
#include "we_colop.h"
@ -46,11 +42,7 @@
#define IO_BUFF_SIZE 81920
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine
{

View File

@ -35,24 +35,12 @@ namespace WriteEngine
{
/* static */ const std::string XMLGenData::DELIMITER("-d");
/* static */ const std::string XMLGenData::DESCRIPTION("-s");
#ifdef _MSC_VER
__declspec(dllexport)
#endif
/* static */ const std::string XMLGenData::ENCLOSED_BY_CHAR("-E");
#ifdef _MSC_VER
__declspec(dllexport)
#endif
/* static */ const std::string XMLGenData::ESCAPE_CHAR("-C");
#ifdef _MSC_VER
__declspec(dllexport)
#endif
/* static */ const std::string XMLGenData::JOBID("-j");
/* static */ const std::string XMLGenData::MAXERROR("-e");
/* static */ const std::string XMLGenData::NAME("-n");
/* static */ const std::string XMLGenData::PATH("-p");
#ifdef _MSC_VER
__declspec(dllexport)
#endif
/* static */ const std::string XMLGenData::RPT_DEBUG("-b");
/* static */ const std::string XMLGenData::USER("-u");
/* static */ const std::string XMLGenData::NO_OF_READ_BUFFER("-r");
@ -73,13 +61,7 @@ XMLGenData::XMLGenData()
fParms.insert(ParmList::value_type(JOBID, std::string("299")));
fParms.insert(ParmList::value_type(MAXERROR, std::string("10")));
fParms.insert(ParmList::value_type(NAME, std::string()));
#ifdef _MSC_VER
std::string br;
br = Config::getBulkRoot();
boost::filesystem::path p(br);
#else
boost::filesystem::path p{std::string(Config::getBulkRoot())};
#endif
p /= JOBDIR;
fParms.insert(ParmList::value_type(PATH, p.string()));

View File

@ -28,11 +28,7 @@
#include <map>
#include "calpontsystemcatalog.h"
#if defined(_MSC_VER) && defined(WRITEENGINE_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{
@ -52,24 +48,12 @@ class XMLGenData
// Valid parms that can be stored and retrieved from XMLGenData
EXPORT const static std::string DELIMITER;
EXPORT const static std::string DESCRIPTION;
#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT)
__declspec(dllimport)
#endif
EXPORT const static std::string ENCLOSED_BY_CHAR;
#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT)
__declspec(dllimport)
#endif
EXPORT const static std::string ESCAPE_CHAR;
#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT)
__declspec(dllimport)
#endif
EXPORT const static std::string JOBID;
EXPORT const static std::string MAXERROR;
EXPORT const static std::string NAME;
EXPORT const static std::string PATH;
#if defined(_MSC_VER) && !defined(WRITEENGINE_DLLEXPORT)
__declspec(dllimport)
#endif
EXPORT const static std::string RPT_DEBUG;
EXPORT const static std::string USER;
EXPORT const static std::string NO_OF_READ_BUFFER;

View File

@ -424,11 +424,6 @@ std::string XMLGenProc::genJobXMLFileName() const
// If the filespec doesn't begin with a '/' (i.e. it's not an absolute path),
// attempt to make it absolute so that we can log the full pathname.
#ifdef _MSC_VER
// We won't worry about being so fancy in Windows, just print a relative
// path if so given
xmlFileName = p.string();
#else
if (!p.has_root_path())
{
@ -446,7 +441,6 @@ std::string XMLGenProc::genJobXMLFileName() const
xmlFileName = p.string();
}
#endif
return xmlFileName;
}

View File

@ -31,11 +31,7 @@
#include "we_log.h"
#include "we_xmlgendata.h"
#if defined(_MSC_VER) && defined(WRITEENGINEXMLGENPROC_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
namespace WriteEngine
{

View File

@ -1211,9 +1211,6 @@ int XMLJob::genJobXMLFileName(const string& sXMLJobDir, const string& jobDir, co
// attempt to make it absolute so that we can log the full pathname.
if (!xmlFilePath.has_root_path())
{
#ifdef _MSC_VER
// nothing else to do
#else
char cwdPath[4096];
char* err;
err = getcwd(cwdPath, sizeof(cwdPath));
@ -1225,7 +1222,6 @@ int XMLJob::genJobXMLFileName(const string& sXMLJobDir, const string& jobDir, co
string trailingPath(xmlFilePath.string());
xmlFilePath = cwdPath;
xmlFilePath /= trailingPath;
#endif
}
}

View File

@ -31,11 +31,7 @@
#include "we_xmlop.h"
#include "calpontsystemcatalog.h"
#if defined(_MSC_VER) && defined(xxxWRITEENGINEXMLJOB_DLLEXPORT)
#define EXPORT __declspec(dllexport)
#else
#define EXPORT
#endif
/** Namespace WriteEngine */
namespace WriteEngine