void init() { IHThorSpillArg *helper = (IHThorSpillArg *)queryHelper(); IArrayOf<IGroup> groups; OwnedRoxieString fname(helper->getFileName()); fillClusterArray(container.queryJob(), fname, clusters, groups); fileDesc.setown(queryThorFileManager().create(container.queryJob(), fname, clusters, groups, true, TDWnoreplicate+TDXtemporary)); IPropertyTree &props = fileDesc->queryProperties(); bool blockCompressed=false; void *ekey; size32_t ekeylen; helper->getEncryptKey(ekeylen,ekey); if (ekeylen) { memset(ekey,0,ekeylen); free(ekey); props.setPropBool("@encrypted", true); blockCompressed = true; } else if (0 != (helper->getFlags() & TDWnewcompress) || 0 != (helper->getFlags() & TDXcompress)) blockCompressed = true; if (blockCompressed) props.setPropBool("@blockCompressed", true); if (0 != (helper->getFlags() & TDXgrouped)) fileDesc->queryProperties().setPropBool("@grouped", true); props.setProp("@kind", "flat"); if (container.queryOwner().queryOwner() && (!container.queryOwner().isGlobal())) // I am in a child query { // do early, because this will be local act. and will not come back to master until end of owning graph. container.queryTempHandler()->registerFile(fname, container.queryOwner().queryGraphId(), helper->getTempUsageCount(), TDXtemporary & helper->getFlags(), getDiskOutputKind(helper->getFlags()), &clusters); queryThorFileManager().publish(container.queryJob(), fname, true, *fileDesc); } }
void done() { if (!container.queryOwner().queryOwner() || container.queryOwner().isGlobal()) // I am in a child query { IHThorSpillArg *helper = (IHThorSpillArg *)queryHelper(); OwnedRoxieString fname(helper->getFileName()); container.queryTempHandler()->registerFile(fname, container.queryOwner().queryGraphId(), helper->getTempUsageCount(), TDXtemporary & helper->getFlags(), getDiskOutputKind(helper->getFlags()), &clusters); queryThorFileManager().publish(container.queryJob(), fname, true, *fileDesc); } }