|
@@ -408,11 +408,11 @@ public:
|
|
void unregisterWriteCallback(IWritePosCallback &cb);
|
|
void unregisterWriteCallback(IWritePosCallback &cb);
|
|
inline void setAllowNulls(bool b) { CThorExpandingRowArray::setAllowNulls(b); }
|
|
inline void setAllowNulls(bool b) { CThorExpandingRowArray::setAllowNulls(b); }
|
|
void kill();
|
|
void kill();
|
|
- void clearRows();
|
|
|
|
void compact();
|
|
void compact();
|
|
void flush();
|
|
void flush();
|
|
- inline bool append(const void *row)
|
|
|
|
|
|
+ inline bool append(const void *row) __attribute__((warn_unused_result))
|
|
{
|
|
{
|
|
|
|
+ //GH->JCS Should this really be inline?
|
|
assertex(row || allowNulls);
|
|
assertex(row || allowNulls);
|
|
if (numRows >= maxRows)
|
|
if (numRows >= maxRows)
|
|
{
|
|
{
|
|
@@ -430,36 +430,26 @@ public:
|
|
}
|
|
}
|
|
bool appendRows(CThorExpandingRowArray &inRows, bool takeOwnership);
|
|
bool appendRows(CThorExpandingRowArray &inRows, bool takeOwnership);
|
|
|
|
|
|
- //The following can be accessed from the reader without any need to lock
|
|
|
|
|
|
+ //The following must either be accessed within a lock, or when no rows can be appended,
|
|
|
|
+ //(otherwise flush() might move all the rows, invalidating the indexes - or for query() the row)
|
|
inline const void *query(rowidx_t i) const
|
|
inline const void *query(rowidx_t i) const
|
|
{
|
|
{
|
|
- CThorArrayLockBlock block(*this);
|
|
|
|
return CThorExpandingRowArray::query(i);
|
|
return CThorExpandingRowArray::query(i);
|
|
}
|
|
}
|
|
inline const void *get(rowidx_t i) const
|
|
inline const void *get(rowidx_t i) const
|
|
{
|
|
{
|
|
- CThorArrayLockBlock block(*this);
|
|
|
|
return CThorExpandingRowArray::get(i);
|
|
return CThorExpandingRowArray::get(i);
|
|
}
|
|
}
|
|
inline const void *getClear(rowidx_t i)
|
|
inline const void *getClear(rowidx_t i)
|
|
{
|
|
{
|
|
- CThorArrayLockBlock block(*this);
|
|
|
|
return CThorExpandingRowArray::getClear(i);
|
|
return CThorExpandingRowArray::getClear(i);
|
|
}
|
|
}
|
|
|
|
|
|
//A thread calling the following functions must own the lock, or guarantee no other thread will access
|
|
//A thread calling the following functions must own the lock, or guarantee no other thread will access
|
|
void sort(ICompare & compare, unsigned maxcores);
|
|
void sort(ICompare & compare, unsigned maxcores);
|
|
rowidx_t save(IFile &file, bool useCompression);
|
|
rowidx_t save(IFile &file, bool useCompression);
|
|
- const void **getBlock(rowidx_t readRows);
|
|
|
|
- inline void noteSpilled(rowidx_t spilledRows)
|
|
|
|
- {
|
|
|
|
- firstRow += spilledRows;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- //The block returned is only valid until the critical section is released
|
|
|
|
|
|
|
|
- inline rowidx_t firstCommitted() const { return firstRow; }
|
|
|
|
- inline rowidx_t numCommitted() const { return commitRows - firstRow; }
|
|
|
|
|
|
+ inline rowidx_t numCommitted() const { return commitRows - firstRow; } //MORE::Not convinced this is very safe!
|
|
|
|
|
|
// access to
|
|
// access to
|
|
void swap(CThorSpillableRowArray &src);
|
|
void swap(CThorSpillableRowArray &src);
|
|
@@ -489,11 +479,16 @@ public:
|
|
void deserializeRow(IRowDeserializerSource &in) { CThorExpandingRowArray::deserializeRow(in); }
|
|
void deserializeRow(IRowDeserializerSource &in) { CThorExpandingRowArray::deserializeRow(in); }
|
|
bool ensure(rowidx_t requiredRows) { return CThorExpandingRowArray::ensure(requiredRows); }
|
|
bool ensure(rowidx_t requiredRows) { return CThorExpandingRowArray::ensure(requiredRows); }
|
|
void transferRowsCopy(const void **outRows, bool takeOwnership);
|
|
void transferRowsCopy(const void **outRows, bool takeOwnership);
|
|
|
|
+ void readBlock(const void **outRows, rowidx_t readRows);
|
|
|
|
|
|
virtual IThorArrayLock &queryLock() { return *this; }
|
|
virtual IThorArrayLock &queryLock() { return *this; }
|
|
// IThorArrayLock
|
|
// IThorArrayLock
|
|
virtual void lock() const { cs.enter(); }
|
|
virtual void lock() const { cs.enter(); }
|
|
virtual void unlock() const { cs.leave(); }
|
|
virtual void unlock() const { cs.leave(); }
|
|
|
|
+
|
|
|
|
+private:
|
|
|
|
+ void clearRows();
|
|
|
|
+ const void **getBlock(rowidx_t readRows);
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|