Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-7051

UnsupportedOperationException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Urgent
    • Resolution: Duplicate
    • None
    • Legacy/CQL
    • None
    • Cassandra 2.0.6

    • Critical

    Description

      UnsupportedOperationException exception thrown when using batchstatement. This is because in org.apache.cassandra.cql3.statements.BatchStatement.unzipMutations returns a collection that does not support add if the size of mutation is 1.

      STACK:
      throws UnsupportedOperationException.
      Daemon Thread [Native-Transport-Requests:1043] (Suspended (entry into method <init> in UnsupportedOperationException))
      UnsupportedOperationException.<init>() line: 42 [local variables unavailable]
      HashMap$Values(AbstractCollection<E>).add(E) line: 260
      HashMap$Values(AbstractCollection<E>).addAll(Collection<? extends E>) line: 342
      StorageProxy.mutateWithTriggers(Collection<IMutation>, ConsistencyLevel, boolean) line: 519
      BatchStatement.executeWithoutConditions(Collection<IMutation>, ConsistencyLevel) line: 210
      BatchStatement.execute(BatchStatement$BatchVariables, boolean, ConsistencyLevel, long) line: 203
      BatchStatement.executeWithPerStatementVariables(ConsistencyLevel, QueryState, List<List<ByteBuffer>>) line: 192
      QueryProcessor.processBatch(BatchStatement, ConsistencyLevel, QueryState, List<List<ByteBuffer>>, List<Object>) line: 373
      BatchMessage.execute(QueryState) line: 206
      Message$Dispatcher.messageReceived(ChannelHandlerContext, MessageEvent) line: 304
      Message$Dispatcher(SimpleChannelUpstreamHandler).handleUpstream(ChannelHandlerContext, ChannelEvent) line: 70
      DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline$DefaultChannelHandlerContext, ChannelEvent) line: 564
      DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(ChannelEvent) line: 791
      ChannelUpstreamEventRunnable.doRun() line: 43
      ChannelUpstreamEventRunnable(ChannelEventRunnable).run() line: 67
      RequestThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line: 1145
      ThreadPoolExecutor$Worker.run() line: 615
      Thread.run() line: 744

      org.apache.cassandra.cql3.statements.BatchStatement:
      private Collection<? extends IMutation> unzipMutations(Map<String, Map<ByteBuffer, IMutation>> mutations)

      { // The case where all statement where on the same keyspace is pretty common if (mutations.size() == 1) return mutations.values().iterator().next().values(); List<IMutation> ms = new ArrayList<>(); for (Map<ByteBuffer, IMutation> ksMap : mutations.values()) ms.addAll(ksMap.values()); return ms; }

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dmodha Digant Modha
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: