&& this.attrs.getOrderPolicy().equals(OrderPolicy.THREAD)) { throw new GatewaySenderException( String.format("Parallel Gateway Sender %s can not be created with OrderPolicy %s",
try { gatewaySenderFactory .setOrderPolicy(GatewaySender.OrderPolicy.valueOf(orderPolicy.toUpperCase())); } catch (IllegalArgumentException e) { throw new InternalGemFireException(
if (InternalDataSerializer.getVersionForDataStream(out).compareTo(Version.GFE_90) < 0 && this.orderPolicy != null) { String orderPolicyName = this.orderPolicy.name(); if (orderPolicyName.equals(Gateway.OrderPolicy.KEY.name())) { DataSerializer.writeObject(Gateway.OrderPolicy.KEY, out);
/** * Returns the matching OrderPolicyType given a GemFire Gateway.OrderPolicy enumerated value. * * @param orderPolicy the GemFire Gateway.OrderPolicy enumerated value used to match * the desired OrderPolicyType. * @return a OrderPolicyType matching the given GemFire Gateway.OrderPolicy enumerated value. * @see org.apache.geode.cache.wan.GatewaySender.OrderPolicy * @see #getOrderPolicy() */ public static OrderPolicyType valueOf(final GatewaySender.OrderPolicy orderPolicy) { for (OrderPolicyType orderPolicyType : values()) { if (orderPolicyType.getOrderPolicy().equals(orderPolicy)) { return orderPolicyType; } } return null; }
/** * Configures the {@link AsyncEventQueue} (AEQ) ordering policy (e.g. {@literal KEY}, {@literal PARTITION}, * {@literal THREAD}). * * When dispatcher threads are greater than one, the ordering policy configures the way in which * multiple dispatcher threads process Region events from the queue. * * @param orderPolicy {@link String} specifying the name of the AEQ order policy. * @see org.apache.geode.cache.asyncqueue.AsyncEventQueueFactory#setOrderPolicy(GatewaySender.OrderPolicy) */ public void setOrderPolicy(String orderPolicy) { setOrderPolicy(GatewaySender.OrderPolicy.valueOf(String.valueOf(orderPolicy).toUpperCase())); }
/** * Configures the {@link AsyncEventQueue} (AEQ) ordering policy (e.g. {@literal KEY}, {@literal PARTITION}, * {@literal THREAD}). * * When dispatcher threads are greater than one, the ordering policy configures the way in which * multiple dispatcher threads process Region events from the queue. * * @param orderPolicy {@link String} specifying the name of the AEQ order policy. * @see org.apache.geode.cache.asyncqueue.AsyncEventQueueFactory#setOrderPolicy(GatewaySender.OrderPolicy) */ public void setOrderPolicy(String orderPolicy) { setOrderPolicy(GatewaySender.OrderPolicy.valueOf(String.valueOf(orderPolicy).toUpperCase())); }
try { asyncEventQueueCreation .setOrderPolicy(GatewaySender.OrderPolicy.valueOf(orderPolicy.toUpperCase())); } catch (IllegalArgumentException e) { throw new InternalGemFireException(String.format(
gateway.setOrderPolicy(OrderPolicy.valueOf(orderPolicy));
|| !asyncEventQueue.getOrderPolicy().equals(GatewaySender.DEFAULT_ORDER_POLICY)) atts.addAttribute("", "", ORDER_POLICY, "", String.valueOf(asyncEventQueue.getOrderPolicy()));
if (generateDefaults() || !sender.getOrderPolicy().equals(GatewaySender.DEFAULT_ORDER_POLICY)) atts.addAttribute("", "", ORDER_POLICY, "", String.valueOf(sender.getOrderPolicy()));
socketBufferSize, socketReadTimeout, enableBatchConflation, batchSize, batchTimeInterval, enablePersistence, diskStoreName, diskSynchronous, maxQueueMemory, alertThreshold, dispatcherThreads, orderPolicy == null ? null : orderPolicy.name(), gatewayEventFilters, gatewayTransportFilter);
.setMaximumQueueMemory(Integer.parseInt(config.getMaximumQueueMemory())) .setDispatcherThreads(Integer.parseInt(config.getDispatcherThreads())) .setOrderPolicy(OrderPolicy.valueOf(config.getOrderPolicy()));
&& this.attrs.getOrderPolicy().equals(OrderPolicy.THREAD)) { throw new AsyncEventQueueConfigurationException( String.format(
if (gatewaySenderAttributes.isParallel()) { if (gatewaySenderAttributes.getOrderPolicy() != null && gatewaySenderAttributes.getOrderPolicy().equals(OrderPolicy.THREAD)) { throw new AsyncEventQueueConfigurationException( String.format(
Gateway.OrderPolicy oldOrderPolicy = DataSerializer.readObject(in); if (oldOrderPolicy != null) { if (oldOrderPolicy.name().equals(OrderPolicy.KEY.name())) { this.orderPolicy = OrderPolicy.KEY; } else if (oldOrderPolicy.name().equals(OrderPolicy.THREAD.name())) { this.orderPolicy = OrderPolicy.THREAD; } else {
@Test public void testFunctionArgs() { doReturn(mock(Set.class)).when(command).getMembers(any(), any()); cliFunctionResult = new CliFunctionResult("member", CliFunctionResult.StatusState.OK, "cliFunctionResult"); functionResults.add(cliFunctionResult); gfsh.executeAndAssertThat(command, "create gateway-sender --member=xyz --id=1 --remote-distributed-system-id=1" + " --order-policy=thread --dispatcher-threads=2 " + "--gateway-event-filter=test1,test2 --gateway-transport-filter=test1,test2") .statusIsSuccess(); verify(command).executeAndGetFunctionResult(any(), argsArgumentCaptor.capture(), any(Set.class)); assertThat(argsArgumentCaptor.getValue().getOrderPolicy()).isEqualTo( GatewaySender.OrderPolicy.THREAD.toString()); assertThat(argsArgumentCaptor.getValue().getRemoteDistributedSystemId()).isEqualTo(1); assertThat(argsArgumentCaptor.getValue().getDispatcherThreads()).isEqualTo(2); assertThat(argsArgumentCaptor.getValue().getGatewayEventFilter()).containsExactly("test1", "test2"); assertThat(argsArgumentCaptor.getValue().getGatewayTransportFilter()).containsExactly("test1", "test2"); }
public String getOrderPolicy() { return queueImpl.getOrderPolicy() != null ? queueImpl.getOrderPolicy().name() : null; }
public String getOrderPolicy() { return sender.getOrderPolicy() != null ? sender.getOrderPolicy().name() : null; }