summaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2016-10-13 14:20:29 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2016-10-14 14:17:16 +0000
commit38ed9c34c69b3e689ed0b5dd330dc9e0de8f7f14 (patch)
treece20ce387d3563ff361a3e69c61ff2cd1053dcb6 /searchlib
parent41c29e6db62176789c49fc47aacf06bb1bbad69f (diff)
remove unused PCODE_MONITORQUERY
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/tests/common/packets/packets_test.cpp4
-rw-r--r--searchlib/src/vespa/searchlib/common/packets.cpp45
-rw-r--r--searchlib/src/vespa/searchlib/common/packets.h8
-rw-r--r--searchlib/src/vespa/searchlib/common/transport.h5
4 files changed, 15 insertions, 47 deletions
diff --git a/searchlib/src/tests/common/packets/packets_test.cpp b/searchlib/src/tests/common/packets/packets_test.cpp
index d4f762960bc..86983a425ac 100644
--- a/searchlib/src/tests/common/packets/packets_test.cpp
+++ b/searchlib/src/tests/common/packets/packets_test.cpp
@@ -136,6 +136,10 @@ TEST("testPacketFactory") {
for (uint32_t pcode = PCODE_BEGIN; pcode < PCODE_END; ++pcode) {
if ((pcode != PCODE_MLD_QUERYRESULT2_NOTUSED) &&
(pcode != PCODE_QUERY_NOTUSED) &&
+ (pcode != PCODE_MONITORQUERY_NOTUSED) &&
+ (pcode != PCODE_CLEARCACHES_NOTUSED) &&
+ (pcode != PCODE_PARSEDQUERY2_NOTUSED) &&
+ (pcode != PCODE_QUEUELEN_NOTUSED) &&
(pcode != PCODE_QUERY2_NOTUSED) &&
(pcode != PCODE_MLD_GETDOCSUMS2_NOTUSED))
{
diff --git a/searchlib/src/vespa/searchlib/common/packets.cpp b/searchlib/src/vespa/searchlib/common/packets.cpp
index bce0b16cd46..8c746dac413 100644
--- a/searchlib/src/vespa/searchlib/common/packets.cpp
+++ b/searchlib/src/vespa/searchlib/common/packets.cpp
@@ -698,13 +698,11 @@ FS4Packet_DOCSUM::toString(uint32_t indent) const
//============================================================
-FS4Packet_MONITORQUERYX::FS4Packet_MONITORQUERYX(uint32_t pcode)
+FS4Packet_MONITORQUERYX::FS4Packet_MONITORQUERYX()
: FS4Packet(),
- _pcode(pcode),
_features(0),
_qflags(0u)
{
- UpdateCompatFeatures();
}
@@ -713,31 +711,12 @@ FS4Packet_MONITORQUERYX::~FS4Packet_MONITORQUERYX()
}
-void
-FS4Packet_MONITORQUERYX::UpdateCompatPCODE(void)
-{
- if (_features == search::fs4transport::MQF_MONITORQUERY_MASK)
- _pcode = search::fs4transport::PCODE_MONITORQUERY;
- else
- _pcode = search::fs4transport::PCODE_MONITORQUERYX;
-}
-
-
-void
-FS4Packet_MONITORQUERYX::UpdateCompatFeatures(void)
-{
- if (_pcode == search::fs4transport::PCODE_MONITORQUERY)
- _features = search::fs4transport::MQF_MONITORQUERY_MASK;
-}
-
-
uint32_t
FS4Packet_MONITORQUERYX::GetLength()
{
uint32_t plen = 0;
- if (_pcode == search::fs4transport::PCODE_MONITORQUERYX)
- plen += sizeof(uint32_t);
+ plen += sizeof(uint32_t);
if (_features & search::fs4transport::MQF_QFLAGS)
plen += sizeof(uint32_t);
return plen;
@@ -747,8 +726,7 @@ FS4Packet_MONITORQUERYX::GetLength()
void
FS4Packet_MONITORQUERYX::Encode(FNET_DataBuffer *dst)
{
- if (_pcode == search::fs4transport::PCODE_MONITORQUERYX)
- dst->WriteInt32Fast(_features);
+ dst->WriteInt32Fast(_features);
if ((_features & search::fs4transport::MQF_QFLAGS) != 0)
dst->WriteInt32Fast(_qflags);
@@ -758,12 +736,10 @@ FS4Packet_MONITORQUERYX::Encode(FNET_DataBuffer *dst)
bool
FS4Packet_MONITORQUERYX::Decode(FNET_DataBuffer *src, uint32_t len)
{
- if (_pcode == search::fs4transport::PCODE_MONITORQUERYX) {
- if (len < sizeof(uint32_t))
- goto error;
- _features = src->ReadInt32();
- len -= sizeof(uint32_t);
- }
+ if (len < sizeof(uint32_t))
+ goto error;
+ _features = src->ReadInt32();
+ len -= sizeof(uint32_t);
if ((_features & ~search::fs4transport::FNET_MQF_SUPPORTED_MASK) != 0)
goto error;
@@ -777,8 +753,7 @@ FS4Packet_MONITORQUERYX::Decode(FNET_DataBuffer *src, uint32_t len)
if (len != 0)
goto error;
- SetRealPCODE();
- return true; // OK
+ return true;
error:
src->DataToDead(len);
return false; // FAIL
@@ -790,7 +765,6 @@ FS4Packet_MONITORQUERYX::toString(uint32_t indent) const
{
vespalib::string s;
s += make_string("%*sFS4Packet_MONITORQUERYX {\n", indent, "");
- s += make_string("%*s pcode : %d\n", indent, "", _pcode);
s += make_string("%*s features : 0x%x\n", indent, "", _features);
s += make_string("%*s qflags : %d\n", indent, "", _qflags);
s += make_string("%*s}\n", indent, "");
@@ -2031,9 +2005,6 @@ FS4PacketFactory::CreateFS4Packet(uint32_t pcode)
PCODE_GETDOCSUMS);
case search::fs4transport::PCODE_DOCSUM:
return new FS4Packet_DOCSUM;
- case search::fs4transport::PCODE_MONITORQUERY:
- return new FS4Packet_MONITORQUERYX(search::fs4transport::
- PCODE_MONITORQUERY);
case search::fs4transport::PCODE_MONITORRESULT:
return new FS4Packet_MONITORRESULTX(search::fs4transport::
PCODE_MONITORRESULT);
diff --git a/searchlib/src/vespa/searchlib/common/packets.h b/searchlib/src/vespa/searchlib/common/packets.h
index ea50b034241..9e21bb630c6 100644
--- a/searchlib/src/vespa/searchlib/common/packets.h
+++ b/searchlib/src/vespa/searchlib/common/packets.h
@@ -321,17 +321,13 @@ class FS4Packet_MONITORQUERYX : public FS4Packet
FS4Packet_MONITORQUERYX(const FS4Packet_MONITORQUERYX &);
FS4Packet_MONITORQUERYX& operator=(const FS4Packet_MONITORQUERYX &);
- uint32_t _pcode;
public:
uint32_t _features; // see monitorquery_features
uint32_t _qflags; // if MQF_QFLAGS
- FS4Packet_MONITORQUERYX(uint32_t pcode = PCODE_MONITORQUERYX);
+ FS4Packet_MONITORQUERYX();
~FS4Packet_MONITORQUERYX();
- void UpdateCompatPCODE();
- void UpdateCompatFeatures();
- void SetRealPCODE(void) { _pcode = PCODE_MONITORQUERYX; }
- uint32_t GetPCODE() override { return _pcode; }
+ uint32_t GetPCODE() override { return PCODE_MONITORQUERYX; }
uint32_t GetLength() override;
void Encode(FNET_DataBuffer *dst) override;
bool Decode(FNET_DataBuffer *src, uint32_t len) override;
diff --git a/searchlib/src/vespa/searchlib/common/transport.h b/searchlib/src/vespa/searchlib/common/transport.h
index 7b13729db22..06a6d042e5f 100644
--- a/searchlib/src/vespa/searchlib/common/transport.h
+++ b/searchlib/src/vespa/searchlib/common/transport.h
@@ -136,8 +136,6 @@ const uint32_t SLIME_MAGIC_ID = 0x55555555;
enum monitorquery_features
{
MQF_QFLAGS = 0x00000002,
-
- MQF_MONITORQUERY_MASK = 0
};
@@ -201,8 +199,7 @@ enum packetcode {
*1 uint32_t location
*2 char[] <title, incipit, URL, ...>
*/
- PCODE_MONITORQUERY = 206, /* ..fdispatch -> ..fsearch. No packet data.
- */
+ PCODE_MONITORQUERY_NOTUSED = 206,
PCODE_MONITORRESULT = 207, /* ..fdispatch <- ..fsearch. PacketData:
* int partitionId,
* time_t timeStamp */