Projects >> Priam >>19bd1386a06acb3f061eb46d8c0f5a27a511a2a8

Chunk
Conflicting content
    public String getCassProcessName();

    /**
<<<<<<< HEAD
     * @return New Keyspace Name on Target Cluster
     */
    public String getTargetKSName();
    
    /**
     * @return New Column Family Name on Target Cluster
     */
    public String getTargetCFName();
    
    /**
     * @return true/false, if Cassandra needs to be started manually
     */
    public boolean doesCassandraStartManually();
=======
     * Defaults to 'allow all'.
     */
    public String getAuthenticator();

    /**
     * Defaults to 'allow all'.
     */
    public String getAuthorizer();
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1
}
Solution content
    public String getCassProcessName();

    /**
     * Defaults to 'allow all'.
     */
    public String getAuthenticator();
    /**
     * Defaults to 'allow all'.
     */
    public String getAuthorizer();

    /**
     * @return New Keyspace Name on Target Cluster
     */
    public String getTargetKSName();
    
    /**
     * @return New Column Family Name on Target Cluster
     */
    public String getTargetCFName();
    
    /**
     * @return true/false, if Cassandra needs to be started manually
     */
    public boolean doesCassandraStartManually();

}
File
IConfiguration.java
Developer's decision
Concatenation
Kind of conflict
Comment
Method interface
Chunk
Conflicting content
import com.netflix.priam.utils.CassandraMonitor;
import com.netflix.priam.utils.Sleeper;
import com.netflix.priam.utils.TuneCassandra;
<<<<<<< HEAD
import org.apache.commons.collections.CollectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
=======
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1

/**
 * Start all tasks here - Property update task - Backup task - Restore task -
Solution content
import com.netflix.priam.utils.CassandraMonitor;
import com.netflix.priam.utils.Sleeper;
import com.netflix.priam.utils.SystemUtils;
import com.netflix.priam.utils.TuneCassandra;

/**
 * Start all tasks here - Property update task - Backup task - Restore task -
File
PriamServer.java
Developer's decision
Manual
Kind of conflict
Import
Chunk
Conflicting content
        if (!config.getRestoreSnapshot().equals(""))
            scheduler.addTask(Restore.JOBNAME, Restore.class, Restore.getTimer());
        else
<<<<<<< HEAD
        {
        		if(!config.doesCassandraStartManually())
        			SystemUtils.startCassandra(true, config); // Start cassandra.
        		else
        			logger.info("config.doesCassandraStartManually() is set to True, hence Cassandra needs to be started manually ...");
        }
=======
            cassProcess.start(true);
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1

        /*
         *  Run the delayed task (after 10 seconds) to Monitor Cassandra
Solution content
        if (!config.getRestoreSnapshot().equals(""))
            scheduler.addTask(Restore.JOBNAME, Restore.class, Restore.getTimer());
        else
        {
        		if(!config.doesCassandraStartManually())
        			cassProcess.start(true);				 // Start cassandra.
        		else
        			logger.info("config.doesCassandraStartManually() is set to True, hence Cassandra needs to be started manually ...");
        }

        /*
         *  Run the delayed task (after 10 seconds) to Monitor Cassandra
File
PriamServer.java
Developer's decision
Manual
Kind of conflict
If statement
Method invocation
Chunk
Conflicting content
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
<<<<<<< HEAD
import com.google.inject.name.Named;
=======
import com.netflix.priam.ICassandraProcess;
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1
import com.netflix.priam.IConfiguration;
import com.netflix.priam.backup.AbstractBackupPath.BackupFileType;
import com.netflix.priam.identity.InstanceIdentity;
Solution content
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;
import com.google.inject.name.Named;
import com.netflix.priam.ICassandraProcess;
import com.netflix.priam.IConfiguration;
import com.netflix.priam.backup.AbstractBackupPath.BackupFileType;
import com.netflix.priam.identity.InstanceIdentity;
File
Restore.java
Developer's decision
Concatenation
Kind of conflict
Import
Chunk
Conflicting content
    private InstanceIdentity id;

    @Inject
<<<<<<< HEAD
    public Restore(IConfiguration config, @Named("backup")IBackupFileSystem fs,Sleeper sleeper)
    {
        super(config, fs, JOBNAME, sleeper);
=======
    public Restore(IConfiguration config, Sleeper sleeper, ICassandraProcess cassProcess)
    {
        super(config, JOBNAME, sleeper);
        this.cassProcess = cassProcess;
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1
    }

    @Override
Solution content
    private InstanceIdentity id;

    @Inject
    public Restore(IConfiguration config, @Named("backup")IBackupFileSystem fs,Sleeper sleeper, ICassandraProcess cassProcess)
    {
        super(config, fs, JOBNAME, sleeper);
        this.cassProcess = cassProcess;
    }

    @Override
File
Restore.java
Developer's decision
Manual
Kind of conflict
Attribute
Method invocation
Method signature
Chunk
Conflicting content
    private static final String CONFIG_ENDPOINT_SNITCH = PRIAM_PRE + ".endpoint_snitch";
    private static final String CONFIG_MEMTABLE_TOTAL_SPACE = PRIAM_PRE + ".memtabletotalspace";
    private static final String CONFIG_CASS_PROCESS_NAME = PRIAM_PRE + ".cass.process";
<<<<<<< HEAD
    private static final String CONFIG_TARGET_KEYSPACE_NAME = PRIAM_PRE + ".target.keyspace";
    private static final String CONFIG_TARGET_COLUMN_FAMILY_NAME = PRIAM_PRE + ".target.columnfamily";
    private static final String CONFIG_CASS_MANUAL_START_ENABLE = PRIAM_PRE + ".cass.manual.start.enable";
=======
    private static final String CONFIG_YAML_LOCATION = PRIAM_PRE + ".yamlLocation";
    private static final String CONFIG_AUTHENTICATOR = PRIAM_PRE + ".authenticator";
    private static final String CONFIG_AUTHORIZER = PRIAM_PRE + ".authorizer";
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1

    // Backup and Restore
    private static final String CONFIG_BACKUP_THREADS = PRIAM_PRE + ".backup.threads";
Solution content
    private static final String CONFIG_ENDPOINT_SNITCH = PRIAM_PRE + ".endpoint_snitch";
    private static final String CONFIG_MEMTABLE_TOTAL_SPACE = PRIAM_PRE + ".memtabletotalspace";
    private static final String CONFIG_CASS_PROCESS_NAME = PRIAM_PRE + ".cass.process";
    private static final String CONFIG_YAML_LOCATION = PRIAM_PRE + ".yamlLocation";
    private static final String CONFIG_AUTHENTICATOR = PRIAM_PRE + ".authenticator";
    private static final String CONFIG_AUTHORIZER = PRIAM_PRE + ".authorizer";
    private static final String CONFIG_TARGET_KEYSPACE_NAME = PRIAM_PRE + ".target.keyspace";
    private static final String CONFIG_TARGET_COLUMN_FAMILY_NAME = PRIAM_PRE + ".target.columnfamily";
    private static final String CONFIG_CASS_MANUAL_START_ENABLE = PRIAM_PRE + ".cass.manual.start.enable";

    // Backup and Restore
    private static final String CONFIG_BACKUP_THREADS = PRIAM_PRE + ".backup.threads";
File
PriamConfiguration.java
Developer's decision
Concatenation
Kind of conflict
Attribute
Chunk
Conflicting content
        return config.getProperty(CONFIG_CASS_PROCESS_NAME, DEFAULT_CASS_PROCESS_NAME);
	}

<<<<<<< HEAD
	@Override
	public String getTargetKSName() {
		return config.getProperty(CONFIG_TARGET_KEYSPACE_NAME, null);
	}

	@Override
	public String getTargetCFName() {
		return config.getProperty(CONFIG_TARGET_COLUMN_FAMILY_NAME, null);
	}

	@Override
	public boolean doesCassandraStartManually() {
		return config.getBoolean(CONFIG_CASS_MANUAL_START_ENABLE, false);
	}
=======
    public String getYamlLocation()
    {
        return config.getProperty(CONFIG_YAML_LOCATION, getCassHome() + "/conf/cassandra.yaml");
    }

    public String getAuthenticator()
    {
        return config.getProperty(CONFIG_AUTHENTICATOR, DEFAULT_AUTHENTICATOR);
    }

    public String getAuthorizer()
    {
        return config.getProperty(CONFIG_AUTHORIZER, DEFAULT_AUTHORIZER);
    }
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1
}
Solution content
    {
        return config.getProperty(CONFIG_CASS_PROCESS_NAME, DEFAULT_CASS_PROCESS_NAME);
	}

    public String getYamlLocation()
    {
        return config.getProperty(CONFIG_YAML_LOCATION, getCassHome() + "/conf/cassandra.yaml");
    }

    public String getAuthenticator()
        return config.getProperty(CONFIG_AUTHENTICATOR, DEFAULT_AUTHENTICATOR);
    }

    public String getAuthorizer()
    {
        return config.getProperty(CONFIG_AUTHORIZER, DEFAULT_AUTHORIZER);
    }
    
	@Override
	public String getTargetKSName() {
		return config.getProperty(CONFIG_TARGET_KEYSPACE_NAME, null);
	}

	@Override
	public String getTargetCFName() {
		return config.getProperty(CONFIG_TARGET_COLUMN_FAMILY_NAME, null);
	}

	@Override
	public boolean doesCassandraStartManually() {
		return config.getBoolean(CONFIG_CASS_MANUAL_START_ENABLE, false);
	}

}
File
PriamConfiguration.java
Developer's decision
Concatenation
Kind of conflict
Annotation
Method declaration
Chunk
Conflicting content
import com.google.inject.Inject;
import com.google.inject.Provider;
<<<<<<< HEAD
import com.google.inject.name.Named;
=======
import com.netflix.priam.ICassandraProcess;
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1
import com.netflix.priam.IConfiguration;
import com.netflix.priam.PriamServer;
import com.netflix.priam.backup.AbstractBackupPath;
Solution content
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.name.Named;
import com.netflix.priam.ICassandraProcess;
import com.netflix.priam.IConfiguration;
import com.netflix.priam.PriamServer;
import com.netflix.priam.backup.AbstractBackupPath;
File
BackupServlet.java
Developer's decision
Concatenation
Kind of conflict
Import
Chunk
Conflicting content
    private PriamScheduler scheduler;

    @Inject
<<<<<<< HEAD
    public BackupServlet(PriamServer priamServer, IConfiguration config, @Named("backup")IBackupFileSystem fs, Restore restoreObj, Provider pathProvider, TuneCassandra tunecassandra,
            SnapshotBackup snapshotBackup, IPriamInstanceFactory factory, ITokenManager tokenManager)
=======
    public BackupServlet(PriamServer priamServer, IConfiguration config, IBackupFileSystem fs, Restore restoreObj, Provider pathProvider, CassandraTuner tuner,
            SnapshotBackup snapshotBackup, IPriamInstanceFactory factory, ITokenManager tokenManager, ICassandraProcess cassProcess)
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1
    {
        this.priamServer = priamServer;
        this.config = config;
Solution content
    private PriamScheduler scheduler;

    @Inject
    public BackupServlet(PriamServer priamServer, IConfiguration config, @Named("backup")IBackupFileSystem fs, Restore restoreObj, Provider pathProvider, CassandraTuner tuner,
            SnapshotBackup snapshotBackup, IPriamInstanceFactory factory, ITokenManager tokenManager, ICassandraProcess cassProcess)

    {
        this.priamServer = priamServer;
        this.config = config;
File
BackupServlet.java
Developer's decision
Manual
Kind of conflict
Method signature
Chunk
Conflicting content
import java.util.List;
import java.util.Set;

<<<<<<< HEAD
import javax.management.JMX;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import org.apache.cassandra.config.ConfigurationException;
=======
import com.netflix.priam.utils.CassandraTuner;
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1
import org.apache.cassandra.io.sstable.SSTableLoader.Client;
import org.apache.cassandra.io.util.FileUtils;
import org.apache.cassandra.net.MessagingService;
Solution content
import java.util.List;
import java.util.Set;

import org.apache.cassandra.config.ConfigurationException;
import org.apache.cassandra.io.sstable.SSTableLoader.Client;
import org.apache.cassandra.io.util.FileUtils;
File
SSTableLoaderWrapper.java
Developer's decision
Combination
Kind of conflict
Import
Chunk
Conflicting content
    private static Set allComponents = Sets.newHashSet(Component.COMPRESSION_INFO, Component.DATA, Component.FILTER, Component.PRIMARY_INDEX, Component.STATS, Component.DIGEST);
    private final IConfiguration config;
    @Inject
<<<<<<< HEAD
    public SSTableLoaderWrapper(IConfiguration config) throws IOException
    {        
        String srcCassYamlFile =  config.getCassHome() + "/conf/cassandra.yaml";
        String targetYamlLocation = "/tmp/";
        
        File sourceFile = new File(srcCassYamlFile);
        File targetFile = new File(targetYamlLocation+"incr-restore-cassandra.yaml");
        logger.info("Copying file : " + sourceFile.getName() +" to --> "+targetFile.getName());
      
        //copy file from one location to another
        Files.copy(sourceFile, targetFile);
        
        logger.info("Trying to load the yaml file from: " + targetFile);
        TuneCassandra.updateYaml(config, targetFile.getPath(), "localhost", "org.apache.cassandra.locator.SimpleSeedProvider");
        System.setProperty("cassandra.config", "file:"+ targetFile.getPath());

        this.config = config;
=======
    public SSTableLoaderWrapper(IConfiguration config, CassandraTuner tuner) throws IOException
    {
        URL url = this.getClass().getClassLoader().getResource("incr-restore-cassandra.yaml");
        logger.info("Trying to load the yaml file from: " + url);
        tuner.updateYaml(url.getPath(), "localhost", "org.apache.cassandra.locator.SimpleSeedProvider");
        System.setProperty("cassandra.config", "file:"+ url.getPath());
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1
    }

    private final OutputHandler options = new OutputHandler()
Solution content
    private static Set allComponents = Sets.newHashSet(Component.COMPRESSION_INFO, Component.DATA, Component.FILTER, Component.PRIMARY_INDEX, Component.STATS, Component.DIGEST);
    private final IConfiguration config;
    
    @Inject
    public SSTableLoaderWrapper(IConfiguration config, CassandraTuner tuner) throws IOException
    {
    		this.config = config;
		String srcCassYamlFile =  config.getCassHome() + "/conf/cassandra.yaml";
		String targetYamlLocation = "/tmp/";
    
		File sourceFile = new File(srcCassYamlFile);
		File targetFile = new File(targetYamlLocation+"incr-restore-cassandra.yaml");
		logger.info("Copying file : " + sourceFile.getName() +" to --> "+targetFile.getName());
  
		//copy file from one location to another
		Files.copy(sourceFile, targetFile);
    
        logger.info("Trying to load the yaml file from: " + targetFile);
        tuner.updateYaml(targetFile.getPath(), "localhost", "org.apache.cassandra.locator.SimpleSeedProvider");
        System.setProperty("cassandra.config", "file:"+ targetFile.getPath());
    }

    private final OutputHandler options = new OutputHandler()
File
SSTableLoaderWrapper.java
Developer's decision
Manual
Kind of conflict
Attribute
Comment
Method invocation
Method signature
Variable
Chunk
Conflicting content
		return "CassandraDaemon";
	}

<<<<<<< HEAD
	@Override
	public String getTargetKSName() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getTargetCFName() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean doesCassandraStartManually() {
		// TODO Auto-generated method stub
		return false;
	}
=======
    public String getYamlLocation()
    {
        return "conf/cassandra.yaml";
    }

    public String getAuthenticator()
    {
        return PriamConfiguration.DEFAULT_AUTHENTICATOR;
    }

    public String getAuthorizer()
    {
        return PriamConfiguration.DEFAULT_AUTHORIZER;
    }
>>>>>>> 5c9d5d67d544fee95f3762fcfc5ba878585102b1
}
Solution content
		return "CassandraDaemon";
	}

    public String getYamlLocation()
    {
        return "conf/cassandra.yaml";
    }

    public String getAuthenticator()
    {
        return PriamConfiguration.DEFAULT_AUTHENTICATOR;
    }

    public String getAuthorizer()
    {
        return PriamConfiguration.DEFAULT_AUTHORIZER;
    }
    
	@Override
	public String getTargetKSName() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getTargetCFName() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean doesCassandraStartManually() {
		// TODO Auto-generated method stub
		return false;
	}

}
File
FakeConfiguration.java
Developer's decision
Concatenation
Kind of conflict
Annotation
Method declaration