Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
60d3e60e
Commit
60d3e60e
authored
May 25, 2005
by
joreland@mysql.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndb - Embryo of overload protection
Add method to query free send buffer size
parent
5189e9dd
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
63 additions
and
9 deletions
+63
-9
ndb/include/transporter/TransporterRegistry.hpp
ndb/include/transporter/TransporterRegistry.hpp
+7
-0
ndb/src/common/transporter/SCI_Transporter.cpp
ndb/src/common/transporter/SCI_Transporter.cpp
+5
-4
ndb/src/common/transporter/SCI_Transporter.hpp
ndb/src/common/transporter/SCI_Transporter.hpp
+2
-1
ndb/src/common/transporter/SHM_Buffer.hpp
ndb/src/common/transporter/SHM_Buffer.hpp
+17
-0
ndb/src/common/transporter/SHM_Transporter.cpp
ndb/src/common/transporter/SHM_Transporter.cpp
+6
-0
ndb/src/common/transporter/SHM_Transporter.hpp
ndb/src/common/transporter/SHM_Transporter.hpp
+2
-0
ndb/src/common/transporter/SendBuffer.cpp
ndb/src/common/transporter/SendBuffer.cpp
+1
-1
ndb/src/common/transporter/SendBuffer.hpp
ndb/src/common/transporter/SendBuffer.hpp
+1
-1
ndb/src/common/transporter/TCP_Transporter.cpp
ndb/src/common/transporter/TCP_Transporter.cpp
+5
-0
ndb/src/common/transporter/TCP_Transporter.hpp
ndb/src/common/transporter/TCP_Transporter.hpp
+1
-0
ndb/src/common/transporter/Transporter.hpp
ndb/src/common/transporter/Transporter.hpp
+2
-0
ndb/src/common/transporter/TransporterRegistry.cpp
ndb/src/common/transporter/TransporterRegistry.cpp
+12
-0
ndb/src/mgmsrv/ConfigInfo.cpp
ndb/src/mgmsrv/ConfigInfo.cpp
+2
-2
No files found.
ndb/include/transporter/TransporterRegistry.hpp
View file @
60d3e60e
...
...
@@ -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
...
...
ndb/src/common/transporter/SCI_Transporter.cpp
View file @
60d3e60e
...
...
@@ -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
();
}
ndb/src/common/transporter/SCI_Transporter.hpp
View file @
60d3e60e
...
...
@@ -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
,
...
...
ndb/src/common/transporter/SHM_Buffer.hpp
View file @
60d3e60e
...
...
@@ -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
ndb/src/common/transporter/SHM_Transporter.cpp
View file @
60d3e60e
...
...
@@ -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
();
}
ndb/src/common/transporter/SHM_Transporter.hpp
View file @
60d3e60e
...
...
@@ -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
;
...
...
ndb/src/common/transporter/SendBuffer.cpp
View file @
60d3e60e
...
...
@@ -60,7 +60,7 @@ SendBuffer::bufferSize() {
}
Uint32
SendBuffer
::
bufferSizeRemaining
()
{
SendBuffer
::
bufferSizeRemaining
()
const
{
return
(
sizeOfBuffer
-
dataSize
);
}
...
...
ndb/src/common/transporter/SendBuffer.hpp
View file @
60d3e60e
...
...
@@ -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
();
...
...
ndb/src/common/transporter/TCP_Transporter.cpp
View file @
60d3e60e
...
...
@@ -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
){
...
...
ndb/src/common/transporter/TCP_Transporter.hpp
View file @
60d3e60e
...
...
@@ -99,6 +99,7 @@ private:
*/
virtual
void
updateReceiveDataPtr
(
Uint32
bytesRead
);
virtual
Uint32
get_free_buffer
()
const
;
protected:
/**
* Setup client/server and perform connect/accept
...
...
ndb/src/common/transporter/Transporter.hpp
View file @
60d3e60e
...
...
@@ -69,6 +69,8 @@ public:
*/
NodeId
getLocalNodeId
()
const
;
virtual
Uint32
get_free_buffer
()
const
=
0
;
protected:
Transporter
(
TransporterRegistry
&
,
TransporterType
,
...
...
ndb/src/common/transporter/TransporterRegistry.cpp
View file @
60d3e60e
...
...
@@ -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
,
...
...
ndb/src/mgmsrv/ConfigInfo.cpp
View file @
60d3e60e
...
...
@@ -1656,7 +1656,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false
,
ConfigInfo
::
CI_INT
,
"256K"
,
"
16
K"
,
"
64
K"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
{
...
...
@@ -1844,7 +1844,7 @@ const ConfigInfo::ParamInfo ConfigInfo::m_ParamInfo[] = {
false
,
ConfigInfo
::
CI_INT
,
"1M"
,
"4K"
,
"
6
4K"
,
STR_VALUE
(
MAX_INT_RNIL
)
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment