summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
Diffstat (limited to 'ndb')
-rw-r--r--ndb/include/transporter/TransporterRegistry.hpp7
-rw-r--r--ndb/src/common/transporter/SCI_Transporter.cpp9
-rw-r--r--ndb/src/common/transporter/SCI_Transporter.hpp3
-rw-r--r--ndb/src/common/transporter/SHM_Buffer.hpp17
-rw-r--r--ndb/src/common/transporter/SHM_Transporter.cpp6
-rw-r--r--ndb/src/common/transporter/SHM_Transporter.hpp2
-rw-r--r--ndb/src/common/transporter/SendBuffer.cpp2
-rw-r--r--ndb/src/common/transporter/SendBuffer.hpp2
-rw-r--r--ndb/src/common/transporter/TCP_Transporter.cpp5
-rw-r--r--ndb/src/common/transporter/TCP_Transporter.hpp1
-rw-r--r--ndb/src/common/transporter/Transporter.hpp2
-rw-r--r--ndb/src/common/transporter/TransporterRegistry.cpp12
-rw-r--r--ndb/src/mgmsrv/ConfigInfo.cpp4
13 files changed, 63 insertions, 9 deletions
diff --git a/ndb/include/transporter/TransporterRegistry.hpp b/ndb/include/transporter/TransporterRegistry.hpp
index 7487d6b1e80..8bd1de39ed5 100644
--- a/ndb/include/transporter/TransporterRegistry.hpp
+++ b/ndb/include/transporter/TransporterRegistry.hpp
@@ -178,6 +178,13 @@ public:
bool createTransporter(struct SCI_TransporterConfiguration * config);
bool createTransporter(struct SHM_TransporterConfiguration * config);
bool createTransporter(struct OSE_TransporterConfiguration * config);
+
+ /**
+ * Get free buffer space
+ *
+ * Get #free bytes in send buffer for <em>node</node>
+ */
+ Uint32 get_free_buffer(Uint32 node) const ;
/**
* prepareSend
diff --git a/ndb/src/common/transporter/SCI_Transporter.cpp b/ndb/src/common/transporter/SCI_Transporter.cpp
index e7807c972b1..47722939098 100644
--- a/ndb/src/common/transporter/SCI_Transporter.cpp
+++ b/ndb/src/common/transporter/SCI_Transporter.cpp
@@ -1023,7 +1023,8 @@ SCI_Transporter::initSCI() {
DBUG_RETURN(true);
}
-
-
-
-
+Uint32
+SCI_Transporter::get_free_buffer() const
+{
+ return (m_TargetSegm[m_ActiveAdapterId].writer)->get_free_buffer();
+}
diff --git a/ndb/src/common/transporter/SCI_Transporter.hpp b/ndb/src/common/transporter/SCI_Transporter.hpp
index e2f2dfcaf99..e62c142e1b9 100644
--- a/ndb/src/common/transporter/SCI_Transporter.hpp
+++ b/ndb/src/common/transporter/SCI_Transporter.hpp
@@ -133,7 +133,8 @@ public:
* remote segment is mapped. Otherwize false.
*/
bool getConnectionStatus();
-
+
+ virtual Uint32 get_free_buffer() const;
private:
SCI_Transporter(TransporterRegistry &t_reg,
const char *local_host,
diff --git a/ndb/src/common/transporter/SHM_Buffer.hpp b/ndb/src/common/transporter/SHM_Buffer.hpp
index f49b4fe73cb..27321a3191f 100644
--- a/ndb/src/common/transporter/SHM_Buffer.hpp
+++ b/ndb/src/common/transporter/SHM_Buffer.hpp
@@ -157,6 +157,7 @@ public:
inline Uint32 getWriteIndex() const { return m_writeIndex;}
inline Uint32 getBufferSize() const { return m_bufferSize;}
+ inline Uint32 get_free_buffer() const;
inline void copyIndexes(SHM_Writer * standbyWriter);
@@ -212,5 +213,21 @@ SHM_Writer::updateWritePtr(Uint32 sz){
m_writeIndex = tWriteIndex;
* m_sharedWriteIndex = tWriteIndex;
}
+
+inline
+Uint32
+SHM_Writer::get_free_buffer() const
+{
+ Uint32 tReadIndex = * m_sharedReadIndex;
+ Uint32 tWriteIndex = m_writeIndex;
+
+ Uint32 free;
+ if(tReadIndex <= tWriteIndex){
+ free = m_bufferSize + tReadIndex - tWriteIndex;
+ } else {
+ free = tReadIndex - tWriteIndex;
+ }
+ return free;
+}
#endif
diff --git a/ndb/src/common/transporter/SHM_Transporter.cpp b/ndb/src/common/transporter/SHM_Transporter.cpp
index eed3ad77be6..4d7f46d7723 100644
--- a/ndb/src/common/transporter/SHM_Transporter.cpp
+++ b/ndb/src/common/transporter/SHM_Transporter.cpp
@@ -362,3 +362,9 @@ SHM_Transporter::doSend()
kill(m_remote_pid, g_ndb_shm_signum);
}
}
+
+Uint32
+SHM_Transporter::get_free_buffer() const
+{
+ return writer->get_free_buffer();
+}
diff --git a/ndb/src/common/transporter/SHM_Transporter.hpp b/ndb/src/common/transporter/SHM_Transporter.hpp
index b501f652168..7079e12a924 100644
--- a/ndb/src/common/transporter/SHM_Transporter.hpp
+++ b/ndb/src/common/transporter/SHM_Transporter.hpp
@@ -137,6 +137,8 @@ protected:
int m_remote_pid;
Uint32 m_last_signal;
Uint32 m_signal_threshold;
+
+ virtual Uint32 get_free_buffer() const;
private:
bool _shmSegCreated;
diff --git a/ndb/src/common/transporter/SendBuffer.cpp b/ndb/src/common/transporter/SendBuffer.cpp
index 58cad96931f..8f69eb4bd40 100644
--- a/ndb/src/common/transporter/SendBuffer.cpp
+++ b/ndb/src/common/transporter/SendBuffer.cpp
@@ -60,7 +60,7 @@ SendBuffer::bufferSize() {
}
Uint32
-SendBuffer::bufferSizeRemaining() {
+SendBuffer::bufferSizeRemaining() const {
return (sizeOfBuffer - dataSize);
}
diff --git a/ndb/src/common/transporter/SendBuffer.hpp b/ndb/src/common/transporter/SendBuffer.hpp
index 63a01f3de24..7ebeb6d890e 100644
--- a/ndb/src/common/transporter/SendBuffer.hpp
+++ b/ndb/src/common/transporter/SendBuffer.hpp
@@ -51,7 +51,7 @@ public:
bool initBuffer(Uint32 aRemoteNodeId);
// Number of bytes remaining in the buffer
- Uint32 bufferSizeRemaining();
+ Uint32 bufferSizeRemaining() const;
// Number of bytes of data in the buffer
int bufferSize();
diff --git a/ndb/src/common/transporter/TCP_Transporter.cpp b/ndb/src/common/transporter/TCP_Transporter.cpp
index a629b620157..5003d90a4b4 100644
--- a/ndb/src/common/transporter/TCP_Transporter.cpp
+++ b/ndb/src/common/transporter/TCP_Transporter.cpp
@@ -250,6 +250,11 @@ TCP_Transporter::sendIsPossible(struct timeval * timeout) {
#endif
}
+Uint32
+TCP_Transporter::get_free_buffer() const
+{
+ return m_sendBuffer.bufferSizeRemaining();
+}
Uint32 *
TCP_Transporter::getWritePtr(Uint32 lenBytes, Uint32 prio){
diff --git a/ndb/src/common/transporter/TCP_Transporter.hpp b/ndb/src/common/transporter/TCP_Transporter.hpp
index 48046310bf8..151ec261506 100644
--- a/ndb/src/common/transporter/TCP_Transporter.hpp
+++ b/ndb/src/common/transporter/TCP_Transporter.hpp
@@ -99,6 +99,7 @@ private:
*/
virtual void updateReceiveDataPtr(Uint32 bytesRead);
+ virtual Uint32 get_free_buffer() const;
protected:
/**
* Setup client/server and perform connect/accept
diff --git a/ndb/src/common/transporter/Transporter.hpp b/ndb/src/common/transporter/Transporter.hpp
index baff6d53dd8..c3b0d144eaf 100644
--- a/ndb/src/common/transporter/Transporter.hpp
+++ b/ndb/src/common/transporter/Transporter.hpp
@@ -69,6 +69,8 @@ public:
*/
NodeId getLocalNodeId() const;
+ virtual Uint32 get_free_buffer() const = 0;
+
protected:
Transporter(TransporterRegistry &,
TransporterType,
diff --git a/ndb/src/common/transporter/TransporterRegistry.cpp b/ndb/src/common/transporter/TransporterRegistry.cpp
index 439730435ec..ac6161b314e 100644
--- a/ndb/src/common/transporter/TransporterRegistry.cpp
+++ b/ndb/src/common/transporter/TransporterRegistry.cpp
@@ -523,6 +523,18 @@ TransporterRegistry::removeTransporter(NodeId nodeId) {
theTransporters[nodeId] = NULL;
}
+Uint32
+TransporterRegistry::get_free_buffer(Uint32 node) const
+{
+ Transporter *t;
+ if(likely((t = theTransporters[node]) != 0))
+ {
+ return t->get_free_buffer();
+ }
+ return 0;
+}
+
+
SendStatus
TransporterRegistry::prepareSend(const SignalHeader * const signalHeader,
Uint8 prio,
diff --git a/ndb/src/mgmsrv/ConfigInfo.cpp b/ndb/src/mgmsrv/ConfigInfo.cpp
index a0ace4b30db..4612d17c9ce 100644
--- a/ndb/src/mgmsrv/ConfigInfo.cpp
+++ b/ndb/src/mgmsrv/ConfigInfo.cpp
@@ -1656,7 +1656,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::CI_INT,
"256K",
- "16K",
+ "64K",
STR_VALUE(MAX_INT_RNIL) },
{
@@ -1844,7 +1844,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false,
ConfigInfo::CI_INT,
"1M",
- "4K",
+ "64K",
STR_VALUE(MAX_INT_RNIL) },
{