Skip to content

Commit

Permalink
new module is added
Browse files Browse the repository at this point in the history
  • Loading branch information
ThilinaManamgoda committed Sep 25, 2017
1 parent 4d0ddd6 commit 7775a93
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 5 deletions.
15 changes: 15 additions & 0 deletions dummyservice/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>serverless_architecture</artifactId>
<groupId>org.pera</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>dummy-service</artifactId>


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception
ctx.fireUserEventTriggered(proxyEvent);
} else if (stateImpl.getState() == InstanceStates.RUNNING) {
logger.info("These instances are up and running");
System.out.println(stateImpl.getOSVInstance().peek().getHost());
String remoteIp = LoadBalanceUtil.getRemoteHost(stateImpl);
try {
EtcdUtil.putValue(instanceID, StateImplJsonHelp.toString(stateImpl));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static void main(String[] args) throws InterruptedException, EtcdClientEx
// osvInstance.setHost("127.0.0.1:8082");
// osvInstance.setUuid(new UUID(1,1));
// state.pushOSVInstance(osvInstance);
// state.setState(InstanceStates.DOWN);
// state.setState(InstanceStates.RUNNING);
// state.setDomain("localhost");
//
// System.out.println(StateImplJsonHelp.toString(state));
Expand All @@ -124,7 +124,7 @@ public static void main(String[] args) throws InterruptedException, EtcdClientEx
// } catch (ExecutionException e) {
// e.printStackTrace();
// }
//

try {
ConfigLogger.printFields();
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public class OSVInstance {
UUID uuid;
String ipaddress;
String host;
static String port = Launcher.getString(ConfigConstants.CONFIG_SERVICES_DEFAULT_PORT );

public UUID getUuid() {
return uuid;
Expand All @@ -23,7 +22,11 @@ public void setUuid(UUID uuid) {
public void setIpaddress(String ipaddress) { this.ipaddress = ipaddress;}

public String getHost() {
return this.ipaddress +":"+ port;
return host;
}


public void setHost(String host) {
this.host = host;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public FullHttpResponse process(FullHttpRequest fullHttpRequest) {
remoteIp="127.0.0.1:"+8082;

//implementation of instance spawning

System.out.println(remoteIp);
ByteBuf content = Unpooled.copiedBuffer("Hello World.", CharsetUtil.UTF_8);
FullHttpResponse response = new DefaultFullHttpResponse(HttpVersion.HTTP_1_1,
remoteIp!=null? HttpResponseStatus.OK:HttpResponseStatus.SERVICE_UNAVAILABLE, content);
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<module>lambdanettyloadbalancer</module>
<module>lambdasystemservice</module>
<module>lambdacli</module>
<module>dummyservice</module>
</modules>
<packaging>pom</packaging>

Expand Down

0 comments on commit 7775a93

Please sign in to comment.