Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
tweaks to host startup
Browse files Browse the repository at this point in the history
  • Loading branch information
grze@eucalyptus.com committed Nov 7, 2011
1 parent 2a0f802 commit a4b50e4
Show file tree
Hide file tree
Showing 6 changed files with 206 additions and 214 deletions.
393 changes: 196 additions & 197 deletions clc/.classpath

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion clc/.project
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>eee_clc_dev:clc</name> <name>grze_eee_clc_dev:clc</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>
Expand Down
2 changes: 1 addition & 1 deletion clc/eucadmin/.project
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>eee_clc_dev:eucadmin</name> <name>grze_eee_clc_dev:eucadmin</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>
Expand Down
19 changes: 6 additions & 13 deletions clc/modules/msgs/src/main/java/com/eucalyptus/bootstrap/Hosts.java
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ public boolean apply( final Host arg0 ) {


} }


public enum Coordinator implements Predicate<Host>, Supplier<Host>, Function<Collection<Host>, Host> { public enum Coordinator implements Predicate<Host> {
INSTANCE; INSTANCE;
private final AtomicLong currentStartTime = new AtomicLong( Long.MAX_VALUE ); private final AtomicLong currentStartTime = new AtomicLong( Long.MAX_VALUE );


Expand Down Expand Up @@ -730,29 +730,22 @@ public Host createLocalHost( ) {
return new Host( Coordinator.INSTANCE.currentStartTime.get( ) ); return new Host( Coordinator.INSTANCE.currentStartTime.get( ) );
} }


@Override
public Host get( ) {
return this.apply( Hosts.hostMap.values( ) );
}

@Override
public Host apply( final Collection<Host> input ) { public Host apply( final Collection<Host> input ) {
Host ret = null; Host ret = null;
try { try {
ret = Iterables.find( input, this ); ret = Iterables.find( input, this );
} catch ( final NoSuchElementException ex ) { } catch ( final NoSuchElementException ex ) {
ret = Hosts.localHost( );
} }
LOG.debug( "Found coordinator: " + ret ); LOG.debug( "Found coordinator: " + ret );
return ret; return ret;
} }


public Boolean isLocalhost( ) { public Boolean isLocalhost( ) {
return this.apply( hostMap.values( ) ).isLocalHost( ); try {
} return Iterables.find( hostMap.values( ), this ).isLocalHost( );

} catch ( final NoSuchElementException ex ) {
public boolean getCurrentCoordinator( ) { return false;
return this.isLocalhost( ); }
} }


public long getCurrentStartTime( ) { public long getCurrentStartTime( ) {
Expand Down
2 changes: 1 addition & 1 deletion devel/.project
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>eee_clc_dev:devel</name> <name>grze_eee_clc_dev:devel</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>
Expand Down
2 changes: 1 addition & 1 deletion project/.project
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>eee_clc_dev:c</name> <name>grze_eee_clc_dev:c</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>
Expand Down

0 comments on commit a4b50e4

Please sign in to comment.