我有这个:
val vertexIdListPartitions: TrieMap[Long, List[Long]] = TrieMap()
我需要在vertexIdListPartitions(3)
上添加List(3)
。
我尝试使用:
vertexIdListPartitions(3)++List(3)
但是它不起作用。
请帮助我。谢谢
可变收集的update()
方法。
vertexIdListPartitions.update(3L, List(3)) //res0: Unit = ()
vertexIdListPartitions //res1: TrieMap[Long,List[Long]] = TrieMap(3 -> List(3))