test_class.declarator: BUFFER_SIZE = 4 * 1024
test_class.modifier: protected static final
test_class.original_string: protected static final int BUFFER_SIZE = 4 * 1024;
test_class.type: int
test_class.var_name: BUFFER_SIZE
test_class.declarator: server
test_class.modifier: protected
test_class.original_string: protected EchoServer server;
test_class.type: EchoServer
test_class.var_name: server
test_class.declarator: time
test_class.modifier: protected
test_class.original_string: protected Time time;
test_class.type: Time
test_class.var_name: time
test_class.declarator: selector
test_class.modifier: protected
test_class.original_string: protected Selector selector;
test_class.type: Selector
test_class.var_name: selector
test_class.declarator: channelBuilder
test_class.modifier: protected
test_class.original_string: protected ChannelBuilder channelBuilder;
test_class.type: ChannelBuilder
test_class.var_name: channelBuilder
test_class.declarator: metrics
test_class.modifier: private
test_class.original_string: private Metrics metrics;
test_class.type: Metrics
test_class.var_name: metrics
test_class.file: clients/src/test/java/org/apache/kafka/common/network/SelectorTest.java
test_class.identifier: SelectorTest
test_case.body: @Test
      public void testMute() throws Exception {
          blockingConnect("0");
          blockingConnect("1");
  
          selector.send(createSend("0", "hello"));
          selector.send(createSend("1", "hi"));
  
          selector.mute("1");
  
          while (selector.completedReceives().isEmpty())
              selector.poll(5);
          assertEquals("We should have only one response", 1, selector.completedReceives().size());
          assertEquals("The response should not be from the muted node", "0", selector.completedReceives().get(0).source());
  
          selector.unmute("1");
          do {
              selector.poll(5);
          } while (selector.completedReceives().isEmpty());
          assertEquals("We should have only one response", 1, selector.completedReceives().size());
          assertEquals("The response should be from the previously muted node", "1", selector.completedReceives().get(0).source());
      }
test_case.class_method_signature: SelectorTest.testMute()
test_case.full_signature: @Test public void testMute()
test_case.identifier: testMute
test_case.invocations: blockingConnect blockingConnect send createSend send createSend mute isEmpty completedReceives poll assertEquals size completedReceives assertEquals source get completedReceives unmute poll isEmpty completedReceives assertEquals size completedReceives assertEquals source get completedReceives
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMute()
focal_class.declarator: log = LoggerFactory.getLogger(Selector.class)
focal_class.modifier: private static final
focal_class.original_string: private static final Logger log = LoggerFactory.getLogger(Selector.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: nioSelector
focal_class.modifier: private final
focal_class.original_string: private final java.nio.channels.Selector nioSelector;
focal_class.type: java.nio.channels.Selector
focal_class.var_name: nioSelector
focal_class.declarator: channels
focal_class.modifier: private final
focal_class.original_string: private final Map<String/* nodeId */, KafkaChannel> channels;
focal_class.type: Map<String/* nodeId */, KafkaChannel>
focal_class.var_name: channels
focal_class.declarator: completedSends
focal_class.modifier: private final
focal_class.original_string: private final List<Send> completedSends;
focal_class.type: List<Send>
focal_class.var_name: completedSends
focal_class.declarator: completedReceives
focal_class.modifier: private final
focal_class.original_string: private final List<NetworkReceive> completedReceives;
focal_class.type: List<NetworkReceive>
focal_class.var_name: completedReceives
focal_class.declarator: stagedReceives
focal_class.modifier: private final
focal_class.original_string: private final Map<KafkaChannel, Deque<NetworkReceive>> stagedReceives;
focal_class.type: Map<KafkaChannel, Deque<NetworkReceive>>
focal_class.var_name: stagedReceives
focal_class.declarator: immediatelyConnectedKeys
focal_class.modifier: private final
focal_class.original_string: private final Set<SelectionKey> immediatelyConnectedKeys;
focal_class.type: Set<SelectionKey>
focal_class.var_name: immediatelyConnectedKeys
focal_class.declarator: disconnected
focal_class.modifier: private final
focal_class.original_string: private final List<String> disconnected;
focal_class.type: List<String>
focal_class.var_name: disconnected
focal_class.declarator: connected
focal_class.modifier: private final
focal_class.original_string: private final List<String> connected;
focal_class.type: List<String>
focal_class.var_name: connected
focal_class.declarator: failedSends
focal_class.modifier: private final
focal_class.original_string: private final List<String> failedSends;
focal_class.type: List<String>
focal_class.var_name: failedSends
focal_class.declarator: time
focal_class.modifier: private final
focal_class.original_string: private final Time time;
focal_class.type: Time
focal_class.var_name: time
focal_class.declarator: sensors
focal_class.modifier: private final
focal_class.original_string: private final SelectorMetrics sensors;
focal_class.type: SelectorMetrics
focal_class.var_name: sensors
focal_class.declarator: metricGrpPrefix
focal_class.modifier: private final
focal_class.original_string: private final String metricGrpPrefix;
focal_class.type: String
focal_class.var_name: metricGrpPrefix
focal_class.declarator: metricTags
focal_class.modifier: private final
focal_class.original_string: private final Map<String, String> metricTags;
focal_class.type: Map<String, String>
focal_class.var_name: metricTags
focal_class.declarator: channelBuilder
focal_class.modifier: private final
focal_class.original_string: private final ChannelBuilder channelBuilder;
focal_class.type: ChannelBuilder
focal_class.var_name: channelBuilder
focal_class.declarator: lruConnections
focal_class.modifier: private final
focal_class.original_string: private final Map<String, Long> lruConnections;
focal_class.type: Map<String, Long>
focal_class.var_name: lruConnections
focal_class.declarator: connectionsMaxIdleNanos
focal_class.modifier: private final
focal_class.original_string: private final long connectionsMaxIdleNanos;
focal_class.type: long
focal_class.var_name: connectionsMaxIdleNanos
focal_class.declarator: maxReceiveSize
focal_class.modifier: private final
focal_class.original_string: private final int maxReceiveSize;
focal_class.type: int
focal_class.var_name: maxReceiveSize
focal_class.declarator: metricsPerConnection
focal_class.modifier: private final
focal_class.original_string: private final boolean metricsPerConnection;
focal_class.type: boolean
focal_class.var_name: metricsPerConnection
focal_class.declarator: currentTimeNanos
focal_class.modifier: private
focal_class.original_string: private long currentTimeNanos;
focal_class.type: long
focal_class.var_name: currentTimeNanos
focal_class.declarator: nextIdleCloseCheckTime
focal_class.modifier: private
focal_class.original_string: private long nextIdleCloseCheckTime;
focal_class.type: long
focal_class.var_name: nextIdleCloseCheckTime
focal_class.file: clients/src/main/java/org/apache/kafka/common/network/Selector.java
focal_class.identifier: Selector
focal_class.interfaces: implements Selectable
focal_class.class_method_signature: Selector.Selector(int maxReceiveSize, long connectionMaxIdleMs, Metrics metrics, Time time, String metricGrpPrefix, Map<String, String> metricTags, boolean metricsPerConnection,
          ChannelBuilder channelBuilder)
focal_class.full_signature: public  Selector(int maxReceiveSize, long connectionMaxIdleMs, Metrics metrics, Time time, String metricGrpPrefix, Map<String, String> metricTags, boolean metricsPerConnection,
          ChannelBuilder channelBuilder)
focal_class.identifier: Selector
focal_class.modifiers: public
focal_class.parameters: (int maxReceiveSize, long connectionMaxIdleMs, Metrics metrics, Time time, String metricGrpPrefix, Map<String, String> metricTags, boolean metricsPerConnection,
          ChannelBuilder channelBuilder)
focal_class.signature:  Selector(int maxReceiveSize, long connectionMaxIdleMs, Metrics metrics, Time time, String metricGrpPrefix, Map<String, String> metricTags, boolean metricsPerConnection,
          ChannelBuilder channelBuilder)
focal_class.class_method_signature: Selector.Selector(long connectionMaxIdleMS, Metrics metrics, Time time, String metricGrpPrefix, ChannelBuilder channelBuilder)
focal_class.full_signature: public  Selector(long connectionMaxIdleMS, Metrics metrics, Time time, String metricGrpPrefix, ChannelBuilder channelBuilder)
focal_class.identifier: Selector
focal_class.modifiers: public
focal_class.parameters: (long connectionMaxIdleMS, Metrics metrics, Time time, String metricGrpPrefix, ChannelBuilder channelBuilder)
focal_class.signature:  Selector(long connectionMaxIdleMS, Metrics metrics, Time time, String metricGrpPrefix, ChannelBuilder channelBuilder)
focal_class.class_method_signature: Selector.connect(String id, InetSocketAddress address, int sendBufferSize, int receiveBufferSize)
focal_class.full_signature: @Override public void connect(String id, InetSocketAddress address, int sendBufferSize, int receiveBufferSize)
focal_class.identifier: connect
focal_class.modifiers: @Override public
focal_class.parameters: (String id, InetSocketAddress address, int sendBufferSize, int receiveBufferSize)
focal_class.return: void
focal_class.signature: void connect(String id, InetSocketAddress address, int sendBufferSize, int receiveBufferSize)
focal_class.class_method_signature: Selector.register(String id, SocketChannel socketChannel)
focal_class.full_signature: public void register(String id, SocketChannel socketChannel)
focal_class.identifier: register
focal_class.modifiers: public
focal_class.parameters: (String id, SocketChannel socketChannel)
focal_class.return: void
focal_class.signature: void register(String id, SocketChannel socketChannel)
focal_class.class_method_signature: Selector.wakeup()
focal_class.full_signature: @Override public void wakeup()
focal_class.identifier: wakeup
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void wakeup()
focal_class.class_method_signature: Selector.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_class.class_method_signature: Selector.send(Send send)
focal_class.full_signature: public void send(Send send)
focal_class.identifier: send
focal_class.modifiers: public
focal_class.parameters: (Send send)
focal_class.return: void
focal_class.signature: void send(Send send)
focal_class.class_method_signature: Selector.poll(long timeout)
focal_class.full_signature: @Override public void poll(long timeout)
focal_class.identifier: poll
focal_class.modifiers: @Override public
focal_class.parameters: (long timeout)
focal_class.return: void
focal_class.signature: void poll(long timeout)
focal_class.class_method_signature: Selector.pollSelectionKeys(Iterable<SelectionKey> selectionKeys, boolean isImmediatelyConnected)
focal_class.full_signature: private void pollSelectionKeys(Iterable<SelectionKey> selectionKeys, boolean isImmediatelyConnected)
focal_class.identifier: pollSelectionKeys
focal_class.modifiers: private
focal_class.parameters: (Iterable<SelectionKey> selectionKeys, boolean isImmediatelyConnected)
focal_class.return: void
focal_class.signature: void pollSelectionKeys(Iterable<SelectionKey> selectionKeys, boolean isImmediatelyConnected)
focal_class.class_method_signature: Selector.main(String[] args)
focal_class.full_signature: public static void main(String[] args)
focal_class.identifier: main
focal_class.modifiers: public static
focal_class.parameters: (String[] args)
focal_class.return: void
focal_class.signature: void main(String[] args)
focal_class.class_method_signature: Selector.completedSends()
focal_class.full_signature: @Override public List<Send> completedSends()
focal_class.identifier: completedSends
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<Send>
focal_class.signature: List<Send> completedSends()
focal_class.class_method_signature: Selector.completedReceives()
focal_class.full_signature: @Override public List<NetworkReceive> completedReceives()
focal_class.identifier: completedReceives
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<NetworkReceive>
focal_class.signature: List<NetworkReceive> completedReceives()
focal_class.class_method_signature: Selector.disconnected()
focal_class.full_signature: @Override public List<String> disconnected()
focal_class.identifier: disconnected
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<String>
focal_class.signature: List<String> disconnected()
focal_class.class_method_signature: Selector.connected()
focal_class.full_signature: @Override public List<String> connected()
focal_class.identifier: connected
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: List<String>
focal_class.signature: List<String> connected()
focal_class.class_method_signature: Selector.maybeCloseOldestConnection()
focal_class.full_signature: private void maybeCloseOldestConnection()
focal_class.identifier: maybeCloseOldestConnection
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void maybeCloseOldestConnection()
focal_class.class_method_signature: Selector.clear()
focal_class.full_signature: private void clear()
focal_class.identifier: clear
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void clear()
focal_class.class_method_signature: Selector.select(long ms)
focal_class.full_signature: private int select(long ms)
focal_class.identifier: select
focal_class.modifiers: private
focal_class.parameters: (long ms)
focal_class.return: int
focal_class.signature: int select(long ms)
focal_class.class_method_signature: Selector.close(String id)
focal_class.full_signature: public void close(String id)
focal_class.identifier: close
focal_class.modifiers: public
focal_class.parameters: (String id)
focal_class.return: void
focal_class.signature: void close(String id)
focal_class.class_method_signature: Selector.close(KafkaChannel channel)
focal_class.full_signature: private void close(KafkaChannel channel)
focal_class.identifier: close
focal_class.modifiers: private
focal_class.parameters: (KafkaChannel channel)
focal_class.return: void
focal_class.signature: void close(KafkaChannel channel)
focal_class.class_method_signature: Selector.isChannelReady(String id)
focal_class.full_signature: @Override public boolean isChannelReady(String id)
focal_class.identifier: isChannelReady
focal_class.modifiers: @Override public
focal_class.parameters: (String id)
focal_class.return: boolean
focal_class.signature: boolean isChannelReady(String id)
focal_class.class_method_signature: Selector.channelOrFail(String id)
focal_class.full_signature: private KafkaChannel channelOrFail(String id)
focal_class.identifier: channelOrFail
focal_class.modifiers: private
focal_class.parameters: (String id)
focal_class.return: KafkaChannel
focal_class.signature: KafkaChannel channelOrFail(String id)
focal_class.class_method_signature: Selector.channels()
focal_class.full_signature: public List<KafkaChannel> channels()
focal_class.identifier: channels
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: List<KafkaChannel>
focal_class.signature: List<KafkaChannel> channels()
focal_class.class_method_signature: Selector.channel(String id)
focal_class.full_signature: public KafkaChannel channel(String id)
focal_class.identifier: channel
focal_class.modifiers: public
focal_class.parameters: (String id)
focal_class.return: KafkaChannel
focal_class.signature: KafkaChannel channel(String id)
focal_class.class_method_signature: Selector.channel(SelectionKey key)
focal_class.full_signature: private KafkaChannel channel(SelectionKey key)
focal_class.identifier: channel
focal_class.modifiers: private
focal_class.parameters: (SelectionKey key)
focal_class.return: KafkaChannel
focal_class.signature: KafkaChannel channel(SelectionKey key)
focal_class.class_method_signature: Selector.hasStagedReceive(KafkaChannel channel)
focal_class.full_signature: private boolean hasStagedReceive(KafkaChannel channel)
focal_class.identifier: hasStagedReceive
focal_class.modifiers: private
focal_class.parameters: (KafkaChannel channel)
focal_class.return: boolean
focal_class.signature: boolean hasStagedReceive(KafkaChannel channel)
focal_class.class_method_signature: Selector.hasStagedReceives()
focal_class.full_signature: private boolean hasStagedReceives()
focal_class.identifier: hasStagedReceives
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean hasStagedReceives()
focal_class.class_method_signature: Selector.addToStagedReceives(KafkaChannel channel, NetworkReceive receive)
focal_class.full_signature: private void addToStagedReceives(KafkaChannel channel, NetworkReceive receive)
focal_class.identifier: addToStagedReceives
focal_class.modifiers: private
focal_class.parameters: (KafkaChannel channel, NetworkReceive receive)
focal_class.return: void
focal_class.signature: void addToStagedReceives(KafkaChannel channel, NetworkReceive receive)
focal_class.class_method_signature: Selector.addToCompletedReceives()
focal_class.full_signature: private void addToCompletedReceives()
focal_class.identifier: addToCompletedReceives
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void addToCompletedReceives()
focal_class.class_method_signature: Selector.mute(String id)
focal_class.full_signature: @Override public void mute(String id)
focal_class.identifier: mute
focal_class.modifiers: @Override public
focal_class.parameters: (String id)
focal_class.return: void
focal_class.signature: void mute(String id)
focal_class.class_method_signature: Selector.mute(KafkaChannel channel)
focal_class.full_signature: private void mute(KafkaChannel channel)
focal_class.identifier: mute
focal_class.modifiers: private
focal_class.parameters: (KafkaChannel channel)
focal_class.return: void
focal_class.signature: void mute(KafkaChannel channel)
focal_class.class_method_signature: Selector.unmute(String id)
focal_class.full_signature: @Override public void unmute(String id)
focal_class.identifier: unmute
focal_class.modifiers: @Override public
focal_class.parameters: (String id)
focal_class.return: void
focal_class.signature: void unmute(String id)
focal_class.class_method_signature: Selector.unmute(KafkaChannel channel)
focal_class.full_signature: private void unmute(KafkaChannel channel)
focal_class.identifier: unmute
focal_class.modifiers: private
focal_class.parameters: (KafkaChannel channel)
focal_class.return: void
focal_class.signature: void unmute(KafkaChannel channel)
focal_class.class_method_signature: Selector.muteAll()
focal_class.full_signature: @Override public void muteAll()
focal_class.identifier: muteAll
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void muteAll()
focal_class.class_method_signature: Selector.unmuteAll()
focal_class.full_signature: @Override public void unmuteAll()
focal_class.identifier: unmuteAll
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void unmuteAll()
focal_method.body: @Override
      public void mute(String id) {
          KafkaChannel channel = channelOrFail(id);
          mute(channel);
      }
focal_method.class_method_signature: Selector.mute(String id)
focal_method.full_signature: @Override public void mute(String id)
focal_method.identifier: mute
focal_method.invocations: channelOrFail mute
focal_method.modifiers: @Override public
focal_method.parameters: (String id)
focal_method.return: void
focal_method.signature: void mute(String id)