Murtadha Hubail has posted comments on this change.

Change subject: [NO ISSUE] Add support for NodeGroup upsert, etc.
......................................................................


Patch Set 1:

(1 comment)

https://asterix-gerrit.ics.uci.edu/#/c/2389/1/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataManager.java
File 
asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/MetadataManager.java:

PS1, Line 482: boolean upsert
Those flags cause nothing but trouble. I suggest we do this instead and update 
MetadataNode accordingly:

    @Override
    public void addNodegroup(MetadataTransactionContext ctx, NodeGroup 
nodeGroup) throws AlgebricksException {
        somethingNodegroup(ctx, nodeGroup, 
AbstractIndexModificationOperationCallback.Operation.INSERT);
    }

    @Override
    public void updateNodegroup(MetadataTransactionContext ctx, NodeGroup 
nodeGroup) throws AlgebricksException {
        somethingNodegroup(ctx, nodeGroup, 
AbstractIndexModificationOperationCallback.Operation.UPSERT);
    }

    private void somethingNodeGroup(MetadataTransactionContext ctx, NodeGroup 
nodeGroup,
            AbstractIndexModificationOperationCallback.Operation op) throws 
AlgebricksException {
        try {
            metadataNode.addNodeGroup(ctx.getTxnId(), nodeGroup, op);
        } catch (RemoteException e) {
            throw new 
MetadataException(ErrorCode.REMOTE_EXCEPTION_WHEN_CALLING_METADATA_NODE, e);
        }
        ctx.addNodeGroup(nodeGroup);
    }


-- 
To view, visit https://asterix-gerrit.ics.uci.edu/2389
To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I15cfb74bc345680102cedafa99f7ff4f144860bc
Gerrit-PatchSet: 1
Gerrit-Project: asterixdb
Gerrit-Branch: master
Gerrit-Owner: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Jenkins <jenk...@fulliautomatix.ics.uci.edu>
Gerrit-Reviewer: Michael Blow <mb...@apache.org>
Gerrit-Reviewer: Murtadha Hubail <mhub...@apache.org>
Gerrit-Reviewer: Till Westmann <ti...@apache.org>
Gerrit-HasComments: Yes

Reply via email to