private static final int NUMBER_OF_THREADS = 4;
private static final long GET_DATA_SUBMIT_TIMEOUT = 3000;
private static final TimeUnit GET_DATA_SUBMIT_TIME_UNIT = TimeUnit.MILLISECONDS;
+ private static final TimeUnit MAX_DURATION_TO_SUBMIT_TIMEUNIT = TimeUnit.MILLISECONDS;
private final MountPointService mountPointService;
private final ScheduledExecutorService checkingExecutor;
private final ListeningExecutorService listeningExecutor;
private final ConcurrentMap<String, CountDownLatch> deviceLocks;
- private final long maxDurationToSubmitTransaction; // TODO set reasonable value in blueprint
- private final TimeUnit maxDurationToSubmitTransactionTimeUnit = TimeUnit.MILLISECONDS;
+ // TODO set reasonable value in blueprint for maxDurationToSubmitTransaction
+ private final long maxDurationToSubmitTransaction;
public DeviceTransactionManagerImpl(MountPointService mountPointService, long maxDurationToSubmitTransaction) {
this.mountPointService = mountPointService;
@Override
public Future<Optional<DeviceTransaction>> getDeviceTransaction(String deviceId) {
- return getDeviceTransaction(deviceId, maxDurationToSubmitTransaction, maxDurationToSubmitTransactionTimeUnit);
+ return getDeviceTransaction(deviceId, maxDurationToSubmitTransaction, MAX_DURATION_TO_SUBMIT_TIMEUNIT);
}
@Override
@SuppressWarnings("checkstyle:VariableDeclarationUsageDistance")
public double retrieveOSNR() {
- double sum = 0; // sum of 1 over the span OSNRs (linear units)
- double linkOsnrDb; // link OSNR, in dB
- double linkOsnrLu; // link OSNR, in dB
- double spanOsnrDb; // span OSNR, in dB
- double spanOsnrLu; // span OSNR, in linear units
- double ampNoise = 5.5; // default amplifier noise value, in dB
- double loss; // fiber span measured loss, in dB
- double power; // launch power, in dB
+ // sum of 1 over the span OSNRs (linear units)
+ double sum = 0;
+ // link OSNR, in dB
+ double linkOsnrDb;
+ // link OSNR, in dB
+ double linkOsnrLu;
+ // span OSNR, in dB
+ double spanOsnrDb;
+ // span OSNR, in linear units
+ double spanOsnrLu;
+ // default amplifier noise value, in dB
+ double ampNoise = 5.5;
+ // fiber span measured loss, in dB
+ double loss;
+ // launch power, in dB
+ double power;
double constantA = 38.97293;
double constantB = 0.72782;
double constantC = -0.532331;
double lowerBoundOSNR = 0.1;
if (omsAttributesSpan == null) {
- return 0L; // indicates no data or N/A
+ // indicates no data or N/A
+ return 0L;
}
loss = omsAttributesSpan.getSpanlossCurrent().getValue().doubleValue();
switch (omsAttributesSpan.getLinkConcatenation().get(0).getFiberType()) {
private boolean calcStatus = false;
private String responseCode = ResponseCodes.RESPONSE_FAILED;
private long resultWavelength = -1;
- private long rate = -1; // for now it is constant returned as received from A-end
+ // for now it is constant returned as received from A-end
+ private long rate = -1;
public enum LocalCause {
NONE, TOO_HIGH_LATENCY, NO_PATH_EXISTS, INT_PROBLEM;
this.calcMessage = "No path available";
break;
default:
- LOG.error("setRC: RespondeCodes unknown");//requires sl4j but not imported
+ LOG.error("setRC: RespondeCodes unknown");
}
}
public void cancelResourceReserve() {
LOG.info("Wait for 10s til beginning the PCE cancelResourceReserve request");
try {
- Thread.sleep(10000); // sleep for 10s
+ // sleep for 10s
+ Thread.sleep(10000);
} catch (InterruptedException e) {
LOG.error(e.toString());
}
double connOut = 0;
String typeVariety = "SSMF";
- double length = 0; //convert to kilometer
+ double length = 0;
// Compute the length of the link
List<LinkConcatenation> linkConcatenationList = span.getLinkConcatenation();
for (LinkConcatenation linkConcatenation : linkConcatenationList) {
double srlgLength = linkConcatenation.getSRLGLength();
- length += srlgLength / convertKmM; //convert to kilometer
+ //convert to kilometer
+ length += srlgLength / convertKmM;
}
Elements element1 = addElementsFiber(2, 0, "RLD", "Lannion_CAS",
.setOutVoa(outVoa).build();
Edfa edfa = new EdfaBuilder()
.setOperational(operational).build();
- Elements element1 = new ElementsBuilder().setUid(uidEdfa) // Choose an
- // ip
- // address
+ Elements element1 = new ElementsBuilder().setUid(uidEdfa)
+ // Choose an ip address
.setType(org.opendaylight.yang.gen.v1.gnpy.gnpy.network.topology.rev181214.Edfa.class)
.setMetadata(metadata1).setElementType(edfa).setTypeVariety(typeVariety).build();
return element1;