You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by "dlmarion (via GitHub)" <gi...@apache.org> on 2023/09/01 20:19:02 UTC

[GitHub] [accumulo] dlmarion commented on pull request #3737: Use custom Transport Factory to set Transport message and frame size

dlmarion commented on PR #3737:
URL: https://github.com/apache/accumulo/pull/3737#issuecomment-1703277775

   I wrote a test using what I think is the correct stack on the client side to see the number of bytes that it ends up writing for a Mutation. It's not exhibiting the symptoms described above. Test:
   
   ```
     @Test
     public void testThriftMessageSize() throws Exception {
       ByteBuffer buf = ByteBuffer.allocate(MB10);
       
       ByteBufferOutputStream bbos = new ByteBufferOutputStream(buf);
       
       TIOStreamTransport stream = new TIOStreamTransport(bbos);
       
       AccumuloTFramedTransportFactory factory = new AccumuloTFramedTransportFactory(Integer.MAX_VALUE);
       TTransport framedTransport = factory.getTransport(stream);
       assertEquals(framedTransport.getConfiguration().getMaxFrameSize(), Integer.MAX_VALUE);
       assertEquals(framedTransport.getConfiguration().getMaxMessageSize(), Integer.MAX_VALUE);
       
       TCompactProtocol protocol = new TCompactProtocol(framedTransport);
       
       Mutation m = new Mutation(new Text(FastFormat.toZeroPaddedString(0 + 0, 10, 10, "row_".getBytes(UTF_8))));
       byte[] value = new byte[MB1];
       Arrays.fill(value, (byte) 1);
       m.put(new Text("colf_colf"), new Text(FastFormat.toZeroPaddedString(0, 7, 10, "colf_".getBytes(UTF_8))),
           new ColumnVisibility(), System.currentTimeMillis(), new Value(value, true));
   
       TMutation tmut = m.toThrift();
       tmut.write(protocol);
       
       framedTransport.flush();
       assertEquals(MB1, buf.position());
       buf.flip();
       assertEquals(0, buf.position());
       assertEquals(MB1, buf.limit());
   
     }
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org