aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp15
-rw-r--r--vespalib/src/vespa/fastlib/io/bufferedfile.cpp7
-rw-r--r--vespalib/src/vespa/fastlib/io/bufferedfile.h7
-rw-r--r--vespalib/src/vespa/fastos/file.h39
-rw-r--r--vespalib/src/vespa/fastos/unix_file.cpp22
-rw-r--r--vespalib/src/vespa/fastos/unix_file.h5
6 files changed, 9 insertions, 86 deletions
diff --git a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
index f22f57979b4..7ee6a02d03e 100644
--- a/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
+++ b/searchcore/src/vespa/searchcore/proton/server/fileconfigmanager.cpp
@@ -94,9 +94,8 @@ class ConfigFile
{
using SP = std::shared_ptr<ConfigFile>;
- vespalib::string _name;
- time_t _modTime;
- std::vector<char> _content;
+ vespalib::string _name;
+ std::vector<char> _content;
public:
ConfigFile();
@@ -111,7 +110,6 @@ public:
ConfigFile::ConfigFile()
: _name(),
- _modTime(0),
_content()
{
}
@@ -120,7 +118,6 @@ ConfigFile::~ConfigFile() = default;
ConfigFile::ConfigFile(const vespalib::string &name, const vespalib::string &fullName)
: _name(name),
- _modTime(0),
_content()
{
FastOS_File file;
@@ -130,7 +127,6 @@ ConfigFile::ConfigFile(const vespalib::string &name, const vespalib::string &ful
int64_t fileSize = file.getSize();
_content.resize(fileSize);
file.ReadBuf(_content.data(), fileSize);
- _modTime = file.GetModificationTime();
}
nbostream &
@@ -138,7 +134,7 @@ ConfigFile::serialize(nbostream &stream) const
{
assert(strchr(_name.c_str(), '/') == nullptr);
stream << _name;
- stream << static_cast<int64_t>(_modTime);;
+ stream << int64_t(0ul); // Used to be modtime => unused
uint32_t sz = _content.size();
stream << sz;
stream.write(_content.data(), sz);
@@ -150,9 +146,8 @@ ConfigFile::deserialize(nbostream &stream)
{
stream >> _name;
assert(strchr(_name.c_str(), '/') == nullptr);
- int64_t modTime;
- stream >> modTime;
- _modTime = modTime;
+ int64_t unused_modTime;
+ stream >> unused_modTime;
uint32_t sz;
stream >> sz;
_content.resize(sz);
diff --git a/vespalib/src/vespa/fastlib/io/bufferedfile.cpp b/vespalib/src/vespa/fastlib/io/bufferedfile.cpp
index 31ca735a0bb..aecf08edf6b 100644
--- a/vespalib/src/vespa/fastlib/io/bufferedfile.cpp
+++ b/vespalib/src/vespa/fastlib/io/bufferedfile.cpp
@@ -107,13 +107,6 @@ Fast_BufferedFile::Sync()
return _file->Sync();
}
-time_t
-Fast_BufferedFile::GetModificationTime()
-{
- time_t retval = _file->GetModificationTime();
- return retval;
-}
-
void
Fast_BufferedFile::EnableDirectIO()
{
diff --git a/vespalib/src/vespa/fastlib/io/bufferedfile.h b/vespalib/src/vespa/fastlib/io/bufferedfile.h
index 48f90262ad9..2a5e0ec7535 100644
--- a/vespalib/src/vespa/fastlib/io/bufferedfile.h
+++ b/vespalib/src/vespa/fastlib/io/bufferedfile.h
@@ -172,12 +172,7 @@ public:
* Force completion of pending disk writes (flush cache).
*/
[[nodiscard]] bool Sync() override;
- /**
- * Get the time the file was last modified.
- *
- * @return time_t The last modification time.
- */
- time_t GetModificationTime() override;
+
/**
* Turn on direct IO.
*/
diff --git a/vespalib/src/vespa/fastos/file.h b/vespalib/src/vespa/fastos/file.h
index 146127d4fe6..371a43e27b6 100644
--- a/vespalib/src/vespa/fastos/file.h
+++ b/vespalib/src/vespa/fastos/file.h
@@ -10,7 +10,7 @@
#pragma once
-#include <cstdint>
+#include <vespa/vespalib/util/time.h>
#include <string>
#define FASTOS_PREFIX(a) FastOS_##a
@@ -101,12 +101,6 @@ public:
void setFAdviseOptions(int options) { _fAdviseOptions = options; }
/**
- * Return path separator string. This will yield "/" on UNIX systems.
- * @return pointer to path separator character string
- */
- static const char *GetPathSeparator() { return "/"; }
-
- /**
* Constructor. A filename could be supplied at this point, or specified
* later using @ref SetFileName() or @ref Open().
* @param filename a filename (optional)
@@ -344,12 +338,6 @@ public:
int64_t getSize() const { return const_cast<FastOS_FileInterface *>(this)->GetSize(); }
/**
- * Return the time when file was last modified.
- * @return time of last modification
- */
- virtual time_t GetModificationTime() = 0;
-
- /**
* Delete the file. This method requires that the file is
* currently not opened.
* @return Boolean success/failure
@@ -413,10 +401,6 @@ public:
bool useSyncWrites() const { return _syncWritesEnabled; }
- /**
- * Set the write chunk size used in WriteBuf.
- */
- void setChunkSize(size_t chunkSize) { _chunkSize = chunkSize; }
size_t getChunkSize() const { return _chunkSize; }
/**
@@ -652,14 +636,12 @@ public:
*/
class FastOS_DirectoryScanInterface
{
-private:
- FastOS_DirectoryScanInterface(const FastOS_DirectoryScanInterface&);
- FastOS_DirectoryScanInterface& operator= (const FastOS_DirectoryScanInterface&);
-
protected:
std::string _searchPath;
public:
+ FastOS_DirectoryScanInterface(const FastOS_DirectoryScanInterface&) = delete;
+ FastOS_DirectoryScanInterface& operator= (const FastOS_DirectoryScanInterface&) = delete;
/**
* Constructor.
@@ -677,13 +659,6 @@ public:
virtual ~FastOS_DirectoryScanInterface();
/**
- * Get search path.
- * This is an internal copy of the path specified in the constructor.
- * @return Search path string.
- */
- const char *GetSearchPath () { return _searchPath.c_str(); }
-
- /**
* Read the next entry in the directory scan. Failure indicates
* that there are no more entries. If the call is successful,
* attributes for the entry can be read with @ref IsDirectory(),
@@ -726,14 +701,6 @@ public:
* @return A pointer to the recently read directory entry.
*/
virtual const char *GetName() = 0;
-
- /**
- * Check whether the creation of a directory scan succeeded or
- * failed (e.g. due to resource constraints).
- *
- * return True if the directory scan is valid.
- */
- virtual bool IsValidScan() const = 0;
};
#ifdef __linux__
diff --git a/vespalib/src/vespa/fastos/unix_file.cpp b/vespalib/src/vespa/fastos/unix_file.cpp
index 7c4cde19125..417129c99b3 100644
--- a/vespalib/src/vespa/fastos/unix_file.cpp
+++ b/vespalib/src/vespa/fastos/unix_file.cpp
@@ -344,21 +344,6 @@ FastOS_UNIX_File::GetSize()
return fileSize;
}
-
-time_t
-FastOS_UNIX_File::GetModificationTime()
-{
- struct stat stbuf{};
- assert(IsOpened());
-
- int res = fstat(_filedes, &stbuf);
- assert(res == 0);
- (void) res;
-
- return stbuf.st_mtime;
-}
-
-
bool
FastOS_UNIX_File::Delete(const char *name)
{
@@ -581,10 +566,3 @@ FastOS_UNIX_DirectoryScan::GetName()
return static_cast<const char *>(_dp->d_name);
}
-
-
-bool
-FastOS_UNIX_DirectoryScan::IsValidScan() const
-{
- return _dir != nullptr;
-}
diff --git a/vespalib/src/vespa/fastos/unix_file.h b/vespalib/src/vespa/fastos/unix_file.h
index 31e45f8d2fa..3d1f6b9db3f 100644
--- a/vespalib/src/vespa/fastos/unix_file.h
+++ b/vespalib/src/vespa/fastos/unix_file.h
@@ -82,7 +82,6 @@ public:
bool SetPosition(int64_t desiredPosition) override;
int64_t GetPosition() override;
int64_t GetSize() override;
- time_t GetModificationTime() override;
bool Delete() override;
[[nodiscard]] bool Sync() override;
bool SetSize(int64_t newSize) override;
@@ -103,9 +102,6 @@ public:
class FastOS_UNIX_DirectoryScan : public FastOS_DirectoryScanInterface
{
private:
- FastOS_UNIX_DirectoryScan(const FastOS_UNIX_DirectoryScan&);
- FastOS_UNIX_DirectoryScan& operator=(const FastOS_UNIX_DirectoryScan&);
-
bool _statRun;
bool _isDirectory;
bool _isRegular;
@@ -126,5 +122,4 @@ public:
bool IsDirectory() override;
bool IsRegular() override;
const char *GetName() override;
- bool IsValidScan() const override;
};