Ask Your Question
0

"Node must contains all keys." when trying to post flow group data to the yang data tree.

asked 2014-05-29 19:30:32 -0700

CobyS gravatar image

updated 2014-05-29 19:46:31 -0700

I am trying to add a flow Group under a Node and I am getting the error stated in the question. Can anyone provide some insight into what keys the API is complaining about. Here is the code snippet that reports the error. It is in YangDataUtils.java

public static Map<qname,object> getKeyMap(CompositeNode node, List<qname> keys) { Map<qname,object> map = new HashMap<>(); for(QName key : keys) { SimpleNode keyNode = node.getFirstSimpleByName(QName.create(node.getNodeType(), key.getLocalName())); checkArgument(keyNode != null,"Node must contains all keys."); Object value = keyNode.getValue(); map.put(key, value);</qname,object></qname></qname,object>

    }
    return map;
}

The node type is "bucket"

Here is the callstack:

osgi> Initializing session 2014-05-29 19:43:04.777 PDT [pool-19-thread-4] ERROR o.o.c.m.s.c.i.service.TwoPhaseCommit - Transaction: DOM-355727 Request Commit failed java.lang.IllegalArgumentException: Node must contains all keys. at com.google.common.base.Preconditions.checkArgument(Preconditions.java:92) ~[bundlefile:na] at org.opendaylight.controller.sal.dom.broker.util.YangDataUtils.getKeyMap(YangDataUtils.java:44) ~[na:na] at org.opendaylight.controller.sal.dom.broker.util.YangDataUtils.toIndexMap(YangDataUtils.java:32) ~[na:na] at org.opendaylight.controller.sal.dom.broker.util.YangDataOperations.mergeMultiple(YangDataOperations.java:103) ~[na:na] at org.opendaylight.controller.sal.dom.broker.util.YangDataOperations.mergeMultiple(YangDataOperations.java:219) ~[na:na] at org.opendaylight.controller.sal.dom.broker.util.YangDataOperations.mergeContainer(YangDataOperations.java:187) ~[na:na] at org.opendaylight.controller.sal.dom.broker.util.YangDataOperations.merge(YangDataOperations.java:48) ~[na:na] at org.opendaylight.controller.sal.dom.broker.util.YangDataOperations.mergeMultiple(YangDataOperations.java:84) ~[na:na] at org.opendaylight.controller.sal.dom.broker.util.YangDataOperations.mergeMultiple(YangDataOperations.java:213) ~[na:na] at org.opendaylight.controller.sal.dom.broker.util.YangDataOperations.mergeContainer(YangDataOperations.java:187) ~[na:na] at org.opendaylight.controller.sal.dom.broker.util.YangDataOperations.merge(YangDataOperations.java:48) ~[na:na] at org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareDataStoreAdapter.mergeData(SchemaAwareDataStoreAdapter.java:153) ~[na:na] at org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareDataStoreAdapter$NormalizedDataModification.mergeConfigurationData(SchemaAwareDataStoreAdapter.java:312) ~[na:na] at org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareDataStoreAdapter$NormalizedDataModification.mergeConfigurationData(SchemaAwareDataStoreAdapter.java:283) ~[na:na] at org.opendaylight.controller.md.sal.common.impl.AbstractDataModification.putConfigurationData(AbstractDataModification.java:77) ~[bundlefile:na] at org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareDataStoreAdapter.prepareMergedTransaction(SchemaAwareDataStoreAdapter.java:170) ~[na:na] at org.opendaylight.controller.sal.dom.broker.impl.SchemaAwareDataStoreAdapter.requestCommit(SchemaAwareDataStoreAdapter.java:109) ~[na:na] at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.call(TwoPhaseCommit.java:83) [bundlefile:na] at org.opendaylight.controller.md.sal.common.impl.service.TwoPhaseCommit.call(TwoPhaseCommit.java:38) [bundlefile:na] at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.055] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.055] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.055] at java.lang.Thread.run(Thread.java:744) [na:1.7.055] 2014-05-29 19:43:04.778 PDT [nioEventLoopGroup-9-1] WARN o.o.o.p.i.s ... (more)

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2014-05-30 00:10:32 -0700

Tony Tkacik gravatar image

Your object (or one of its subobjects) which you are trying to store to datastore implements Identifiable interface nd in YANG is modeled as list, with key statement present. In order to store that object you must specify key for all list items you are storing.

See Bucket class and BucketBuilder for getKey and setKey method.

edit flag offensive delete publish link more
Login/Signup to Answer

Question Tools

Follow
1 follower

Stats

Asked: 2014-05-29 19:30:32 -0700

Seen: 5,111 times

Last updated: May 30 '14