Skip to content

Commit 97b693c

Browse files
committed
src: reformat to unify the code style
Issue: #151
1 parent e37f05d commit 97b693c

File tree

989 files changed

+10766
-8785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

989 files changed

+10766
-8785
lines changed

basic-client/src/main/java/org/dcache/nfs/v4/client/FileIoDevice.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.net.InetSocketAddress;
2323
import java.net.UnknownHostException;
2424
import java.util.Arrays;
25+
2526
import org.dcache.nfs.v4.xdr.netaddr4;
2627
import org.dcache.nfs.v4.xdr.nfsv4_1_file_layout_ds_addr4;
2728
import org.dcache.oncrpc4j.rpc.net.InetSocketAddresses;
@@ -40,8 +41,8 @@ public FileIoDevice(nfsv4_1_file_layout_ds_addr4 addr)
4041
}
4142
_ds_list = new InetSocketAddress[addr.nflda_multipath_ds_list.length];
4243
for (int i = 0; i < _ds_list.length; i++) {
43-
for(netaddr4 na : addr.nflda_multipath_ds_list[i].value) {
44-
if (na.na_r_netid.equals("tcp") || na.na_r_netid.equals("tcp6") ) {
44+
for (netaddr4 na : addr.nflda_multipath_ds_list[i].value) {
45+
if (na.na_r_netid.equals("tcp") || na.na_r_netid.equals("tcp6")) {
4546
_ds_list[i] = InetSocketAddresses.forUaddrString(na.na_r_addr);
4647
break;
4748
}

basic-client/src/main/java/org/dcache/nfs/v4/client/GetdeviceinfoStub.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public static nfs_argop4 generateRequest(deviceid4 devId) {
3737
op.opgetdeviceinfo.gdia_device_id = devId;
3838
op.opgetdeviceinfo.gdia_layout_type = layouttype4.LAYOUT4_NFSV4_1_FILES.getValue();
3939
op.opgetdeviceinfo.gdia_maxcount = new count4(0xffffff);
40-
op.opgetdeviceinfo.gdia_notify_types = new bitmap4( new int[] {0});
40+
op.opgetdeviceinfo.gdia_notify_types = new bitmap4(new int[] {0});
4141

4242
return op;
4343

basic-client/src/main/java/org/dcache/nfs/v4/client/LayoutgetStub.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public static nfs_argop4 generateRequest(boolean signal_layout_avail,
4747
op.oplayoutget.loga_layout_type = layout_type;
4848
op.oplayoutget.loga_iomode = iomode;
4949

50-
op.oplayoutget.loga_offset = new offset4(offset);
51-
op.oplayoutget.loga_length = new length4(length);
52-
op.oplayoutget.loga_minlength = new length4(minlength);
53-
op.oplayoutget.loga_maxcount = new count4(maxcount);
50+
op.oplayoutget.loga_offset = new offset4(offset);
51+
op.oplayoutget.loga_length = new length4(length);
52+
op.oplayoutget.loga_minlength = new length4(minlength);
53+
op.oplayoutget.loga_maxcount = new count4(maxcount);
5454

5555
op.oplayoutget.loga_stateid = stateid;
5656

basic-client/src/main/java/org/dcache/nfs/v4/client/Main.java

Lines changed: 94 additions & 85 deletions
Large diffs are not rendered by default.

basic-client/src/main/java/org/dcache/nfs/v4/client/Stripe.java

Lines changed: 26 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
*/
2020
package org.dcache.nfs.v4.client;
2121

22-
import com.google.common.base.MoreObjects;
2322
import org.dcache.nfs.v4.xdr.deviceid4;
2423
import org.dcache.nfs.v4.xdr.nfs4_prot;
2524
import org.dcache.nfs.v4.xdr.nfs_fh4;
2625

27-
public class Stripe {
26+
import com.google.common.base.MoreObjects;
2827

28+
public class Stripe {
2929

3030
private final long _offset;
3131
private final long _len;
@@ -35,7 +35,6 @@ public class Stripe {
3535
private final int _unit;
3636
private final int _first_stripe_index;
3737

38-
3938
/**
4039
* Construct new stripe unit.
4140
*
@@ -49,17 +48,17 @@ public class Stripe {
4948
* @throws IllegalArgumentException
5049
*/
5150
public Stripe(deviceid4 deviceId, nfs_fh4 fh, long len, long offset,
52-
long pattern_offset,
53-
int unit, int first_stripe_index)
51+
long pattern_offset,
52+
int unit, int first_stripe_index)
5453
throws IllegalArgumentException {
5554

56-
if( deviceId == null ) {
55+
if (deviceId == null) {
5756
throw new IllegalArgumentException("device id is null");
5857
}
5958

6059
_deviceId = deviceId;
6160

62-
if( fh == null ) {
61+
if (fh == null) {
6362
throw new IllegalArgumentException("NFS file hadle is null");
6463
}
6564

@@ -68,7 +67,7 @@ public Stripe(deviceid4 deviceId, nfs_fh4 fh, long len, long offset,
6867
/*
6968
* handle special case: -1 is reserved value for entire file
7069
*/
71-
this._len = len == -1 ? Long.MAX_VALUE: len;
70+
this._len = len == -1 ? Long.MAX_VALUE : len;
7271
this._offset = offset;
7372
_pattern_offset = pattern_offset;
7473
_unit = unit;
@@ -93,18 +92,21 @@ public int getUnit() {
9392
public long getOffset() {
9493
return _offset;
9594
}
95+
9696
/**
9797
* @return the len
9898
*/
9999
public long getLen() {
100100
return _len;
101101
}
102+
102103
/**
103104
* @return the deviceId
104105
*/
105106
public deviceid4 getDeviceId() {
106107
return _deviceId;
107108
}
109+
108110
/**
109111
* @return the _fh
110112
*/
@@ -116,7 +118,9 @@ public boolean isCommitThroughMDS() {
116118
return (_unit & nfs4_prot.NFL4_UFLG_COMMIT_THRU_MDS) != 0;
117119
}
118120

119-
/* (non-Javadoc)
121+
/*
122+
* (non-Javadoc)
123+
*
120124
* @see java.lang.Object#hashCode()
121125
*/
122126
@Override
@@ -131,20 +135,27 @@ public int hashCode() {
131135
return result;
132136
}
133137

134-
/* (non-Javadoc)
138+
/*
139+
* (non-Javadoc)
140+
*
135141
* @see java.lang.Object#equals(java.lang.Object)
136142
*/
137143
@Override
138144
public boolean equals(Object obj) {
139-
if (this == obj) return true;
140-
if ( !(obj instanceof Stripe) ) return false;
145+
if (this == obj)
146+
return true;
147+
if (!(obj instanceof Stripe))
148+
return false;
141149

142150
Stripe other = (Stripe) obj;
143151
// FIXME:
144152

145-
if( !_deviceId.equals(other._deviceId)) return false;
146-
if (_len != other._len) return false;
147-
if (_offset != other._offset) return false;
153+
if (!_deviceId.equals(other._deviceId))
154+
return false;
155+
if (_len != other._len)
156+
return false;
157+
if (_offset != other._offset)
158+
return false;
148159
return true;
149160
}
150161

basic-client/src/main/java/org/dcache/nfs/v4/client/StripeMap.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import java.util.ArrayList;
2323
import java.util.LinkedList;
2424
import java.util.List;
25+
2526
import org.dcache.nfs.v4.xdr.stateid4;
2627

2728
/**
@@ -32,30 +33,33 @@
3233
public class StripeMap {
3334

3435
private stateid4 _stateid;
36+
3537
public StripeMap(stateid4 stateid) {
3638
_stateid = stateid;
3739
}
40+
3841
/**
3942
* List off all know stripes.
4043
*/
4144
private final List<Stripe> _fileStripeLsit = new ArrayList<>();
4245

4346
/**
4447
* Get list of stripes for the range.
48+
*
4549
* @param offset
4650
* @param len
4751
* @return list of stripes or empty list if the is no stripes found.
4852
*/
49-
public List<Stripe> getStripe(long offset , long len) {
53+
public List<Stripe> getStripe(long offset, long len) {
5054

5155
List<Stripe> ioStripe = new LinkedList<>();
5256

53-
for(Stripe stripe: _fileStripeLsit) {
57+
for (Stripe stripe : _fileStripeLsit) {
5458

55-
if( stripe.getOffset() + stripe.getLen() >= offset ) {
59+
if (stripe.getOffset() + stripe.getLen() >= offset) {
5660
ioStripe.add(stripe);
5761

58-
if( stripe.getOffset() + stripe.getLen() >= offset + len ) {
62+
if (stripe.getOffset() + stripe.getLen() >= offset + len) {
5963
break;
6064
}
6165
}

0 commit comments

Comments
 (0)