Commit 0953c40f authored by unknown's avatar unknown

ndb - wl#2972 event merge false by default => change option name


storage/ndb/include/ndbapi/NdbEventOperation.hpp:
  event merge false by default => change option name
storage/ndb/ndbapi-examples/ndbapi_event/ndbapi_event.cpp:
  event merge false by default => change option name
storage/ndb/src/ndbapi/NdbEventOperation.cpp:
  event merge false by default => change option name
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp:
  event merge false by default => change option name
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp:
  event merge false by default => change option name
storage/ndb/test/ndbapi/test_event.cpp:
  event merge false by default => change option name
storage/ndb/test/ndbapi/test_event_merge.cpp:
  event merge false by default => change option name
parent 4a114543
...@@ -94,11 +94,9 @@ public: ...@@ -94,11 +94,9 @@ public:
*/ */
State getState(); State getState();
/** /**
* By default events on same NdbEventOperation within same GCI * See NdbDictionary::Event. Default is false.
* are merged into a single event. This can be changed with
* separateEvents(true).
*/ */
void separateEvents(bool flag); void mergeEvents(bool flag);
/** /**
* Activates the NdbEventOperation to start receiving events. The * Activates the NdbEventOperation to start receiving events. The
......
...@@ -100,7 +100,7 @@ int myCreateEvent(Ndb* myNdb, ...@@ -100,7 +100,7 @@ int myCreateEvent(Ndb* myNdb,
int main(int argc, char** argv) int main(int argc, char** argv)
{ {
ndb_init(); ndb_init();
bool sep = argc > 1 && strcmp(argv[1], "-s") == 0; bool merge_events = argc > 1 && strcmp(argv[1], "-m") == 0;
Ndb_cluster_connection *cluster_connection= Ndb_cluster_connection *cluster_connection=
new Ndb_cluster_connection(); // Object representing the cluster new Ndb_cluster_connection(); // Object representing the cluster
...@@ -157,7 +157,7 @@ int main(int argc, char** argv) ...@@ -157,7 +157,7 @@ int main(int argc, char** argv)
printf("create EventOperation\n"); printf("create EventOperation\n");
if ((op = myNdb->createEventOperation(eventName)) == NULL) if ((op = myNdb->createEventOperation(eventName)) == NULL)
APIERROR(myNdb->getNdbError()); APIERROR(myNdb->getNdbError());
op->separateEvents(sep); op->mergeEvents(merge_events);
printf("get values\n"); printf("get values\n");
NdbRecAttr* recAttr[noEventColumnName]; NdbRecAttr* recAttr[noEventColumnName];
......
...@@ -38,9 +38,9 @@ NdbEventOperation::State NdbEventOperation::getState() ...@@ -38,9 +38,9 @@ NdbEventOperation::State NdbEventOperation::getState()
return m_impl.getState(); return m_impl.getState();
} }
void NdbEventOperation::separateEvents(bool flag) void NdbEventOperation::mergeEvents(bool flag)
{ {
m_impl.m_separateEvents = flag; m_impl.m_mergeEvents = flag;
} }
NdbRecAttr * NdbRecAttr *
......
...@@ -104,7 +104,7 @@ NdbEventOperationImpl::NdbEventOperationImpl(NdbEventOperation &N, ...@@ -104,7 +104,7 @@ NdbEventOperationImpl::NdbEventOperationImpl(NdbEventOperation &N,
m_state= EO_CREATED; m_state= EO_CREATED;
m_separateEvents = true; m_mergeEvents = false;
m_has_error= 0; m_has_error= 0;
...@@ -1168,7 +1168,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op, ...@@ -1168,7 +1168,7 @@ NdbEventBuffer::insertDataL(NdbEventOperationImpl *op,
} }
bool use_hash = bool use_hash =
! op->m_separateEvents && op->m_mergeEvents &&
sdata->operation < NdbDictionary::Event::_TE_FIRST_NON_DATA_EVENT; sdata->operation < NdbDictionary::Event::_TE_FIRST_NON_DATA_EVENT;
// find position in bucket hash table // find position in bucket hash table
......
...@@ -206,7 +206,7 @@ public: ...@@ -206,7 +206,7 @@ public:
Uint32 m_eventId; Uint32 m_eventId;
Uint32 m_oid; Uint32 m_oid;
bool m_separateEvents; bool m_mergeEvents;
EventBufData *m_data_item; EventBufData *m_data_item;
......
...@@ -169,7 +169,6 @@ eventOperation(Ndb* pNdb, const NdbDictionary::Table &tab, void* pstats, int rec ...@@ -169,7 +169,6 @@ eventOperation(Ndb* pNdb, const NdbDictionary::Table &tab, void* pstats, int rec
g_err << function << "Event operation creation failed\n"; g_err << function << "Event operation creation failed\n";
return NDBT_FAILED; return NDBT_FAILED;
} }
pOp->separateEvents(true);
g_info << function << "get values\n"; g_info << function << "get values\n";
NdbRecAttr* recAttr[1024]; NdbRecAttr* recAttr[1024];
...@@ -381,7 +380,6 @@ int runCreateDropEventOperation(NDBT_Context* ctx, NDBT_Step* step) ...@@ -381,7 +380,6 @@ int runCreateDropEventOperation(NDBT_Context* ctx, NDBT_Step* step)
g_err << "Event operation creation failed\n"; g_err << "Event operation creation failed\n";
return NDBT_FAILED; return NDBT_FAILED;
} }
pOp->separateEvents(true);
g_info << "dropping event operation" << endl; g_info << "dropping event operation" << endl;
int res = pNdb->dropEventOperation(pOp); int res = pNdb->dropEventOperation(pOp);
...@@ -552,7 +550,6 @@ int runEventApplier(NDBT_Context* ctx, NDBT_Step* step) ...@@ -552,7 +550,6 @@ int runEventApplier(NDBT_Context* ctx, NDBT_Step* step)
g_err << "Event operation creation failed on %s" << buf << endl; g_err << "Event operation creation failed on %s" << buf << endl;
DBUG_RETURN(NDBT_FAILED); DBUG_RETURN(NDBT_FAILED);
} }
pOp->separateEvents(true);
int i; int i;
int n_columns= table->getNoOfColumns(); int n_columns= table->getNoOfColumns();
...@@ -1198,7 +1195,6 @@ static int createEventOperations(Ndb * ndb) ...@@ -1198,7 +1195,6 @@ static int createEventOperations(Ndb * ndb)
{ {
DBUG_RETURN(NDBT_FAILED); DBUG_RETURN(NDBT_FAILED);
} }
pOp->separateEvents(true);
int n_columns= pTabs[i]->getNoOfColumns(); int n_columns= pTabs[i]->getNoOfColumns();
for (int j = 0; j < n_columns; j++) for (int j = 0; j < n_columns; j++)
......
...@@ -850,7 +850,7 @@ createevent() ...@@ -850,7 +850,7 @@ createevent()
evt.addEventColumn(c.name); evt.addEventColumn(c.name);
} }
#ifdef version51rbr #ifdef version51rbr
evt.separateEvents(g_opts.separate_events); evt.mergeEvents(! g_opts.separate_events);
#endif #endif
if (g_dic->getEvent(evt.getName()) != 0) if (g_dic->getEvent(evt.getName()) != 0)
chkdb(g_dic->dropEvent(evt.getName()) == 0); chkdb(g_dic->dropEvent(evt.getName()) == 0);
...@@ -881,7 +881,7 @@ createeventop() ...@@ -881,7 +881,7 @@ createeventop()
#else #else
chkdb((g_evt_op = g_ndb->createEventOperation(g_evt->getName())) != 0); chkdb((g_evt_op = g_ndb->createEventOperation(g_evt->getName())) != 0);
// available in gci merge changeset // available in gci merge changeset
g_evt_op->separateEvents(g_opts.separate_events); // not yet inherited g_evt_op->mergeEvents(! g_opts.separate_events); // not yet inherited
#endif #endif
uint i; uint i;
for (i = 0; i < ncol(); i++) { for (i = 0; i < ncol(); i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment