-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gh-3166 ShallowCloneWithDeepOptions so options is not preserved in a …
…join or while loop. Other information should be retained.
- Loading branch information
1 parent
c8a6197
commit f5d4b98
Showing
4 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
.../java/uk/gov/gchq/gaffer/federatedstore/operation/handler/FederatedStoreWhileHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2024 Crown Copyright | ||
* | ||
* 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. | ||
*/ | ||
|
||
package uk.gov.gchq.gaffer.federatedstore.operation.handler; | ||
|
||
import uk.gov.gchq.gaffer.operation.Operation; | ||
import uk.gov.gchq.gaffer.operation.impl.While; | ||
import uk.gov.gchq.gaffer.store.operation.handler.WhileHandler; | ||
|
||
import static uk.gov.gchq.gaffer.federatedstore.util.FederatedStoreUtil.shallowCloneWithDeepOptions; | ||
|
||
/** | ||
* <p> | ||
* An operation handler for {@link While} operations. | ||
* | ||
* @see WhileHandler | ||
*/ | ||
public class FederatedStoreWhileHandler extends WhileHandler { | ||
|
||
/** | ||
* Gets an Operation from a While, but with a deep clone of the options field. | ||
* This avoids a false looping error being detected by the FederatedStore. | ||
* | ||
* @param aWhile The while to get operation from | ||
* @return The Operation with a deep clone of the options field. | ||
*/ | ||
@Override | ||
protected Operation getOperationFromWhile(final While aWhile) { | ||
//TODO it is likely that other Option changes should be preserved. | ||
return shallowCloneWithDeepOptions(super.getOperationFromWhile(aWhile)); | ||
} | ||
|
||
} |
15 changes: 15 additions & 0 deletions
15
...a/uk/gov/gchq/gaffer/federatedstore/operation/handler/impl/FederatedStoreJoinHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package uk.gov.gchq.gaffer.federatedstore.operation.handler.impl; | ||
|
||
import uk.gov.gchq.gaffer.federatedstore.util.FederatedStoreUtil; | ||
import uk.gov.gchq.gaffer.operation.Operation; | ||
import uk.gov.gchq.gaffer.operation.impl.join.Join; | ||
import uk.gov.gchq.gaffer.store.operation.handler.join.JoinHandler; | ||
|
||
public class FederatedStoreJoinHandler<I> extends JoinHandler<I> { | ||
|
||
@Override | ||
protected Operation getOperationFromJoin(final Join<I> join) { | ||
//TODO it is likely that other Option changes should be preserved. | ||
return FederatedStoreUtil.shallowCloneWithDeepOptions(super.getOperationFromJoin(join)); | ||
} | ||
} |