-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HPCC-30285 Default cloud logical files to compressed #17770
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/*############################################################################## | ||
HPCC SYSTEMS software Copyright (C) 2023 HPCC Systems®. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
############################################################################## */ | ||
|
||
#pragma once | ||
|
||
#include "errorlist.h" | ||
|
||
#define ENGINEERR_EXTEND_CLUSTER_WRITE ENGINE_ERROR_START | ||
#define ENGINEERR_MIXED_COMPRESSED_WRITE ENGINE_ERROR_START+1 | ||
#define ENGINEERR_FILE_TYPE_MISMATCH ENGINE_ERROR_START+2 | ||
#define ENGINEERR_MISSING_OPTIONAL_FILE ENGINE_ERROR_START+3 | ||
#define ENGINEERR_FILE_UPTODATE ENGINE_ERROR_START+4 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ | |
#include "thorread.hpp" | ||
|
||
#include "ws_dfsclient.hpp" | ||
#include "hthorerr.hpp" | ||
|
||
|
||
#define EMPTY_LOOP_LIMIT 1000 | ||
|
@@ -361,6 +362,7 @@ ClusterWriteHandler *createClusterWriteHandler(IAgentContext &agent, IHThorIndex | |
getDefaultStoragePlane(defaultCluster); | ||
Owned<CHThorClusterWriteHandler> clusterHandler; | ||
unsigned clusterIdx = 0; | ||
|
||
while(true) | ||
{ | ||
OwnedRoxieString helperCluster(iwHelper ? iwHelper->getCluster(clusterIdx++) : dwHelper->getCluster(clusterIdx++)); | ||
|
@@ -372,10 +374,10 @@ ClusterWriteHandler *createClusterWriteHandler(IAgentContext &agent, IHThorIndex | |
} | ||
if (!cluster) | ||
break; | ||
if(!clusterHandler) | ||
if (!clusterHandler) | ||
{ | ||
if(extend) | ||
throw MakeStringException(0, "Cannot combine EXTEND and CLUSTER flags on disk write of file %s", lfn); | ||
if (extend) | ||
throw makeStringExceptionV(ENGINEERR_EXTEND_CLUSTER_WRITE, "Cannot combine EXTEND and CLUSTER flags on disk write of file %s", lfn); | ||
clusterHandler.setown(new CHThorClusterWriteHandler(lfn, "OUTPUT", agent)); | ||
} | ||
clusterHandler->addCluster(cluster); | ||
|
@@ -540,6 +542,20 @@ void CHThorDiskWriteActivity::resolve() | |
} | ||
|
||
clusterHandler.setown(createClusterWriteHandler(agent, NULL, &helper, dfsLogicalName.get(), filename, extend, false)); | ||
StringBuffer planeName; | ||
if (clusterHandler) | ||
{ | ||
StringArray clusterNames; | ||
clusterHandler->getClusters(clusterNames); | ||
planeName.set(clusterNames.item(0)); // NB: only bother with 1st, if multiple createClusterWriteHandler validates if same | ||
} | ||
else | ||
getDefaultStoragePlane(planeName); | ||
bool outputCompressionDefault = agent.queryWorkUnit()->getDebugValueBool("compressAllOutputs", isContainerized()); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the workunit option useful? Not convinced, but may as well leave it in. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it isn't useful in cloud, but it would the current way to change the default in bare-metal since you can't configure planes there. |
||
outputPlaneCompressed = outputCompressionDefault; | ||
Owned<IPropertyTree> plane = getStoragePlane(planeName); | ||
if (plane) | ||
outputPlaneCompressed = plane->getPropBool("@compressLogicalFiles", outputCompressionDefault); | ||
} | ||
} | ||
else | ||
|
@@ -560,7 +576,13 @@ void CHThorDiskWriteActivity::open() | |
Linked<IRecordSize> groupedMeta = input->queryOutputMeta()->querySerializedDiskMeta(); | ||
if (grouped) | ||
groupedMeta.setown(createDeltaRecordSize(groupedMeta, +1)); | ||
blockcompressed = checkWriteIsCompressed(helper.getFlags(), serializedOutputMeta.getFixedSize(), grouped);//TDWnewcompress for new compression, else check for row compression | ||
blockcompressed=false; | ||
if (0 == (helper.getFlags() & TDWnocompress)) | ||
{ | ||
blockcompressed = checkWriteIsCompressed(helper.getFlags(), serializedOutputMeta.getFixedSize(), grouped);//TDWnewcompress for new compression, else check for row compression | ||
if (!blockcompressed) // if ECL doesn't specify, default to plane definition | ||
blockcompressed = outputPlaneCompressed; | ||
} | ||
void *ekey; | ||
size32_t ekeylen; | ||
helper.getEncryptKey(ekeylen,ekey); | ||
|
@@ -8314,7 +8336,6 @@ void CHThorDiskReadBaseActivity::stop() | |
CHThorActivityBase::stop(); | ||
} | ||
|
||
#define TE_FileTypeMismatch 10138 // NB: duplicated from thorlcr/shared/thexception.hpp, but be moved to common header | ||
void CHThorDiskReadBaseActivity::checkFileType(IDistributedFile *file) | ||
{ | ||
if (rt_csv == readType) | ||
|
@@ -8346,7 +8367,7 @@ void CHThorDiskReadBaseActivity::checkFileType(IDistributedFile *file) | |
return; | ||
if (!strieq(kind, expectedType)) | ||
{ | ||
Owned<IException> e = makeStringExceptionV(TE_FileTypeMismatch, "File format mismatch reading file: '%s'. Expected type '%s', but file is type '%s'", file->queryLogicalName(), expectedType, kind); | ||
Owned<IException> e = makeStringExceptionV(ENGINEERR_FILE_TYPE_MISMATCH, "File format mismatch reading file: '%s'. Expected type '%s', but file is type '%s'", file->queryLogicalName(), expectedType, kind); | ||
if (!warningOnly) | ||
throw e.getClear(); | ||
StringBuffer tmp; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/*############################################################################## | ||
HPCC SYSTEMS software Copyright (C) 2023 HPCC Systems®. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
############################################################################## */ | ||
|
||
#pragma once | ||
|
||
#include "engineerr.hpp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also needs to be added to reservedwords.cpp
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will add