Projects >> eucalyptus >>740225889317b16b824e4fe3f7058d4db3db1942

Chunk
Conflicting content
  private VmTypeInfo                                  vmTypeInfo;
  
  private final AtomicMarkableReference      state         = new AtomicMarkableReference( VmState.PENDING, false );
<<<<<<< HEAD
  private final AtomicMarkableReference   bundleTask    = new AtomicMarkableReference( null, false );
  private final ConcurrentSkipListSet volumes       = new ConcurrentSkipListSet( );
=======
  private final ConcurrentMap  volumes       = new ConcurrentSkipListMap( );
>>>>>>> 31802b5f2dc264b8766c12008876b2032fc6aa2a
  private final StopWatch                             stopWatch     = new StopWatch( );
  private final StopWatch                             updateWatch     = new StopWatch( );
  
Solution content
  private VmTypeInfo                                  vmTypeInfo;
  
  private final AtomicMarkableReference      state         = new AtomicMarkableReference( VmState.PENDING, false );
  private final AtomicMarkableReference   bundleTask    = new AtomicMarkableReference( null, false );
  private final ConcurrentSkipListSet volumes       = new ConcurrentSkipListSet( );
  private final StopWatch                             stopWatch     = new StopWatch( );
  private final StopWatch                             updateWatch     = new StopWatch( );
  
File
VmInstance.java
Developer's decision
Version 1
Kind of conflict
Attribute
Method invocation
Chunk
Conflicting content
import com.eucalyptus.bootstrap.Component;
import com.eucalyptus.cluster.callback.StopNetworkCallback;
import com.eucalyptus.cluster.callback.TerminateCallback;
<<<<<<< HEAD
=======
import com.eucalyptus.component.Dispatcher;
>>>>>>> 31802b5f2dc264b8766c12008876b2032fc6aa2a
import com.eucalyptus.config.Configuration;
import com.eucalyptus.config.StorageControllerConfiguration;
import com.eucalyptus.event.AbstractNamedRegistry;
Solution content
import com.eucalyptus.bootstrap.Component;
import com.eucalyptus.cluster.callback.StopNetworkCallback;
import com.eucalyptus.cluster.callback.TerminateCallback;
import com.eucalyptus.config.Configuration;
import com.eucalyptus.config.StorageControllerConfiguration;
import com.eucalyptus.event.AbstractNamedRegistry;
File
VmInstances.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
import com.eucalyptus.util.async.UnconditionalCallback;
import com.eucalyptus.vm.SystemState;
import com.eucalyptus.vm.VmState;
<<<<<<< HEAD
import com.eucalyptus.vm.SystemState.Reason;
import com.eucalyptus.ws.client.ServiceDispatcher;
import com.eucalyptus.records.EventRecord;
=======
import com.eucalyptus.ws.client.ServiceDispatcher;
>>>>>>> 31802b5f2dc264b8766c12008876b2032fc6aa2a
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
Solution content
import com.eucalyptus.util.async.UnconditionalCallback;
import com.eucalyptus.vm.SystemState;
import com.eucalyptus.vm.VmState;
import com.eucalyptus.vm.SystemState.Reason;
import com.eucalyptus.ws.client.ServiceDispatcher;
import com.eucalyptus.records.EventRecord;
import com.google.common.base.Function;
File
VmInstances.java
Developer's decision
Version 1
Kind of conflict
Import
Chunk
Conflicting content
    }
  };
  private static void cleanUpAttachedVolumes( final VmInstance vm ) {
<<<<<<< HEAD
    Cluster cluster = Clusters.getInstance( ).lookup( vm.getPlacement( ) );
    if ( !vm.getVolumes( ).isEmpty( ) ) {
      try {
        StorageControllerConfiguration sc = Configuration.lookupSc( vm.getPlacement( ) );
        for ( AttachedVolume volume : vm.getVolumes( ) ) {
          try {
            ServiceDispatcher.lookup( Component.storage, sc.getHostName( ) ).send( new DetachStorageVolumeType(
                                                                                                                cluster.getNode( vm.getServiceTag( ) ).getIqn( ),
                                                                                                                volume.getVolumeId( ) ) );
            vm.getVolumes( ).remove( volume );
          } catch ( Throwable e ) {
            LOG.error( "Failed sending Detach Storage Volume for: " + volume.getVolumeId( )
                       + ".  Will keep trying as long as instance is reported.  The request failed because of: " + e.getMessage( ), e );
          }
        }
      } catch ( Exception ex ) {
        LOG.error( "Failed to lookup Storage Controller configuration for: " + vm.getInstanceId( ) + " (placement=" + vm.getPlacement( ) + ").  " +
                   "The the following volumes are attached: " + Iterables.transform( vm.getVolumes( ), new Function( ) {
                     
                     @Override
                     public String apply( AttachedVolume arg0 ) {
                       return arg0.getVolumeId( );
                     }
                   } ) );
      }
=======
    try {
      final Cluster cluster = Clusters.getInstance( ).lookup( vm.getPlacement( ) );
      final StorageControllerConfiguration sc = Configuration.lookupSc( vm.getPlacement( ) );
      vm.eachVolumeAttachment( new Predicate( ) {
        @Override
        public boolean apply( AttachedVolume arg0 ) {
          try {
            vm.removeVolumeAttachment( arg0.getVolumeId( ) );
            Dispatcher scDispatcher = ServiceDispatcher.lookup( Component.storage, sc.getHostName( ) );
            scDispatcher.send( new DetachStorageVolumeType( cluster.getNode( vm.getServiceTag( ) ).getIqn( ), arg0.getVolumeId( ) ) );
            return true;
          } catch ( Throwable e ) {
            LOG.error( "Failed sending Detach Storage Volume for: " + arg0.getVolumeId( )
                       + ".  Will keep trying as long as instance is reported.  The request failed because of: " + e.getMessage( ), e );
            return false;
          }
        }
      } );
    } catch ( Exception ex ) {
      LOG.error( "Failed to lookup Storage Controller configuration for: " + vm.getInstanceId( ) + " (placement=" + vm.getPlacement( ) + ").  " );
>>>>>>> 31802b5f2dc264b8766c12008876b2032fc6aa2a
    }
  }
Solution content
  private static void cleanUpAttachedVolumes( final VmInstance vm ) {
    Cluster cluster = Clusters.getInstance( ).lookup( vm.getPlacement( ) );
    if ( !vm.getVolumes( ).isEmpty( ) ) {
      try {
        StorageControllerConfiguration sc = Configuration.lookupSc( vm.getPlacement( ) );
        for ( AttachedVolume volume : vm.getVolumes( ) ) {
          try {
            ServiceDispatcher.lookup( Component.storage, sc.getHostName( ) ).send( new DetachStorageVolumeType(
                                                                                                                cluster.getNode( vm.getServiceTag( ) ).getIqn( ),
                                                                                                                volume.getVolumeId( ) ) );
            vm.getVolumes( ).remove( volume );
          } catch ( Throwable e ) {
            LOG.error( "Failed sending Detach Storage Volume for: " + volume.getVolumeId( )
                       + ".  Will keep trying as long as instance is reported.  The request failed because of: " + e.getMessage( ), e );
          }
        }
      } catch ( Exception ex ) {
        LOG.error( "Failed to lookup Storage Controller configuration for: " + vm.getInstanceId( ) + " (placement=" + vm.getPlacement( ) + ").  " +
                   "The the following volumes are attached: " + Iterables.transform( vm.getVolumes( ), new Function( ) {
                     
                     @Override
                     public String apply( AttachedVolume arg0 ) {
                       return arg0.getVolumeId( );
                     }
                   } ) );
      }
    }
  }
File
VmInstances.java
Developer's decision
Version 1
Kind of conflict
Catch clause
If statement
Method invocation
Try statement
Variable