Skip to content

Commit

Permalink
Merge pull request #22 from mogilefs-moji/longerFid
Browse files Browse the repository at this point in the history
Longer fid
  • Loading branch information
massdosage authored Jun 15, 2016
2 parents 531857e + b9b0ed1 commit 58bb171
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/main/java/fm/last/moji/MojiFileAttributes.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public interface MojiFileAttributes {

long getLength();

int getFid();
long getFid();

String getDomain();

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fm/last/moji/impl/MojiFileAttributesImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ class MojiFileAttributesImpl implements MojiFileAttributes {
private final String storageClass;
private final int deviceCount;
private final long length;
private final int fid;
private final long fid;
private final String domain;
private final String key;

MojiFileAttributesImpl(Map<String, String> valueMap) {
length = Long.parseLong(valueMap.get("length"));
domain = valueMap.get("domain");
fid = Integer.parseInt(valueMap.get("fid"));
fid = Long.parseLong(valueMap.get("fid"));
deviceCount = Integer.parseInt(valueMap.get("devcount"));
storageClass = valueMap.get("class");
key = valueMap.get("key");
Expand All @@ -38,7 +38,7 @@ public long getLength() {
}

@Override
public int getFid() {
public long getFid() {
return fid;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public long getLength() {
}

@Override
public int getFid() {
public long getFid() {
return 0;
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/fm/last/moji/tracker/Destination.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public class Destination {

private final URL path;
private final int devId;
private final int fid;
private final long fid;

public Destination(URL path, int devId, int fid) {
public Destination(URL path, int devId, long fid) {
this.path = path;
this.devId = devId;
this.fid = fid;
Expand All @@ -40,7 +40,7 @@ public int getDevId() {
return devId;
}

public int getFid() {
public long getFid() {
return fid;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ private Request buildRequest() {
}

private void extractReturnValues(Response response) throws TrackerException {
int fid = Integer.parseInt(response.getValue("fid"));
long fid = Long.parseLong(response.getValue("fid"));
int pathCount = Integer.parseInt(response.getValue("dev_count"));
destinations = new ArrayList<Destination>(pathCount);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,12 @@ public void responseNormal() throws TrackerException, MalformedURLException {

Destination destination1 = destinations.get(0);
assertThat(destination1.getDevId(), is(1));
assertThat(destination1.getFid(), is(5));
assertThat(destination1.getFid(), is(5L));
assertThat(destination1.getPath(), is(new URL(PATH_1)));

Destination destination2 = destinations.get(1);
assertThat(destination2.getDevId(), is(2));
assertThat(destination2.getFid(), is(5));
assertThat(destination2.getFid(), is(5L));
assertThat(destination2.getPath(), is(new URL(PATH_2)));
}

Expand Down

0 comments on commit 58bb171

Please sign in to comment.