This closes #1237
This commit is contained in:
commit
6a251ee5c5
|
@ -32,7 +32,7 @@ public final class DayCounterInfo {
|
||||||
|
|
||||||
private final String date;
|
private final String date;
|
||||||
|
|
||||||
private final int[] counters;
|
private final long[] counters;
|
||||||
|
|
||||||
// Static --------------------------------------------------------
|
// Static --------------------------------------------------------
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ public final class DayCounterInfo {
|
||||||
JsonArrayBuilder counters = JsonLoader.createArrayBuilder();
|
JsonArrayBuilder counters = JsonLoader.createArrayBuilder();
|
||||||
for (DayCounterInfo info : infos) {
|
for (DayCounterInfo info : infos) {
|
||||||
JsonArrayBuilder counter = JsonLoader.createArrayBuilder();
|
JsonArrayBuilder counter = JsonLoader.createArrayBuilder();
|
||||||
for (int c : info.getCounters()) {
|
for (long c : info.getCounters()) {
|
||||||
counter.add(c);
|
counter.add(c);
|
||||||
}
|
}
|
||||||
JsonObjectBuilder dci = JsonLoader.createObjectBuilder().add("date", info.getDate()).add("counters", counter);
|
JsonObjectBuilder dci = JsonLoader.createObjectBuilder().add("date", info.getDate()).add("counters", counter);
|
||||||
|
@ -63,7 +63,7 @@ public final class DayCounterInfo {
|
||||||
|
|
||||||
JsonObject counter = (JsonObject) dayCounters.get(i);
|
JsonObject counter = (JsonObject) dayCounters.get(i);
|
||||||
JsonArray hour = counter.getJsonArray("counters");
|
JsonArray hour = counter.getJsonArray("counters");
|
||||||
int[] hourCounters = new int[24];
|
long[] hourCounters = new long[24];
|
||||||
for (int j = 0; j < 24; j++) {
|
for (int j = 0; j < 24; j++) {
|
||||||
hourCounters[j] = hour.getInt(j);
|
hourCounters[j] = hour.getInt(j);
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ public final class DayCounterInfo {
|
||||||
|
|
||||||
// Constructors --------------------------------------------------
|
// Constructors --------------------------------------------------
|
||||||
|
|
||||||
public DayCounterInfo(final String date, final int[] counters) {
|
public DayCounterInfo(final String date, final long[] counters) {
|
||||||
this.date = date;
|
this.date = date;
|
||||||
this.counters = counters;
|
this.counters = counters;
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ public final class DayCounterInfo {
|
||||||
* Returns a 24-length array corresponding to the number of messages added to the queue
|
* Returns a 24-length array corresponding to the number of messages added to the queue
|
||||||
* for the given hour of the day.
|
* for the given hour of the day.
|
||||||
*/
|
*/
|
||||||
public int[] getCounters() {
|
public long[] getCounters() {
|
||||||
return counters;
|
return counters;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ import org.apache.activemq.artemis.jdbc.store.sql.SQLProvider;
|
||||||
|
|
||||||
public class MySQLSQLProvider extends GenericSQLProvider {
|
public class MySQLSQLProvider extends GenericSQLProvider {
|
||||||
|
|
||||||
private static final long MAX_BLOB_SIZE = 4 * 1024 * 1024 * 1024; // 4GB
|
private static final long MAX_BLOB_SIZE = 4L * 1024 * 1024 * 1024; // 4GB
|
||||||
|
|
||||||
private final String createFileTableSQL;
|
private final String createFileTableSQL;
|
||||||
|
|
||||||
|
|
|
@ -165,7 +165,7 @@ public class MQTTProtocolHandler extends ChannelInboundHandlerAdapter {
|
||||||
*/
|
*/
|
||||||
void handleConnect(MqttConnectMessage connect, ChannelHandlerContext ctx) throws Exception {
|
void handleConnect(MqttConnectMessage connect, ChannelHandlerContext ctx) throws Exception {
|
||||||
this.ctx = ctx;
|
this.ctx = ctx;
|
||||||
connectionEntry.ttl = connect.variableHeader().keepAliveTimeSeconds() * 1500;
|
connectionEntry.ttl = connect.variableHeader().keepAliveTimeSeconds() * 1500L;
|
||||||
|
|
||||||
String clientId = connect.payload().clientIdentifier();
|
String clientId = connect.payload().clientIdentifier();
|
||||||
session.getConnectionManager().connect(clientId, connect.payload().userName(), connect.payload().password(), connect.variableHeader().isWillFlag(), connect.payload().willMessage(), connect.payload().willTopic(), connect.variableHeader().isWillRetain(), connect.variableHeader().willQos(), connect.variableHeader().isCleanSession());
|
session.getConnectionManager().connect(clientId, connect.payload().userName(), connect.payload().password(), connect.variableHeader().isWillFlag(), connect.payload().willMessage(), connect.payload().willTopic(), connect.variableHeader().isWillRetain(), connect.variableHeader().willQos(), connect.variableHeader().isCleanSession());
|
||||||
|
|
|
@ -331,9 +331,9 @@ public class AddressControlImpl extends AbstractControl implements AddressContro
|
||||||
|
|
||||||
// Private -------------------------------------------------------
|
// Private -------------------------------------------------------
|
||||||
|
|
||||||
private int getMessageCount(final DurabilityType durability) {
|
private long getMessageCount(final DurabilityType durability) {
|
||||||
List<QueueControl> queues = getQueues(durability);
|
List<QueueControl> queues = getQueues(durability);
|
||||||
int count = 0;
|
long count = 0;
|
||||||
for (QueueControl queue : queues) {
|
for (QueueControl queue : queues) {
|
||||||
count += queue.getMessageCount();
|
count += queue.getMessageCount();
|
||||||
}
|
}
|
||||||
|
|
|
@ -395,7 +395,7 @@ public class MessageCounter {
|
||||||
|
|
||||||
GregorianCalendar date = null;
|
GregorianCalendar date = null;
|
||||||
|
|
||||||
int[] counters = new int[DayCounter.HOURS];
|
long[] counters = new long[DayCounter.HOURS];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
@ -415,17 +415,17 @@ public class MessageCounter {
|
||||||
for (int i = 0; i < DayCounter.HOURS; i++) {
|
for (int i = 0; i < DayCounter.HOURS; i++) {
|
||||||
if (i < hour) {
|
if (i < hour) {
|
||||||
if (isStartDay) {
|
if (isStartDay) {
|
||||||
counters[i] = -1;
|
counters[i] = -1L;
|
||||||
} else {
|
} else {
|
||||||
counters[i] = 0;
|
counters[i] = 0L;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
counters[i] = -1;
|
counters[i] = -1L;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// set the array element of the current hour to '0'
|
// set the array element of the current hour to '0'
|
||||||
counters[hour] = 0;
|
counters[hour] = 0L;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -437,7 +437,7 @@ public class MessageCounter {
|
||||||
return (GregorianCalendar) date.clone();
|
return (GregorianCalendar) date.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[] getCounters() {
|
public long[] getCounters() {
|
||||||
return counters;
|
return counters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class MessageCounterHelper {
|
||||||
DayCounterInfo[] infos = new DayCounterInfo[history.size()];
|
DayCounterInfo[] infos = new DayCounterInfo[history.size()];
|
||||||
for (int i = 0; i < infos.length; i++) {
|
for (int i = 0; i < infos.length; i++) {
|
||||||
DayCounter dayCounter = history.get(i);
|
DayCounter dayCounter = history.get(i);
|
||||||
int[] counters = dayCounter.getCounters();
|
long[] counters = dayCounter.getCounters();
|
||||||
GregorianCalendar date = dayCounter.getDate();
|
GregorianCalendar date = dayCounter.getDate();
|
||||||
|
|
||||||
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
|
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT);
|
||||||
|
|
Loading…
Reference in New Issue