本文整理汇总了C++中Slave::deliverResult方法的典型用法代码示例。如果您正苦于以下问题:C++ Slave::deliverResult方法的具体用法?C++ Slave::deliverResult怎么用?C++ Slave::deliverResult使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Slave
的用法示例。
在下文中一共展示了Slave::deliverResult方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SPEHandler
//.........这里部分代码省略.........
result.clear();
gettimeofday(&t3, 0);
int deliverystatus = 0;
int processstatus = 0;
// process data segments
for (int i = 0; i < totalrows; i += unitrows)
{
if (unitrows > totalrows - i)
unitrows = totalrows - i;
input.m_pcUnit = block + index[i] - index[0];
input.m_iRows = unitrows;
input.m_pllIndex = index + i;
output.m_iResSize = 0;
output.m_iRows = 0;
output.m_strError = "";
processstatus = self->processData(input, output, file, result, buckets, process, map, partition);
if (processstatus < 0)
{
progress = SectorError::E_SPEPROC;
break;
}
timeval t;
gettimeofday(&t, NULL);
unsigned int seed = t.tv_sec * 1000000 + t.tv_usec;
srand(seed);
int ds_thresh = 32000000 * ((rand() % 7) + 1);
if ((result.m_llTotalDataSize >= ds_thresh) && (buckets != 0))
deliverystatus = self->deliverResult(buckets, result, dest);
if (deliverystatus < 0)
{
progress = SectorError::E_SPEWRITE;
break;
}
gettimeofday(&t4, 0);
if (t4.tv_sec - t3.tv_sec > 1)
{
progress = i * 100 / totalrows;
msg.setData(4, (char*)&progress, 4);
msg.m_iDataLength = SectorMsg::m_iHdrSize + 8;
int id = 0;
self->m_GMP.sendto(ip.c_str(), ctrlport, id, &msg);
t3 = t4;
}
}
// process files
if (0 == unitrows)
{
SNode s;
LocalFS::stat(self->m_strHomeDir + datafile, s);
int64_t filesize = s.m_llSize;
input.m_pcUnit = block;
input.m_iRows = -1;
input.m_pllIndex = NULL;
output.m_llOffset = 0;