Skip to content

Commit

Permalink
philadelphia-core: Rename chunks to blocks in 'FIXMessage'
Browse files Browse the repository at this point in the history
  • Loading branch information
jvirtanen committed Aug 17, 2020
1 parent 6639347 commit f43666b
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public class FIXConfig {
private final long outgoingMsgSeqNum;
private final int maxFieldCount;
private final int fieldCapacity;
private final int chunkSize;
private final int blockSize;
private final int rxBufferCapacity;
private final int txBufferCapacity;
private final boolean checkSumEnabled;
Expand All @@ -46,7 +46,7 @@ public class FIXConfig {
* @param outgoingMsgSeqNum the outgoing MsgSeqNum(34)
* @param maxFieldCount the maximum number of fields in a message
* @param fieldCapacity the field capacity
* @param chunkSize the backing store chunk size
* @param blockSize the backing store block size
* @param rxBufferCapacity the receive buffer capacity
* @param txBufferCapacity the transmit buffer capacity
* @param checkSumEnabled the incoming CheckSum(10) check status
Expand All @@ -55,7 +55,7 @@ public class FIXConfig {
public FIXConfig(FIXVersion version, String senderCompId,
String targetCompId, int heartBtInt,
long incomingMsgSeqNum, long outgoingMsgSeqNum,
int maxFieldCount, int fieldCapacity, int chunkSize,
int maxFieldCount, int fieldCapacity, int blockSize,
int rxBufferCapacity, int txBufferCapacity,
boolean checkSumEnabled) {
this.version = version;
Expand All @@ -66,7 +66,7 @@ public FIXConfig(FIXVersion version, String senderCompId,
this.outgoingMsgSeqNum = outgoingMsgSeqNum;
this.maxFieldCount = maxFieldCount;
this.fieldCapacity = fieldCapacity;
this.chunkSize = chunkSize;
this.blockSize = blockSize;
this.rxBufferCapacity = rxBufferCapacity;
this.txBufferCapacity = txBufferCapacity;
this.checkSumEnabled = checkSumEnabled;
Expand Down Expand Up @@ -145,12 +145,12 @@ public int getFieldCapacity() {
}

/**
* Get the backing store chunk size.
* Get the backing store block size.
*
* @return the backing store chunk size
* @return the backing store block size
*/
public int getChunkSize() {
return chunkSize;
public int getBlockSize() {
return blockSize;
}

/**
Expand Down Expand Up @@ -216,7 +216,7 @@ public String toString() {
* <li>outgoing MsgSeqNum(34): 1</li>
* <li>maximum number of fields in a message: 64</li>
* <li>field capacity: 64</li>
* <li>backing store chunk size: 4096</li>
* <li>backing store block size: 4096</li>
* <li>receive buffer capacity: 1024</li>
* <li>transmit buffer capacity: 1024</li>
* <li>incoming CheckSum(10) check status: enabled</li>
Expand All @@ -232,7 +232,7 @@ public static class Builder {
private long outgoingMsgSeqNum;
private int maxFieldCount;
private int fieldCapacity;
private int chunkSize;
private int blockSize;
private int rxBufferCapacity;
private int txBufferCapacity;
private boolean checkSumEnabled;
Expand All @@ -249,7 +249,7 @@ public Builder() {
outgoingMsgSeqNum = 1;
maxFieldCount = 64;
fieldCapacity = 64;
chunkSize = 4096;
blockSize = 4096;
rxBufferCapacity = 1024;
txBufferCapacity = 1024;
checkSumEnabled = true;
Expand Down Expand Up @@ -352,13 +352,13 @@ public Builder setFieldCapacity(int fieldCapacity) {
}

/**
* Set the chunk size.
* Set the block size.
*
* @param chunkSize the chunk size
* @param blockSize the block size
* @return this instance
*/
public Builder setChunkSize(int chunkSize) {
this.chunkSize = chunkSize;
public Builder setBlockSize(int blockSize) {
this.blockSize = blockSize;

return this;
}
Expand Down Expand Up @@ -408,7 +408,7 @@ public Builder setCheckSumEnabled(boolean checkSumEnabled) {
public FIXConfig build() {
return new FIXConfig(version, senderCompId, targetCompId,
heartBtInt, incomingMsgSeqNum, outgoingMsgSeqNum,
maxFieldCount, fieldCapacity, chunkSize,
maxFieldCount, fieldCapacity, blockSize,
rxBufferCapacity, txBufferCapacity,
checkSumEnabled);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class FIXMessage {
* @param config the message configuration
*/
public FIXMessage(FIXConfig config) {
this(config.getMaxFieldCount(), config.getFieldCapacity(), config.getChunkSize());
this(config.getMaxFieldCount(), config.getFieldCapacity(), config.getBlockSize());
}

/**
Expand All @@ -51,30 +51,30 @@ public FIXMessage(FIXConfig config) {
* @param fieldCapacity the field capacity
*/
public FIXMessage(int maxFieldCount, int fieldCapacity) {
this(maxFieldCount, fieldCapacity, DEFAULTS.getChunkSize());
this(maxFieldCount, fieldCapacity, DEFAULTS.getBlockSize());
}

/**
* Construct a new message container.
*
* @param maxFieldCount the maximum number of fields
* @param fieldCapacity the field capacity
* @param chunkSize the backing store chunk size
* @param blockSize the backing store block size
*/
public FIXMessage(int maxFieldCount, int fieldCapacity, int chunkSize) {
public FIXMessage(int maxFieldCount, int fieldCapacity, int blockSize) {
tags = new int[maxFieldCount];

values = new FIXValue[maxFieldCount];

byte[] bytes = new byte[chunkSize];
byte[] bytes = new byte[blockSize];

int start = 0;

for (int i = 0; i < values.length; i++) {
int end = start + fieldCapacity;

if (end > chunkSize) {
bytes = new byte[chunkSize];
if (end > blockSize) {
bytes = new byte[blockSize];

start = 0;
end = fieldCapacity;
Expand Down

0 comments on commit f43666b

Please sign in to comment.