You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
clang format apply
This commit is contained in:
@ -24,95 +24,94 @@ using namespace std;
|
||||
|
||||
namespace idbdatafile
|
||||
{
|
||||
|
||||
SMFileSystem::SMFileSystem() : IDBFileSystem(IDBFileSystem::CLOUD)
|
||||
{
|
||||
SMComm::get(); // get SMComm running
|
||||
SMComm::get(); // get SMComm running
|
||||
}
|
||||
|
||||
SMFileSystem::~SMFileSystem()
|
||||
{
|
||||
}
|
||||
|
||||
int SMFileSystem::mkdir(const char *path)
|
||||
int SMFileSystem::mkdir(const char* path)
|
||||
{
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
off64_t SMFileSystem::size(const char *filename) const
|
||||
off64_t SMFileSystem::size(const char* filename) const
|
||||
{
|
||||
struct stat _stat;
|
||||
|
||||
SMComm *smComm = SMComm::get();
|
||||
int err = smComm->stat(filename, &_stat);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return _stat.st_size;
|
||||
}
|
||||
struct stat _stat;
|
||||
|
||||
off64_t SMFileSystem::compressedSize(const char *filename) const
|
||||
{
|
||||
// Yikes, punting on this one.
|
||||
throw NotImplementedYet(__func__);
|
||||
}
|
||||
|
||||
int SMFileSystem::remove(const char *filename)
|
||||
{
|
||||
SMComm *comm = SMComm::get();
|
||||
return comm->unlink(filename);
|
||||
}
|
||||
|
||||
int SMFileSystem::rename(const char *oldFile, const char *newFile)
|
||||
{
|
||||
int err = copyFile(oldFile, newFile);
|
||||
if (err)
|
||||
return err;
|
||||
err = this->remove(oldFile);
|
||||
SMComm* smComm = SMComm::get();
|
||||
int err = smComm->stat(filename, &_stat);
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
return _stat.st_size;
|
||||
}
|
||||
|
||||
bool SMFileSystem::exists(const char *filename) const
|
||||
off64_t SMFileSystem::compressedSize(const char* filename) const
|
||||
{
|
||||
struct stat _stat;
|
||||
SMComm *comm = SMComm::get();
|
||||
|
||||
int err = comm->stat(filename, &_stat);
|
||||
return (err == 0);
|
||||
// Yikes, punting on this one.
|
||||
throw NotImplementedYet(__func__);
|
||||
}
|
||||
|
||||
int SMFileSystem::remove(const char* filename)
|
||||
{
|
||||
SMComm* comm = SMComm::get();
|
||||
return comm->unlink(filename);
|
||||
}
|
||||
|
||||
int SMFileSystem::rename(const char* oldFile, const char* newFile)
|
||||
{
|
||||
int err = copyFile(oldFile, newFile);
|
||||
if (err)
|
||||
return err;
|
||||
err = this->remove(oldFile);
|
||||
return err;
|
||||
}
|
||||
|
||||
bool SMFileSystem::exists(const char* filename) const
|
||||
{
|
||||
struct stat _stat;
|
||||
SMComm* comm = SMComm::get();
|
||||
|
||||
int err = comm->stat(filename, &_stat);
|
||||
return (err == 0);
|
||||
}
|
||||
|
||||
int SMFileSystem::listDirectory(const char* pathname, std::list<std::string>& contents) const
|
||||
{
|
||||
SMComm *comm = SMComm::get();
|
||||
return comm->listDirectory(pathname, &contents);
|
||||
SMComm* comm = SMComm::get();
|
||||
return comm->listDirectory(pathname, &contents);
|
||||
}
|
||||
|
||||
bool SMFileSystem::isDir(const char *path) const
|
||||
bool SMFileSystem::isDir(const char* path) const
|
||||
{
|
||||
SMComm *comm = SMComm::get();
|
||||
struct stat _stat;
|
||||
|
||||
int err = comm->stat(path, &_stat);
|
||||
if (err != 0)
|
||||
return false; // reasonable to throw here? todo, look at what the other classes do.
|
||||
return (_stat.st_mode & S_IFDIR);
|
||||
SMComm* comm = SMComm::get();
|
||||
struct stat _stat;
|
||||
|
||||
int err = comm->stat(path, &_stat);
|
||||
if (err != 0)
|
||||
return false; // reasonable to throw here? todo, look at what the other classes do.
|
||||
return (_stat.st_mode & S_IFDIR);
|
||||
}
|
||||
|
||||
int SMFileSystem::copyFile(const char *src, const char *dest) const
|
||||
int SMFileSystem::copyFile(const char* src, const char* dest) const
|
||||
{
|
||||
SMComm *comm = SMComm::get();
|
||||
return comm->copyFile(src, dest);
|
||||
SMComm* comm = SMComm::get();
|
||||
return comm->copyFile(src, dest);
|
||||
}
|
||||
|
||||
|
||||
bool SMFileSystem::filesystemIsUp() const
|
||||
{
|
||||
SMComm *comm = SMComm::get();
|
||||
return (comm->ping() == 0);
|
||||
SMComm* comm = SMComm::get();
|
||||
return (comm->ping() == 0);
|
||||
}
|
||||
|
||||
bool SMFileSystem::filesystemSync() const
|
||||
{
|
||||
SMComm *comm = SMComm::get();
|
||||
return (comm->sync() == 0);
|
||||
}
|
||||
SMComm* comm = SMComm::get();
|
||||
return (comm->sync() == 0);
|
||||
}
|
||||
} // namespace idbdatafile
|
||||
|
Reference in New Issue
Block a user