Skip to content
This repository has been archived by the owner on Jan 15, 2020. It is now read-only.

Commit

Permalink
Merge branch 'master-pre-merge' into mongo
Browse files Browse the repository at this point in the history
  • Loading branch information
sdesmond46 committed Nov 21, 2018
2 parents c29d7c0 + 7f92624 commit a893c7e
Show file tree
Hide file tree
Showing 23 changed files with 1,055 additions and 422 deletions.
17 changes: 15 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,12 @@ task extractVmDepsGit(dependsOn: getVmDependencies, type: Copy) {
}
}

task cleanJars {
delete 'jars'
}

task collectDependentJars(type: Copy) {
dependsOn cleanJars
into dirRuntimeJars
from { subprojects.configurations.runtime }
from { subprojects.jar}
Expand All @@ -247,7 +252,10 @@ build {
task prePack(type:Exec) {
dependsOn ':aion_api:cleanPack'
dependsOn ':aion_api:build'
commandLine 'sh', 'script/prepack.sh'
if (project.hasProperty('noGui')) {
environment "noGui", "true"
}
commandLine 'bash', 'script/prepack.sh'
}
task postPack(type:Exec) { commandLine 'sh', 'script/postpack.sh' }

Expand All @@ -269,7 +277,10 @@ task pack(type: Tar) {
}
into('/aion/') {
from dirWorkspace
include 'aion.sh', 'aion_gui.sh'
include 'aion.sh'
if (!project.hasProperty('noGui')) {
include 'aion_gui.sh'
}
}
into('/aion/native') {
from dirNative
Expand Down Expand Up @@ -313,6 +324,7 @@ task packDevDocker(type: Exec) {
clean {
dependsOn "ant-3rd_clean"
dependsOn ':aion_api:clean'
dependsOn 'cleanJars'
delete dirPack
delete file('report')
}
Expand Down Expand Up @@ -354,3 +366,4 @@ task fixIdea {
dependsOn test
}
}

70 changes: 70 additions & 0 deletions modAionImpl/src/org/aion/zero/impl/sync/RequestCounter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* Copyright (c) 2017-2018 Aion foundation.
*
* This file is part of the aion network project.
*
* The aion network project is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or any later version.
*
* The aion network project is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the aion network project source files.
* If not, see <https://www.gnu.org/licenses/>.
*
* Contributors:
* Aion foundation.
*/

package org.aion.zero.impl.sync;

/**
* Used for tracking different types of requests made to peers.
*
* @author Alexandra Roatis
*/
public class RequestCounter {

private long status = 0;
private long headers = 0;
private long bodies = 0;
private long total = 0;

public RequestCounter() {}

public long getStatus() {
return status;
}

public long getHeaders() {
return headers;
}

public long getBodies() {
return bodies;
}

public long getTotal() {
return total;
}

public void incStatus() {
this.status++;
this.total++;
}

public void incHeaders() {
this.headers++;
this.total++;
}

public void incBodies() {
this.bodies++;
this.total++;
}
}
35 changes: 35 additions & 0 deletions modAionImpl/src/org/aion/zero/impl/sync/RequestType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Copyright (c) 2017-2018 Aion foundation.
*
* This file is part of the aion network project.
*
* The aion network project is free software: you can redistribute it
* and/or modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of
* the License, or any later version.
*
* The aion network project is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the aion network project source files.
* If not, see <https://www.gnu.org/licenses/>.
*
* Contributors:
* Aion foundation.
*/

package org.aion.zero.impl.sync;

/**
* Used for tracking different types of requests made to peers.
*
* @author Alexandra Roatis
*/
public enum RequestType {
STATUS,
HEADERS,
BODIES
}
2 changes: 2 additions & 0 deletions modAionImpl/src/org/aion/zero/impl/sync/SyncMgr.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ public void init(
downloadedHeaders,
headersWithBodiesRequested,
peerStates,
stats,
log),
"sync-gb");
syncGb.start();
Expand Down Expand Up @@ -249,6 +250,7 @@ private void getHeaders(BigInteger _selfTd) {
chain.getBestBlock().getNumber(),
_selfTd,
peerStates,
stats,
log));
queueFull.set(false);
}
Expand Down
Loading

0 comments on commit a893c7e

Please sign in to comment.