conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
Path outputVariantsFile = output.resolve(fileName + ".variants." + format + extension);
// Metadata file must be in JSON format
final Path outputMetaFile = output.resolve(fileName + ".file.json" + extension);
=======
// Close at the end!
final MalformedVariantHandler malformedHandler;
try {
malformedHandler = new MalformedVariantHandler(outputMalformedVariants);
} catch (IOException e) {
throw new StorageManagerException(e.getMessage(), e);
}
>>>>>>>
// Close at the end!
final MalformedVariantHandler malformedHandler;
try {
malformedHandler = new MalformedVariantHandler(outputMalformedVariants);
} catch (IOException e) {
throw new StorageManagerException(e.getMessage(), e);
}
<<<<<<<
taskSupplier = () -> new VariantAvroTransformTask(factory, finalSource, outputMetaFile, statsCalculator, includeSrc)
.setFailOnError(failOnError);
=======
taskSupplier = () -> new VariantAvroTransformTask(factory, finalSource, finalOutputMetaFile, statsCalculator, includeSrc)
.setFailOnError(failOnError).addMalformedErrorHandler(malformedHandler);
>>>>>>>
taskSupplier = () -> new VariantAvroTransformTask(factory, finalSource, outputMetaFile, statsCalculator, includeSrc)
.setFailOnError(failOnError).addMalformedErrorHandler(malformedHandler);
<<<<<<<
outputMetaFile, statsCalculator, includeSrc, generateReferenceBlocks)
.setFailOnError(failOnError);
=======
finalOutputFileJsonFile, statsCalculator, includeSrc, generateReferenceBlocks)
.setFailOnError(failOnError).addMalformedErrorHandler(malformedHandler);
>>>>>>>
outputMetaFile, statsCalculator, includeSrc, generateReferenceBlocks)
.setFailOnError(failOnError).addMalformedErrorHandler(malformedHandler);
<<<<<<<
taskSupplier = () -> new VariantJsonTransformTask(factory, finalSource, outputMetaFile, statsCalculator, includeSrc)
.setFailOnError(failOnError);
=======
taskSupplier = () -> new VariantJsonTransformTask(factory, finalSource, finalOutputMetaFile, statsCalculator, includeSrc)
.setFailOnError(failOnError).addMalformedErrorHandler(malformedHandler);
>>>>>>>
taskSupplier = () -> new VariantJsonTransformTask(factory, finalSource, outputMetaFile, statsCalculator, includeSrc)
.setFailOnError(failOnError).addMalformedErrorHandler(malformedHandler); |
<<<<<<<
public CohortMongoDBIterator(MongoCursor mongoCursor, ClientSession clientSession, AnnotableConverter<? extends Annotable> converter,
Function<Document, Document> filter, SampleMongoDBAdaptor sampleMongoDBAdaptor, long studyUid, String user,
QueryOptions options) {
super(mongoCursor, clientSession, converter, filter, options);
=======
public CohortMongoDBIterator(MongoCursor mongoCursor, AnnotableConverter<? extends Annotable> converter,
Function<Document, Document> filter, SampleDBAdaptor sampleMongoDBAdaptor, QueryOptions options) {
this(mongoCursor, converter, filter, sampleMongoDBAdaptor, 0, null, options);
}
public CohortMongoDBIterator(MongoCursor mongoCursor, AnnotableConverter<? extends Annotable> converter,
Function<Document, Document> filter, SampleDBAdaptor sampleMongoDBAdaptor,
long studyUid, String user, QueryOptions options) {
super(mongoCursor, converter, filter, options);
>>>>>>>
public CohortMongoDBIterator(MongoCursor mongoCursor, ClientSession clientSession, AnnotableConverter<? extends Annotable> converter,
Function<Document, Document> filter, SampleMongoDBAdaptor sampleMongoDBAdaptor, QueryOptions options) {
this(mongoCursor, clientSession, converter, filter, sampleMongoDBAdaptor, 0, null, options);
}
public CohortMongoDBIterator(MongoCursor mongoCursor, ClientSession clientSession, AnnotableConverter<? extends Annotable> converter,
Function<Document, Document> filter, SampleMongoDBAdaptor sampleMongoDBAdaptor, long studyUid, String user,
QueryOptions options) {
super(mongoCursor, clientSession, converter, filter, options);
<<<<<<<
sampleList = sampleDBAdaptor.nativeGet(clientSession, query, sampleQueryOptions, user).getResults();
=======
sampleList = sampleDBAdaptor.nativeGet(studyUid, query, sampleQueryOptions, user).getResult();
>>>>>>>
sampleList = sampleDBAdaptor.nativeGet(clientSession, studyUid, query, sampleQueryOptions, user).getResults(); |
<<<<<<<
index = analysisFileIndexer.index(fileId, outDirId, backend, sessionId, this.getQueryOptions());
} catch (CatalogManagerException | CatalogIOManagerException | IOException e) {
=======
index = analysisFileIndexer.index(fileId, outDirId, storageEngine, sessionId, queryOptions);
} catch (CatalogManagerException | CatalogIOManagerException | AnalysisExecutionException | IOException e) {
>>>>>>>
index = analysisFileIndexer.index(fileId, outDirId, storageEngine, sessionId, this.getQueryOptions());
} catch (CatalogManagerException | CatalogIOManagerException | AnalysisExecutionException | IOException e) {
<<<<<<<
@ApiParam(value = "region", allowMultiple=true, required = true) @DefaultValue("") @QueryParam("region") String region,
@ApiParam(value = "backend", required = false) @DefaultValue("") @QueryParam("backend") String backend,
=======
@ApiParam(value = "region", required = true) @DefaultValue("") @QueryParam("region") String region,
// @ApiParam(value = "backend", required = false) @DefaultValue("") @QueryParam("backend") String backend,
>>>>>>>
@ApiParam(value = "region", allowMultiple=true, required = true) @DefaultValue("") @QueryParam("region") String region, |
<<<<<<<
coverage = meanCoverage(path, workspace, region, windowSize);
queryResultId = "Get coverage";
=======
chunkFrequency = chunkFrequencyManager.query(region, path, windowSize);
}
if (coverage == null) {
coverage = new RegionCoverage(region, chunkFrequency.getWindowSize(), chunkFrequency.getValues());
>>>>>>>
queryResultId = "Get coverage";
chunkFrequency = chunkFrequencyManager.query(region, path, windowSize);
}
if (coverage == null) {
coverage = new RegionCoverage(region, chunkFrequency.getWindowSize(), chunkFrequency.getValues()); |
<<<<<<<
import org.opencb.biodata.tools.alignment.stats.AlignmentGlobalStats;
import org.opencb.biodata.tools.commons.ChunkFrequencyManager;
=======
>>>>>>>
<<<<<<<
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
=======
>>>>>>>
<<<<<<<
// 2. Calculate stats and store in a file
Path statsPath = workspace.resolve(path.getFileName() + ".stats");
if (!statsPath.toFile().exists()) {
AlignmentGlobalStats stats = alignmentManager.stats();
ObjectMapper objectMapper = new ObjectMapper();
ObjectWriter objectWriter = objectMapper.typedWriter(AlignmentGlobalStats.class);
objectWriter.writeValue(statsPath.toFile(), stats);
}
// 3. Calculate coverage and store in SQLite
SAMFileHeader fileHeader = AlignmentUtils.getFileHeader(path);
// long start = System.currentTimeMillis();
Path coverageDBPath = workspace.toAbsolutePath().resolve(COVERAGE_DATABASE_NAME);
ChunkFrequencyManager chunkFrequencyManager = new ChunkFrequencyManager(coverageDBPath);
List<String> chromosomeNames = new ArrayList<>();
List<Integer> chromosomeLengths = new ArrayList<>();
fileHeader.getSequenceDictionary().getSequences().forEach(
seq -> {
chromosomeNames.add(seq.getSequenceName());
chromosomeLengths.add(seq.getSequenceLength());
});
chunkFrequencyManager.init(chromosomeNames, chromosomeLengths);
// System.out.println("SQLite database initialization, in " + ((System.currentTimeMillis() - start) / 1000.0f)
// + " s.");
Path coveragePath = workspace.toAbsolutePath().resolve(path.getFileName() + COVERAGE_SUFFIX);
AlignmentOptions options = new AlignmentOptions();
options.setContained(false);
Iterator<SAMSequenceRecord> iterator = fileHeader.getSequenceDictionary().getSequences().iterator();
PrintWriter writer = new PrintWriter(coveragePath.toFile());
StringBuilder line;
// start = System.currentTimeMillis();
while (iterator.hasNext()) {
SAMSequenceRecord next = iterator.next();
for (int i = 0; i < next.getSequenceLength(); i += MINOR_CHUNK_SIZE) {
Region region = new Region(next.getSequenceName(), i + 1,
Math.min(i + MINOR_CHUNK_SIZE, next.getSequenceLength()));
RegionCoverage regionCoverage = alignmentManager.coverage(region, options, null);
int meanDepth = Math.min(regionCoverage.meanCoverage(), 255);
// File columns: chunk chromosome start end coverage
// chunk format: chrom_id_suffix, where:
// id: int value starting at 0
// suffix: chunkSize + k
// eg. 3_4_1k
line = new StringBuilder();
line.append(region.getChromosome()).append("_");
line.append(i / MINOR_CHUNK_SIZE).append("_").append(MINOR_CHUNK_SIZE / 1000).append("k");
line.append("\t").append(region.getChromosome());
line.append("\t").append(region.getStart());
line.append("\t").append(region.getEnd());
line.append("\t").append(meanDepth);
writer.println(line.toString());
}
}
writer.close();
// System.out.println("Mean coverage file creation, in " + ((System.currentTimeMillis() - start) / 1000.0f) + " s.");
// save file to db
// start = System.currentTimeMillis();
chunkFrequencyManager.load(coveragePath, path);
// System.out.println("SQLite database population, in " + ((System.currentTimeMillis() - start) / 1000.0f) + " s.");
=======
>>>>>>>
<<<<<<<
=======
>>>>>>> |
<<<<<<<
public OpenCGAResult<Long> count(final Query query, final String user, final StudyAclEntry.StudyPermissions studyPermissions)
throws CatalogDBException, CatalogAuthorizationException {
return count(null, query, user, studyPermissions);
}
private OpenCGAResult<Long> count(ClientSession clientSession, final Query query, final String user,
final StudyAclEntry.StudyPermissions studyPermissions)
=======
public QueryResult<Long> count(long studyUid, final Query query, final String user,
final StudyAclEntry.StudyPermissions studyPermissions)
>>>>>>>
public OpenCGAResult<Long> count(long studyUid, final Query query, final String user,
final StudyAclEntry.StudyPermissions studyPermissions)
throws CatalogDBException, CatalogAuthorizationException {
return count(null, studyUid, query, user, studyPermissions);
}
private OpenCGAResult<Long> count(ClientSession clientSession, long studyUid, final Query query, final String user,
final StudyAclEntry.StudyPermissions studyPermissions)
<<<<<<<
public OpenCGAResult<Cohort> get(Query query, QueryOptions options, String user)
throws CatalogDBException, CatalogAuthorizationException {
return get(null, query, options, user);
}
OpenCGAResult<Cohort> get(ClientSession clientSession, Query query, QueryOptions options, String user)
=======
public QueryResult<Cohort> get(long studyUid, Query query, QueryOptions options, String user)
>>>>>>>
public OpenCGAResult<Cohort> get(long studyUid, Query query, QueryOptions options, String user)
throws CatalogDBException, CatalogAuthorizationException {
return get(null, studyUid, query, options, user);
}
OpenCGAResult<Cohort> get(ClientSession clientSession, long studyUid, Query query, QueryOptions options, String user)
<<<<<<<
return iterator(null, query, options);
}
DBIterator<Cohort> iterator(ClientSession clientSession, Query query, QueryOptions options) throws CatalogDBException {
MongoCursor<Document> mongoCursor = getMongoCursor(clientSession, query, options);
return new CohortMongoDBIterator(mongoCursor, clientSession, cohortConverter, null, dbAdaptorFactory.getCatalogSampleDBAdaptor(),
query.getLong(PRIVATE_STUDY_UID), null, options);
=======
MongoCursor<Document> mongoCursor = getMongoCursor(query, options);
return new CohortMongoDBIterator(mongoCursor, cohortConverter, null, dbAdaptorFactory.getCatalogSampleDBAdaptor(), options);
>>>>>>>
return iterator(null, query, options);
}
DBIterator<Cohort> iterator(ClientSession clientSession, Query query, QueryOptions options) throws CatalogDBException {
MongoCursor<Document> mongoCursor = getMongoCursor(clientSession, query, options);
return new CohortMongoDBIterator(mongoCursor, clientSession, cohortConverter, null, dbAdaptorFactory.getCatalogSampleDBAdaptor(),
options);
<<<<<<<
MongoCursor<Document> mongoCursor = getMongoCursor(null, query, queryOptions);
return new CohortMongoDBIterator(mongoCursor, null, null, null, dbAdaptorFactory.getCatalogSampleDBAdaptor(),
query.getLong(PRIVATE_STUDY_UID), null, options);
=======
MongoCursor<Document> mongoCursor = getMongoCursor(query, queryOptions);
return new CohortMongoDBIterator(mongoCursor, null, null, dbAdaptorFactory.getCatalogSampleDBAdaptor(), options);
>>>>>>>
MongoCursor<Document> mongoCursor = getMongoCursor(null, query, queryOptions);
return new CohortMongoDBIterator(mongoCursor, null, null, null, dbAdaptorFactory.getCatalogSampleDBAdaptor(), options);
<<<<<<<
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), query.getLong(QueryParams.STUDY_UID.key()));
DataResult<Document> queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(studyQuery, QueryOptions.empty());
=======
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), studyUid);
QueryResult<Document> queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(studyQuery, QueryOptions.empty());
>>>>>>>
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), studyUid);
DataResult<Document> queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(studyQuery, QueryOptions.empty());
<<<<<<<
public OpenCGAResult groupBy(Query query, String field, QueryOptions options, String user)
=======
public QueryResult groupBy(long studyUid, Query query, String field, QueryOptions options, String user)
>>>>>>>
public OpenCGAResult groupBy(long studyUid, Query query, String field, QueryOptions options, String user)
<<<<<<<
public OpenCGAResult groupBy(Query query, List<String> fields, QueryOptions options, String user)
=======
public QueryResult groupBy(long studyUid, Query query, List<String> fields, QueryOptions options, String user)
>>>>>>>
public OpenCGAResult groupBy(long studyUid, Query query, List<String> fields, QueryOptions options, String user) |
<<<<<<<
public class VariantFetcher implements AutoCloseable {
=======
@Deprecated
public class VariantFetcher {
>>>>>>>
@Deprecated
public class VariantFetcher implements AutoCloseable {
<<<<<<<
throws CatalogException, StorageManagerException, IOException {
VariantDBAdaptor variantDBAdaptor = getVariantDBAdaptor(studyId, sessionId);
return checkSamplesPermissions(query, queryOptions, variantDBAdaptor, sessionId);
=======
throws CatalogException, StorageEngineException, IOException {
try (VariantDBAdaptor variantDBAdaptor = getVariantDBAdaptor(studyId, sessionId)) {
return checkSamplesPermissions(query, queryOptions, variantDBAdaptor, sessionId);
}
>>>>>>>
throws CatalogException, StorageEngineException, IOException {
VariantDBAdaptor variantDBAdaptor = getVariantDBAdaptor(studyId, sessionId);
return checkSamplesPermissions(query, queryOptions, variantDBAdaptor, sessionId);
<<<<<<<
throws CatalogException, StorageManagerException, IOException {
VariantDBAdaptor variantDBAdaptor = getVariantDBAdaptor(studyId, sessionId); // DB con closed by VariantFetcher
return variantDBAdaptor.getStudyConfigurationManager().getStudyConfiguration((int) studyId, options).first();
=======
throws CatalogException, StorageEngineException, IOException {
try (VariantDBAdaptor variantDBAdaptor = getVariantDBAdaptor(studyId, sessionId)) {
return variantDBAdaptor.getStudyConfigurationManager().getStudyConfiguration((int) studyId, options).first();
}
>>>>>>>
throws CatalogException, StorageEngineException, IOException {
VariantDBAdaptor variantDBAdaptor = getVariantDBAdaptor(studyId, sessionId); // DB con closed by VariantFetcher
return variantDBAdaptor.getStudyConfigurationManager().getStudyConfiguration((int) studyId, options).first(); |
<<<<<<<
import org.opencb.opencga.core.models.common.Enums;
import org.opencb.opencga.core.response.OpenCGAResult;
=======
import org.opencb.opencga.core.models.job.JobInternal;
>>>>>>>
import org.opencb.opencga.core.models.job.JobInternal;
import org.opencb.opencga.core.response.OpenCGAResult; |
<<<<<<<
=======
public String getCatalogDatabase() {
String database;
if (StringUtils.isNotEmpty(catalogConfiguration.getDatabasePrefix())) {
if (!catalogConfiguration.getDatabasePrefix().endsWith("_")) {
database = catalogConfiguration.getDatabasePrefix() + "_catalog";
} else {
database = catalogConfiguration.getDatabasePrefix() + "catalog";
}
} else {
database = "opencga_catalog";
}
return database;
}
public void validateAdminPassword() throws CatalogException {
try {
authenticationManager.authenticate("admin", catalogConfiguration.getAdmin().getPassword(), true);
} catch (CatalogException e) {
throw new CatalogException("The admin password is incorrect");
}
}
>>>>>>>
public String getCatalogDatabase() {
String database;
if (StringUtils.isNotEmpty(catalogConfiguration.getDatabasePrefix())) {
if (!catalogConfiguration.getDatabasePrefix().endsWith("_")) {
database = catalogConfiguration.getDatabasePrefix() + "_catalog";
} else {
database = catalogConfiguration.getDatabasePrefix() + "catalog";
}
} else {
database = "opencga_catalog";
}
return database;
} |
<<<<<<<
if (file.getIndex() != null && file.getIndex().getStatus() != null && file.getIndex().getStatus().getName() != null
&& file.getIndex().getStatus().getName().equals(FileIndex.IndexStatus.READY)) {
// assertTrue(studyConfiguration.getIndexedFiles().contains(id));
// assertTrue("Missing header for file " + file.getId(), studyConfiguration.getHeaders().containsKey(id));
// assertTrue("Missing header for file " + file.getId(), !studyConfiguration.getHeaders().get(id).isEmpty());
} else {
=======
if (file.getIndex() == null || !file.getIndex().getStatus().getName().equals(FileIndex.IndexStatus.READY)) {
>>>>>>>
if (file.getIndex() == null || file.getIndex().getStatus() == null || file.getIndex().getStatus().getName() == null
|| !file.getIndex().getStatus().getName().equals(FileIndex.IndexStatus.READY)) { |
<<<<<<<
public void searchIndexSamples(String study, List<String> samples, String sessionId)
throws StorageEngineException, IOException, SolrException,
=======
public void searchIndexSamples(String study, List<String> samples, QueryOptions queryOptions, String sessionId)
throws StorageEngineException, IOException, VariantSearchException,
>>>>>>>
public void searchIndexSamples(String study, List<String> samples, QueryOptions queryOptions, String sessionId)
throws StorageEngineException, IOException, SolrException,
<<<<<<<
public void searchIndex(String study, String sessionId) throws StorageEngineException, IOException, SolrException,
=======
public void removeSearchIndexSamples(String study, List<String> samples, QueryOptions queryOptions, String sessionId)
throws CatalogException, IllegalAccessException, InstantiationException, ClassNotFoundException,
StorageEngineException, VariantSearchException {
DataStore dataStore = getDataStore(study, sessionId);
VariantStorageEngine variantStorageEngine =
storageEngineFactory.getVariantStorageEngine(dataStore.getStorageEngine(), dataStore.getDbName());
variantStorageEngine.getOptions().putAll(queryOptions);
variantStorageEngine.removeSearchIndexSamples(study, samples);
}
public void searchIndex(String study, String sessionId) throws StorageEngineException, IOException, VariantSearchException,
>>>>>>>
public void removeSearchIndexSamples(String study, List<String> samples, QueryOptions queryOptions, String sessionId)
throws CatalogException, IllegalAccessException, InstantiationException, ClassNotFoundException,
StorageEngineException, SolrException {
DataStore dataStore = getDataStore(study, sessionId);
VariantStorageEngine variantStorageEngine =
storageEngineFactory.getVariantStorageEngine(dataStore.getStorageEngine(), dataStore.getDbName());
variantStorageEngine.getOptions().putAll(queryOptions);
variantStorageEngine.removeSearchIndexSamples(study, samples);
}
public void searchIndex(String study, String sessionId) throws StorageEngineException, IOException, SolrException,
<<<<<<<
public void searchIndex(Query query, QueryOptions queryOptions, String sessionId) throws StorageEngineException,
IOException, SolrException, IllegalAccessException, InstantiationException, ClassNotFoundException, CatalogException {
=======
public void searchIndex(Query query, QueryOptions queryOptions, boolean overwrite, String sessionId) throws StorageEngineException,
IOException, VariantSearchException, IllegalAccessException, InstantiationException, ClassNotFoundException, CatalogException {
>>>>>>>
public void searchIndex(Query query, QueryOptions queryOptions, boolean overwrite, String sessionId) throws StorageEngineException,
IOException, SolrException, IllegalAccessException, InstantiationException, ClassNotFoundException, CatalogException { |
<<<<<<<
=======
import org.opencb.commons.datastore.core.QueryResponse;
>>>>>>>
<<<<<<<
public DataResponse<AnnotationSet> createAnnotationSet(String id, String variableSetId, String annotationSetName,
=======
@Deprecated
public QueryResponse<AnnotationSet> createAnnotationSet(String studyId, String id, String variableSetId, String annotationSetId,
>>>>>>>
@Deprecated
public DataResponse<AnnotationSet> createAnnotationSet(String studyId, String id, String variableSetId, String annotationSetId,
<<<<<<<
public DataResponse<AnnotationSet> updateAnnotationSet(String id, String annotationSetName, ObjectMap annotations) throws IOException {
=======
public QueryResponse<AnnotationSet> updateAnnotationSet(String studyId, String id, String annotationSetId, ObjectMap queryParams,
ObjectMap annotations) throws IOException {
>>>>>>>
public DataResponse<AnnotationSet> updateAnnotationSet(String studyId, String id, String annotationSetId, ObjectMap queryParams,
ObjectMap annotations) throws IOException { |
<<<<<<<
import org.opencb.opencga.catalog.db.api.CatalogIndividualDBAdaptor;
=======
>>>>>>>
import org.opencb.opencga.catalog.db.api.CatalogIndividualDBAdaptor;
<<<<<<<
return individualDBAdaptor.createIndividual(studyId, new Individual(0, name, fatherId, motherId, family, gender, null, null, null, Collections.emptyList(), null), options);
=======
QueryResult<Individual> queryResult = individualDBAdaptor.createIndividual(studyId, new Individual(0, name, fatherId, motherId, family, gender, null, null, null, null), options);
auditManager.recordCreation(AuditRecord.Resource.individual, queryResult.first().getId(), userId, queryResult.first(), null, null);
return queryResult;
>>>>>>>
QueryResult<Individual> queryResult = individualDBAdaptor.createIndividual(studyId, new Individual(0, name, fatherId, motherId, family, gender, null, null, null, Collections.emptyList(), null), options);
auditManager.recordCreation(AuditRecord.Resource.individual, queryResult.first().getId(), userId, queryResult.first(), null, null);
return queryResult; |
<<<<<<<
=======
import org.opencb.opencga.catalog.exceptions.CatalogException;
import org.opencb.opencga.catalog.models.update.FileUpdateParams;
>>>>>>>
import org.opencb.opencga.catalog.exceptions.CatalogException;
import org.opencb.opencga.catalog.models.update.FileUpdateParams;
<<<<<<<
=======
addFile(new File(outputFile).toPath(), FileResult.FileType.PLAIN_TEXT);
if (params.containsKey(INDEX_STATS_PARAM) && params.getBoolean(INDEX_STATS_PARAM)) {
indexStats();
}
>>>>>>>
if (params.containsKey(INDEX_STATS_PARAM) && params.getBoolean(INDEX_STATS_PARAM)) {
indexStats();
} |
<<<<<<<
sampleObject.put(PRIVATE_CREATION_DATE, TimeUtils.toDate(sample.getCreationDate()));
=======
sampleObject.put(PERMISSION_RULES_APPLIED, Collections.emptyList());
>>>>>>>
sampleObject.put(PRIVATE_CREATION_DATE, TimeUtils.toDate(sample.getCreationDate()));
sampleObject.put(PERMISSION_RULES_APPLIED, Collections.emptyList()); |
<<<<<<<
ObjectMapper mapper = jsonMapperBuilder()
.enableDefaultTyping(NoCheckSubTypeValidator.instance,
DefaultTyping.NON_FINAL)
=======
ObjectMapper mapper = JsonMapper.builder()
.activateDefaultTyping(NoCheckSubTypeValidator.instance,
ObjectMapper.DefaultTyping.NON_FINAL)
>>>>>>>
ObjectMapper mapper = jsonMapperBuilder()
.activateDefaultTyping(NoCheckSubTypeValidator.instance,
DefaultTyping.NON_FINAL)
<<<<<<<
ObjectMapper mapper = jsonMapperBuilder()
.enableDefaultTyping(NoCheckSubTypeValidator.instance)
=======
ObjectMapper mapper = JsonMapper.builder()
.activateDefaultTyping(NoCheckSubTypeValidator.instance)
>>>>>>>
ObjectMapper mapper = jsonMapperBuilder()
.activateDefaultTyping(NoCheckSubTypeValidator.instance) |
<<<<<<<
private void printVcf(VariantQueryResult<Variant> variantQueryResult, Iterator<VariantProto.Variant> variantIterator, String study, List<String> samples, List<String> annotations, PrintStream outputStream) {
// logger.debug("Samples from variantQueryResult: {}", variantQueryResult.getSamples());
// Map<String, List<String>> samplePerStudy = new HashMap<>();
// // Aggregated studies do not contain samples
// if (variantQueryResult.getSamples() != null) {
// // We have to remove the user and project from the Study name
// variantQueryResult.getSamples().forEach((st, sampleList) -> {
// String study1 = st.split(":")[1];
// samplePerStudy.put(study1, sampleList);
// });
// }
//
// // Prepare samples for the VCF header
// List<String> samples = null;
// if (StringUtils.isEmpty(study)) {
// if (samplePerStudy.size() == 1) {
// study = samplePerStudy.keySet().iterator().next();
// samples = samplePerStudy.get(study);
// }
// } else {
// if (study.contains(":")) {
// study = study.split(":")[1];
// } else {
// if (clientConfiguration.getAlias().get(study) != null) {
// study = clientConfiguration.getAlias().get(study);
// if (study.contains(":")) {
// study = study.split(":")[1];
// }
// }
// }
// samples = samplePerStudy.get(study);
// }
//
// // TODO move this to biodata
// if (samples == null) {
// samples = new ArrayList<>();
// }
=======
private void printVcf(VariantQueryResult<Variant> variantQueryResult, String study, List<String> annotations, PrintStream outputStream) {
logger.debug("Samples from variantQueryResult: {}", variantQueryResult.getSamples());
Map<String, List<String>> samplePerStudy = new HashMap<>();
// Aggregated studies do not contain samples
if (variantQueryResult.getSamples() != null) {
// We have to remove the user and project from the Study name
variantQueryResult.getSamples().forEach((st, sampleList) -> {
String study1 = st.split(":")[1];
samplePerStudy.put(study1, sampleList);
});
}
// Prepare samples for the VCF header
List<String> samples = null;
if (StringUtils.isEmpty(study)) {
if (samplePerStudy.size() == 1) {
study = samplePerStudy.keySet().iterator().next();
samples = samplePerStudy.get(study);
}
} else {
if (study.contains(":")) {
study = study.split(":")[1];
} else {
if (clientConfiguration.getAlias() != null && clientConfiguration.getAlias().get(study) != null) {
study = clientConfiguration.getAlias().get(study);
if (study.contains(":")) {
study = study.split(":")[1];
}
}
}
samples = samplePerStudy.get(study);
}
// TODO move this to biodata
if (samples == null) {
samples = new ArrayList<>();
}
>>>>>>>
private void printVcf(VariantQueryResult<Variant> variantQueryResult, Iterator<VariantProto.Variant> variantIterator, String study, List<String> samples, List<String> annotations, PrintStream outputStream) {
// logger.debug("Samples from variantQueryResult: {}", variantQueryResult.getSamples());
//
// Map<String, List<String>> samplePerStudy = new HashMap<>();
// // Aggregated studies do not contain samples
// if (variantQueryResult.getSamples() != null) {
// // We have to remove the user and project from the Study name
// variantQueryResult.getSamples().forEach((st, sampleList) -> {
// String study1 = st.split(":")[1];
// samplePerStudy.put(study1, sampleList);
// });
// }
//
// // Prepare samples for the VCF header
// List<String> samples = null;
// if (StringUtils.isEmpty(study)) {
// if (samplePerStudy.size() == 1) {
// study = samplePerStudy.keySet().iterator().next();
// samples = samplePerStudy.get(study);
// }
// } else {
// if (study.contains(":")) {
// study = study.split(":")[1];
// } else {
// if (clientConfiguration.getAlias() != null && clientConfiguration.getAlias().get(study) != null) {
// study = clientConfiguration.getAlias().get(study);
// if (study.contains(":")) {
// study = study.split(":")[1];
// }
// }
// }
// samples = samplePerStudy.get(study);
// }
//
// // TODO move this to biodata
// if (samples == null) {
// samples = new ArrayList<>();
// }
<<<<<<<
if (variantQueryResult != null) {
VariantContextToAvroVariantConverter variantContextToAvroVariantConverter = new VariantContextToAvroVariantConverter(study, samples, annotations);
for (Variant variant : variantQueryResult.getResult()) {
VariantContext variantContext = variantContextToAvroVariantConverter.from(variant);
variantContextWriter.add(variantContext);
}
} else {
VariantContextToProtoVariantConverter variantContextToProtoVariantConverter = new VariantContextToProtoVariantConverter(study, samples, annotations);
// try (PrintStream printStream = new PrintStream(System.out)) {
while (variantIterator.hasNext()) {
VariantProto.Variant next = variantIterator.next();
// printStream.println(variantContextToProtoVariantConverter.from(next));
variantContextWriter.add(variantContextToProtoVariantConverter.from(next));
}
// }
=======
for (Variant variant : variantQueryResult.getResult()) {
// FIXME: This should not be needed! VariantContextToAvroVariantConverter must be fixed
if (variant.getStudies().isEmpty()) {
StudyEntry studyEntry = new StudyEntry(study);
studyEntry.getFiles().add(new FileEntry("", null, Collections.emptyMap()));
variant.addStudyEntry(studyEntry);
}
VariantContext variantContext = variantContextToAvroVariantConverter.from(variant);
variantContextWriter.add(variantContext);
>>>>>>>
if (variantQueryResult != null) {
VariantContextToAvroVariantConverter variantContextToAvroVariantConverter = new VariantContextToAvroVariantConverter(study, samples, annotations);
for (Variant variant : variantQueryResult.getResult()) {
// FIXME: This should not be needed! VariantContextToAvroVariantConverter must be fixed
if (variant.getStudies().isEmpty()) {
StudyEntry studyEntry = new StudyEntry(study);
studyEntry.getFiles().add(new FileEntry("", null, Collections.emptyMap()));
variant.addStudyEntry(studyEntry);
}
VariantContext variantContext = variantContextToAvroVariantConverter.from(variant);
variantContextWriter.add(variantContext);
}
} else {
VariantContextToProtoVariantConverter variantContextToProtoVariantConverter = new VariantContextToProtoVariantConverter(study, samples, annotations);
while (variantIterator.hasNext()) {
VariantProto.Variant next = variantIterator.next();
variantContextWriter.add(variantContextToProtoVariantConverter.from(next));
} |
<<<<<<<
return authorizationManager.setAcls(resource.getStudy().getUid(), resource.getResourceList().stream().map(File::getUid)
.collect(Collectors.toList()), members, permissions, Entity.FILE);
=======
// Todo: Remove this in 1.4
List<String> allFilePermissions = EnumSet.allOf(FileAclEntry.FilePermissions.class)
.stream()
.map(String::valueOf)
.collect(Collectors.toList());
return authorizationManager.setAcls(resourceIds.getStudyId(), resourceIds.getResourceIds(), members, permissions,
allFilePermissions, Entity.FILE);
>>>>>>>
// Todo: Remove this in 1.4
List<String> allFilePermissions = EnumSet.allOf(FileAclEntry.FilePermissions.class)
.stream()
.map(String::valueOf)
.collect(Collectors.toList());
return authorizationManager.setAcls(resource.getStudy().getUid(), resource.getResourceList().stream().map(File::getUid)
.collect(Collectors.toList()), members, permissions, allFilePermissions, Entity.FILE); |
<<<<<<<
public OpenCGAResult<Long> count(final Query query, final String user, final StudyAclEntry.StudyPermissions studyPermissions)
=======
public QueryResult<Long> count(long studyUid, final Query query, final String user,
final StudyAclEntry.StudyPermissions studyPermissions)
>>>>>>>
public OpenCGAResult<Long> count(long studyUid, final Query query, final String user,
final StudyAclEntry.StudyPermissions studyPermissions)
<<<<<<<
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), query.getLong(QueryParams.STUDY_UID.key()));
OpenCGAResult queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(clientSession, studyQuery, QueryOptions.empty());
=======
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), studyUid);
QueryResult queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(studyQuery, QueryOptions.empty());
>>>>>>>
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), studyUid);
OpenCGAResult queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(clientSession, studyQuery, QueryOptions.empty());
<<<<<<<
public OpenCGAResult<Family> get(Query query, QueryOptions options, String user)
throws CatalogDBException, CatalogAuthorizationException {
return get(null, query, options, user);
}
public OpenCGAResult<Family> get(ClientSession clientSession, Query query, QueryOptions options, String user)
=======
public QueryResult<Family> get(long studyUid, Query query, QueryOptions options, String user)
>>>>>>>
public OpenCGAResult<Family> get(long studyUid, Query query, QueryOptions options, String user)
throws CatalogDBException, CatalogAuthorizationException {
return get(null, studyUid, query, options, user);
}
public OpenCGAResult<Family> get(ClientSession clientSession, long studyUid, Query query, QueryOptions options, String user)
<<<<<<<
OpenCGAResult<Family> queryResult;
try (DBIterator<Family> dbIterator = iterator(clientSession, query, options, user)) {
=======
QueryResult<Family> queryResult;
try (DBIterator<Family> dbIterator = iterator(studyUid, query, options, user)) {
>>>>>>>
OpenCGAResult<Family> queryResult;
try (DBIterator<Family> dbIterator = iterator(clientSession, studyUid, query, options, user)) {
<<<<<<<
return iterator(null, query, options);
}
DBIterator<Family> iterator(ClientSession clientSession, Query query, QueryOptions options) throws CatalogDBException {
MongoCursor<Document> mongoCursor = getMongoCursor(clientSession, query, options);
return new FamilyMongoDBIterator<>(mongoCursor, clientSession, familyConverter, null,
dbAdaptorFactory.getCatalogIndividualDBAdaptor(), query.getLong(PRIVATE_STUDY_UID), null, options);
=======
MongoCursor<Document> mongoCursor = getMongoCursor(query, options);
return new FamilyMongoDBIterator<>(mongoCursor, familyConverter, null, dbAdaptorFactory.getCatalogIndividualDBAdaptor(), options);
>>>>>>>
return iterator(null, query, options);
}
DBIterator<Family> iterator(ClientSession clientSession, Query query, QueryOptions options) throws CatalogDBException {
MongoCursor<Document> mongoCursor = getMongoCursor(clientSession, query, options);
return new FamilyMongoDBIterator<>(mongoCursor, clientSession, familyConverter, null,
dbAdaptorFactory.getCatalogIndividualDBAdaptor(), options);
<<<<<<<
MongoCursor<Document> mongoCursor = getMongoCursor(clientSession, query, queryOptions);
return new FamilyMongoDBIterator(mongoCursor, clientSession, null, null, dbAdaptorFactory.getCatalogIndividualDBAdaptor(),
query.getLong(PRIVATE_STUDY_UID), null, options);
=======
MongoCursor<Document> mongoCursor = getMongoCursor(query, queryOptions);
return new FamilyMongoDBIterator(mongoCursor, null, null, dbAdaptorFactory.getCatalogIndividualDBAdaptor(), options);
>>>>>>>
MongoCursor<Document> mongoCursor = getMongoCursor(clientSession, query, queryOptions);
return new FamilyMongoDBIterator(mongoCursor, clientSession, null, null, dbAdaptorFactory.getCatalogIndividualDBAdaptor(), options);
<<<<<<<
return new FamilyMongoDBIterator<>(mongoCursor, null, familyConverter, iteratorFilter,
dbAdaptorFactory.getCatalogIndividualDBAdaptor(), query.getLong(PRIVATE_STUDY_UID), user, options);
=======
return new FamilyMongoDBIterator<>(mongoCursor, familyConverter, iteratorFilter, dbAdaptorFactory.getCatalogIndividualDBAdaptor(),
studyUid, user, options);
>>>>>>>
return new FamilyMongoDBIterator<>(mongoCursor, null, familyConverter, iteratorFilter,
dbAdaptorFactory.getCatalogIndividualDBAdaptor(), studyUid, user, options);
<<<<<<<
return new FamilyMongoDBIterator(mongoCursor, clientSession, null, iteratorFilter, dbAdaptorFactory.getCatalogIndividualDBAdaptor(),
query.getLong(PRIVATE_STUDY_UID), user, options);
=======
return new FamilyMongoDBIterator(mongoCursor, null, iteratorFilter, dbAdaptorFactory.getCatalogIndividualDBAdaptor(), studyUid,
user, options);
>>>>>>>
return new FamilyMongoDBIterator(mongoCursor, clientSession, null, iteratorFilter, dbAdaptorFactory.getCatalogIndividualDBAdaptor(),
studyUid, user, options); |
<<<<<<<
import org.opencb.biodata.models.variant.avro.PopulationFrequency;
import org.opencb.datastore.core.*;
=======
import org.opencb.biodata.models.variation.PopulationFrequency;
import org.opencb.datastore.core.ObjectMap;
import org.opencb.datastore.core.Query;
import org.opencb.datastore.core.QueryOptions;
import org.opencb.datastore.core.QueryResult;
>>>>>>>
import org.opencb.biodata.models.variant.avro.PopulationFrequency;
import org.opencb.datastore.core.ObjectMap;
import org.opencb.datastore.core.Query;
import org.opencb.datastore.core.QueryOptions;
import org.opencb.datastore.core.QueryResult; |
<<<<<<<
ParamUtils.checkParameter(groupId, "group name");
=======
List<String> userList = StringUtils.isNotEmpty(users) ? Arrays.asList(users.split(",")) : Collections.emptyList();
return createGroup(studyStr, new Group(groupId, userList), sessionId);
}
public QueryResult<Group> createGroup(String studyStr, Group group, String sessionId) throws CatalogException {
ParamUtils.checkObj(group, "group");
ParamUtils.checkParameter(group.getId(), "Group id");
if (group.getSyncedFrom() != null) {
ParamUtils.checkParameter(group.getSyncedFrom().getAuthOrigin(), "Authentication origin");
ParamUtils.checkParameter(group.getSyncedFrom().getRemoteGroup(), "Remote group id");
}
>>>>>>>
ParamUtils.checkParameter(groupId, "group name");
List<String> userList = StringUtils.isNotEmpty(users) ? Arrays.asList(users.split(",")) : Collections.emptyList();
return createGroup(studyStr, new Group(groupId, userList), sessionId);
}
public QueryResult<Group> createGroup(String studyStr, Group group, String sessionId) throws CatalogException {
ParamUtils.checkObj(group, "group");
ParamUtils.checkParameter(group.getId(), "Group id");
if (group.getSyncedFrom() != null) {
ParamUtils.checkParameter(group.getSyncedFrom().getAuthOrigin(), "Authentication origin");
ParamUtils.checkParameter(group.getSyncedFrom().getRemoteGroup(), "Remote group id");
}
<<<<<<<
if (existsGroup(study.getUid(), groupId)) {
throw new CatalogException("The group " + groupId + " already exists.");
=======
if (existsGroup(studyId, group.getId())) {
throw new CatalogException("The group " + group.getId() + " already exists.");
>>>>>>>
if (existsGroup(study.getUid(), group.getId())) {
throw new CatalogException("The group " + group.getId() + " already exists.");
<<<<<<<
studyDBAdaptor.addUsersToGroup(study.getUid(), MEMBERS, userList);
=======
studyDBAdaptor.addUsersToGroup(studyId, MEMBERS, users);
>>>>>>>
studyDBAdaptor.addUsersToGroup(study.getUid(), MEMBERS, users);
<<<<<<<
return studyDBAdaptor.createGroup(study.getUid(), new Group(groupId, userList));
=======
return studyDBAdaptor.createGroup(studyId, group);
>>>>>>>
return studyDBAdaptor.createGroup(study.getUid(), group);
<<<<<<<
.append(StudyDBAdaptor.QueryParams.UID.key(), study.getUid())
.append(StudyDBAdaptor.QueryParams.GROUP_NAME.key(), groupId);
=======
.append(StudyDBAdaptor.QueryParams.ID.key(), studyId)
.append(StudyDBAdaptor.QueryParams.GROUP_ID.key(), groupId);
>>>>>>>
.append(StudyDBAdaptor.QueryParams.UID.key(), study.getUid())
.append(StudyDBAdaptor.QueryParams.GROUP_ID.key(), groupId);
<<<<<<<
.append(StudyDBAdaptor.QueryParams.UID.key(), studyId)
.append(StudyDBAdaptor.QueryParams.GROUP_NAME.key(), groupId);
=======
.append(StudyDBAdaptor.QueryParams.ID.key(), studyId)
.append(StudyDBAdaptor.QueryParams.GROUP_ID.key(), groupId);
>>>>>>>
.append(StudyDBAdaptor.QueryParams.UID.key(), studyId)
.append(StudyDBAdaptor.QueryParams.GROUP_ID.key(), groupId); |
<<<<<<<
TeamInterpretationAnalysis teamAnalysis = new TeamInterpretationAnalysis(clinicalAnalysisId, studyStr, panelList, moi,
teamAnalysisOptions, opencgaHome, sessionId);
=======
TeamAnalysis teamAnalysis = new TeamAnalysis(clinicalAnalysisId, panelList, moi, studyStr, roleInCancer,
actionableVariantsByAssembly.get(assembly), teamAnalysisOptions, opencgaHome.toString(), sessionId);
>>>>>>>
TeamInterpretationAnalysis teamAnalysis = new TeamInterpretationAnalysis(clinicalAnalysisId, studyStr, panelList, moi,
teamAnalysisOptions, opencgaHome.toString(), sessionId);
<<<<<<<
TieringInterpretationAnalysis tieringAnalysis = new TieringInterpretationAnalysis(clinicalAnalysisId, studyId, panelList,
penetrance, tieringAnalysisOptions, opencgaHome, sessionId);
=======
TieringAnalysis tieringAnalysis = new TieringAnalysis(clinicalAnalysisId, panelList, studyStr, roleInCancer,
actionableVariantsByAssembly.get(assembly), penetrance, tieringAnalysisOptions, opencgaHome.toString(), sessionId);
>>>>>>>
TieringInterpretationAnalysis tieringAnalysis = new TieringInterpretationAnalysis(clinicalAnalysisId, studyId, panelList,
penetrance, tieringAnalysisOptions, opencgaHome.toString(), sessionId);
<<<<<<<
String dataDir = configuration.getDataDir();
String opencgaHome = Paths.get(dataDir).getParent().toString();
=======
// Get assembly from study for actionable variants
String assembly = InterpretationAnalysisUtils.getAssembly(catalogManager, studyStr, sessionId);
>>>>>>>
<<<<<<<
CustomInterpretationAnalysis customAnalysis = new CustomInterpretationAnalysis(clinicalAnalysisId, studyId, query,
customAnalysisOptions, opencgaHome, sessionId);
=======
CustomAnalysis customAnalysis = new CustomAnalysis(clinicalAnalysisId, query, studyStr, roleInCancer,
actionableVariantsByAssembly.get(assembly), penetrance, customAnalysisOptions, opencgaHome.toString(), sessionId);
>>>>>>>
CustomInterpretationAnalysis customAnalysis = new CustomInterpretationAnalysis(clinicalAnalysisId, studyId, query,
customAnalysisOptions, opencgaHome.toString(), sessionId);
<<<<<<<
=======
private void loadExternalFiles() throws IOException {
roleInCancer = InterpretationAnalysisUtils.getRoleInCancer(opencgaHome);
actionableVariantsByAssembly = InterpretationAnalysisUtils.getActionableVariantsByAssembly(opencgaHome);
}
>>>>>>> |
<<<<<<<
import org.apache.solr.common.SolrException;
=======
import org.apache.commons.lang3.tuple.Pair;
>>>>>>>
import org.apache.commons.lang3.tuple.Pair;
import org.apache.solr.common.SolrException; |
<<<<<<<
@Test
public void allTests() throws CatalogManagerException, IOException {
createUserTest();
getUserTest();
loginTest();
logoutTest();
changePasswordTest();
createProjectTest();
getProjectTest();
getProjectIdTest();
getAllProjects();
createStudyTest();
getStudyIdTest();
getAllStudiesTest();
getStudyTest();
createAnalysisTest();
getAllAnalysisTest();
getAnalysisTest();
getAnalysisIdTest();
createFileToStudyTest();
}
=======
>>>>>>>
<<<<<<<
System.out.println(catalog.setFileStatus("jcoll", "1000G", "ph1", "/data/file.bam", File.READY, ID_LOGIN_JCOLL));
=======
System.out.println(catalog.setFileStatus("jcoll", "1000G", "ph1", "/data/file.sam", File.READY));
try {
System.out.println(catalog.setFileStatus("jcoll", "1000G", "ph1", "/data/noExists", File.READY));
fail("Expected \"FileId not found\" exception");
} catch (CatalogManagerException e) {
System.out.println(e);
}
>>>>>>>
System.out.println(catalog.setFileStatus("jcoll", "1000G", "ph1", "/data/file.sam", File.READY));
try {
System.out.println(catalog.setFileStatus("jcoll", "1000G", "ph1", "/data/noExists", File.READY));
fail("Expected \"FileId not found\" exception");
} catch (CatalogManagerException e) {
System.out.println(e);
}
<<<<<<<
System.out.println(catalog.deleteFile("jcoll", "1000G", "ph1", "/data/file.bam"));
=======
System.out.println(catalog.deleteFile("jcoll", "1000G", "ph1", "/data/file.sam"));
try {
System.out.println(catalog.deleteFile("jcoll", "1000G", "ph1", "/data/noExists"));
fail("Expected \"FileId not found\" exception");
} catch (CatalogManagerException e) {
System.out.println(e);
}
>>>>>>>
System.out.println(catalog.deleteFile("jcoll", "1000G", "ph1", "/data/file.sam"));
try {
System.out.println(catalog.deleteFile("jcoll", "1000G", "ph1", "/data/noExists"));
fail("Expected \"FileId not found\" exception");
} catch (CatalogManagerException e) {
System.out.println(e);
}
<<<<<<<
public void getAnalysisTest() throws CatalogManagerException, JsonProcessingException {
System.out.println(catalog.getAnalysis(8));
=======
public void getAnalysisTest() throws CatalogManagerException, IOException {
Analysis analysis = new Analysis(0, "analisis1Name", "analysis1Alias", "today", "analaysis 1 description", null, null);
try {
System.out.println(catalog.createAnalysis("jcoll", "1000G", "ph1", analysis));
} catch (CatalogManagerException e) {
e.printStackTrace();
}
>>>>>>>
public void getAnalysisTest() throws CatalogManagerException, JsonProcessingException {
System.out.println(catalog.getAnalysis(8)); |
<<<<<<<
jobStatus.put(jobId, Enums.ExecutionStatus.RUNNING);
Command com = new Command(getCommandLine(commandLine, stdout, stderr, token));
=======
jobStatus.put(jobId, Job.JobStatus.RUNNING);
Command com = new Command(getCommandLine(commandLine, stdout, stderr));
>>>>>>>
jobStatus.put(jobId, Enums.ExecutionStatus.RUNNING);
Command com = new Command(getCommandLine(commandLine, stdout, stderr)); |
<<<<<<<
MAPPER.writeValueAsString(new Empty());
fail("Should fail");
} catch (JsonMappingException e) {
=======
serializeAsString(mapper, new Empty());
} catch (InvalidDefinitionException e) {
>>>>>>>
MAPPER.writeValueAsString(new Empty());
fail("Should fail");
} catch (InvalidDefinitionException e) { |
<<<<<<<
/* We do some defaulting for abstract Map classes and
* interfaces, to avoid having to use exact types or annotations in
* cases where the most common concrete Maps will do.
*/
@SuppressWarnings("rawtypes")
final static HashMap<String, Class<? extends Map>> _mapFallbacks =
new HashMap<String, Class<? extends Map>>();
static {
_mapFallbacks.put(Map.class.getName(), LinkedHashMap.class);
_mapFallbacks.put(ConcurrentMap.class.getName(), ConcurrentHashMap.class);
_mapFallbacks.put(SortedMap.class.getName(), TreeMap.class);
_mapFallbacks.put(java.util.NavigableMap.class.getName(), TreeMap.class);
_mapFallbacks.put(java.util.concurrent.ConcurrentNavigableMap.class.getName(),
java.util.concurrent.ConcurrentSkipListMap.class);
}
/* We do some defaulting for abstract Collection classes and
* interfaces, to avoid having to use exact types or annotations in
* cases where the most common concrete Collection will do.
*/
@SuppressWarnings("rawtypes")
final static HashMap<String, Class<? extends Collection>> _collectionFallbacks =
new HashMap<String, Class<? extends Collection>>();
static {
_collectionFallbacks.put(Collection.class.getName(), ArrayList.class);
_collectionFallbacks.put(List.class.getName(), ArrayList.class);
_collectionFallbacks.put(Set.class.getName(), HashSet.class);
_collectionFallbacks.put(SortedSet.class.getName(), TreeSet.class);
_collectionFallbacks.put(Queue.class.getName(), LinkedList.class);
// then JDK 1.6 types:
// 17-May-2013, tatu: [databind#216] Should be fine to use straight Class references EXCEPT
// that some god-forsaken platforms (... looking at you, Android) do not
// include these. So, use "soft" references...
_collectionFallbacks.put("java.util.Deque", LinkedList.class);
_collectionFallbacks.put("java.util.NavigableSet", TreeSet.class);
}
=======
>>>>>>>
<<<<<<<
=======
/*
/**********************************************************
/* Deprecated helper methods
/**********************************************************
*/
/**
* Method called to see if given method has annotations that indicate
* a more specific type than what the argument specifies.
*
* @deprecated Since 2.8; call {@link #resolveMemberAndTypeAnnotations} instead
*/
@Deprecated
protected JavaType modifyTypeByAnnotation(DeserializationContext ctxt,
Annotated a, JavaType type)
throws JsonMappingException
{
AnnotationIntrospector intr = ctxt.getAnnotationIntrospector();
if (intr == null) {
return type;
}
return intr.refineDeserializationType(ctxt.getConfig(), a, type);
}
/**
* @deprecated since 2.8 call {@link #resolveMemberAndTypeAnnotations} instead.
*/
@Deprecated // since 2.8
protected JavaType resolveType(DeserializationContext ctxt,
BeanDescription beanDesc, JavaType type, AnnotatedMember member)
throws JsonMappingException
{
return resolveMemberAndTypeAnnotations(ctxt, member, type);
}
/**
* @deprecated since 2.8 call <code>findJsonValueMethod</code> on {@link BeanDescription} instead
*/
@Deprecated // not used, possibly remove as early as 2.9
protected AnnotatedMethod _findJsonValueFor(DeserializationConfig config, JavaType enumType)
{
if (enumType == null) {
return null;
}
BeanDescription beanDesc = config.introspect(enumType);
return beanDesc.findJsonValueMethod();
}
/**
* Helper class to contain default mappings for abstract JDK {@link java.util.Collection}
* and {@link java.util.Map} types. Separated out here to defer cost of creating lookups
* until mappings are actually needed.
*
* @since 2.10
*/
@SuppressWarnings("rawtypes")
protected static class ContainerDefaultMappings {
// We do some defaulting for abstract Collection classes and
// interfaces, to avoid having to use exact types or annotations in
// cases where the most common concrete Collection will do.
final static HashMap<String, Class<? extends Collection>> _collectionFallbacks;
static {
HashMap<String, Class<? extends Collection>> fallbacks = new HashMap<>();
final Class<? extends Collection> DEFAULT_LIST = ArrayList.class;
final Class<? extends Collection> DEFAULT_SET = HashSet.class;
fallbacks.put(Collection.class.getName(), DEFAULT_LIST);
fallbacks.put(List.class.getName(), DEFAULT_LIST);
fallbacks.put(Set.class.getName(), DEFAULT_SET);
fallbacks.put(SortedSet.class.getName(), TreeSet.class);
fallbacks.put(Queue.class.getName(), LinkedList.class);
// 09-Feb-2019, tatu: How did we miss these? Related in [databind#2251] problem
fallbacks.put(AbstractList.class.getName(), DEFAULT_LIST);
fallbacks.put(AbstractSet.class.getName(), DEFAULT_SET);
// 09-Feb-2019, tatu: And more esoteric types added in JDK6
fallbacks.put(Deque.class.getName(), LinkedList.class);
fallbacks.put(NavigableSet.class.getName(), TreeSet.class);
_collectionFallbacks = fallbacks;
}
// We do some defaulting for abstract Map classes and
// interfaces, to avoid having to use exact types or annotations in
// cases where the most common concrete Maps will do.
final static HashMap<String, Class<? extends Map>> _mapFallbacks;
static {
HashMap<String, Class<? extends Map>> fallbacks = new HashMap<>();
final Class<? extends Map> DEFAULT_MAP = LinkedHashMap.class;
fallbacks.put(Map.class.getName(), DEFAULT_MAP);
fallbacks.put(AbstractMap.class.getName(), DEFAULT_MAP);
fallbacks.put(ConcurrentMap.class.getName(), ConcurrentHashMap.class);
fallbacks.put(SortedMap.class.getName(), TreeMap.class);
fallbacks.put(java.util.NavigableMap.class.getName(), TreeMap.class);
fallbacks.put(java.util.concurrent.ConcurrentNavigableMap.class.getName(),
java.util.concurrent.ConcurrentSkipListMap.class);
_mapFallbacks = fallbacks;
}
public static Class<?> findCollectionFallback(JavaType type) {
return _collectionFallbacks.get(type.getRawClass().getName());
}
public static Class<?> findMapFallback(JavaType type) {
return _mapFallbacks.get(type.getRawClass().getName());
}
}
>>>>>>>
/**
* Helper class to contain default mappings for abstract JDK {@link java.util.Collection}
* and {@link java.util.Map} types. Separated out here to defer cost of creating lookups
* until mappings are actually needed.
*
* @since 2.10
*/
@SuppressWarnings("rawtypes")
protected static class ContainerDefaultMappings {
// We do some defaulting for abstract Collection classes and
// interfaces, to avoid having to use exact types or annotations in
// cases where the most common concrete Collection will do.
final static HashMap<String, Class<? extends Collection>> _collectionFallbacks;
static {
HashMap<String, Class<? extends Collection>> fallbacks = new HashMap<>();
final Class<? extends Collection> DEFAULT_LIST = ArrayList.class;
final Class<? extends Collection> DEFAULT_SET = HashSet.class;
fallbacks.put(Collection.class.getName(), DEFAULT_LIST);
fallbacks.put(List.class.getName(), DEFAULT_LIST);
fallbacks.put(Set.class.getName(), DEFAULT_SET);
fallbacks.put(SortedSet.class.getName(), TreeSet.class);
fallbacks.put(Queue.class.getName(), LinkedList.class);
// 09-Feb-2019, tatu: How did we miss these? Related in [databind#2251] problem
fallbacks.put(AbstractList.class.getName(), DEFAULT_LIST);
fallbacks.put(AbstractSet.class.getName(), DEFAULT_SET);
// 09-Feb-2019, tatu: And more esoteric types added in JDK6
fallbacks.put(Deque.class.getName(), LinkedList.class);
fallbacks.put(NavigableSet.class.getName(), TreeSet.class);
_collectionFallbacks = fallbacks;
}
// We do some defaulting for abstract Map classes and
// interfaces, to avoid having to use exact types or annotations in
// cases where the most common concrete Maps will do.
final static HashMap<String, Class<? extends Map>> _mapFallbacks;
static {
HashMap<String, Class<? extends Map>> fallbacks = new HashMap<>();
final Class<? extends Map> DEFAULT_MAP = LinkedHashMap.class;
fallbacks.put(Map.class.getName(), DEFAULT_MAP);
fallbacks.put(AbstractMap.class.getName(), DEFAULT_MAP);
fallbacks.put(ConcurrentMap.class.getName(), ConcurrentHashMap.class);
fallbacks.put(SortedMap.class.getName(), TreeMap.class);
fallbacks.put(java.util.NavigableMap.class.getName(), TreeMap.class);
fallbacks.put(java.util.concurrent.ConcurrentNavigableMap.class.getName(),
java.util.concurrent.ConcurrentSkipListMap.class);
_mapFallbacks = fallbacks;
}
public static Class<?> findCollectionFallback(JavaType type) {
return _collectionFallbacks.get(type.getRawClass().getName());
}
public static Class<?> findMapFallback(JavaType type) {
return _mapFallbacks.get(type.getRawClass().getName());
}
} |
<<<<<<<
public DataResponse<T> update(String id, @Nullable String study, ObjectMap params) throws IOException {
=======
public QueryResponse<T> update(String id, @Nullable String study, ObjectMap bodyParams) throws IOException {
>>>>>>>
public DataResponse<T> update(String id, @Nullable String study, ObjectMap bodyParams) throws IOException {
<<<<<<<
public DataResponse<T> delete(String id, ObjectMap params) throws IOException {
=======
public QueryResponse<T> update(String id, @Nullable String study, ObjectMap queryParams, ObjectMap bodyParams) throws IOException {
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(bodyParams);
ObjectMap p = new ObjectMap("body", json);
p.putAll(queryParams);
p.putIfNotNull("study", study);
logger.debug("Json in update client: " + json);
return execute(category, id, "update", p, POST, clazz);
}
public QueryResponse<T> delete(String id, ObjectMap params) throws IOException {
>>>>>>>
public DataResponse<T> update(String id, @Nullable String study, ObjectMap queryParams, ObjectMap bodyParams) throws IOException {
ObjectMapper mapper = new ObjectMapper();
String json = mapper.writeValueAsString(bodyParams);
ObjectMap p = new ObjectMap("body", json);
p.putAll(queryParams);
p.putIfNotNull("study", study);
logger.debug("Json in update client: " + json);
return execute(category, id, "update", p, POST, clazz);
}
public DataResponse<T> delete(String id, ObjectMap params) throws IOException { |
<<<<<<<
public abstract QueryResult<Project> createProject(String userId, Project project) throws CatalogDBException, JsonProcessingException;
=======
boolean projectExists(int projectId);
QueryResult<Project> createProject(String userId, Project project) throws CatalogManagerException, JsonProcessingException;
>>>>>>>
public abstract QueryResult<Project> createProject(String userId, Project project) throws CatalogDBException, JsonProcessingException;
public abstract boolean projectExists(int projectId);
<<<<<<<
public abstract QueryResult<Study> createStudy(int projectId, Study study) throws CatalogDBException;
=======
boolean studyExists(int studyId);
QueryResult<Study> createStudy(int projectId, Study study) throws CatalogManagerException;
>>>>>>>
public abstract QueryResult<Study> createStudy(int projectId, Study study) throws CatalogDBException;
public abstract boolean studyExists(int studyId);
<<<<<<<
public abstract QueryResult<Acl> getStudyAcl(int projectId, String userId) throws CatalogDBException;
public abstract QueryResult setStudyAcl(int projectId, Acl newAcl) throws CatalogDBException;
=======
QueryResult<Acl> getStudyAcl(int projectId, String userId) throws CatalogManagerException;
QueryResult setStudyAcl(int projectId, Acl newAcl) throws CatalogManagerException;
>>>>>>>
public abstract QueryResult<Acl> getStudyAcl(int projectId, String userId) throws CatalogDBException;
public abstract QueryResult setStudyAcl(int projectId, Acl newAcl) throws CatalogDBException;
<<<<<<<
public abstract QueryResult<Job> createJob(int studyId, Job job) throws CatalogDBException;
=======
boolean jobExists(int jobId);
QueryResult<Job> createJob(int studyId, Job job) throws CatalogManagerException;
>>>>>>>
public abstract boolean jobExists(int jobId);
public abstract QueryResult<Job> createJob(int studyId, Job job) throws CatalogDBException;
<<<<<<<
// public abstract QueryResult<Tool> searchTool(QueryOptions options);
=======
/**
* Experiments methods
* ***************************
*/
boolean experimentExists(int experimentId);
/**
* Samples methods
* ***************************
*/
boolean sampleExists(int sampleId);
// QueryResult<Tool> searchTool(QueryOptions options);
>>>>>>>
// public abstract QueryResult<Tool> searchTool(QueryOptions options);
/**
* Experiments methods
* ***************************
*/
public abstract boolean experimentExists(int experimentId);
/**
* Samples methods
* ***************************
*/
public abstract boolean sampleExists(int sampleId);
// QueryResult<Tool> searchTool(QueryOptions options); |
<<<<<<<
logger.debug("POST");
if (!variantSourceWritten.getAndSet(true)) {
if (writeStudyConfiguration) {
writeStudyConfiguration();
}
if (writeVariantSource) {
writeSourceSummary(source);
}
}
=======
logger.info("POST");
writeSourceSummary(source);
DBObject onBackground = new BasicDBObject("background", true);
variantMongoCollection.createIndex(new BasicDBObject("_at.chunkIds", 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject("annot.xrefs.id", 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject("annot.ct.so", 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject(DBObjectToVariantConverter.IDS_FIELD, 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject(DBObjectToVariantConverter.CHROMOSOME_FIELD, 1), onBackground);
variantMongoCollection.createIndex(
new BasicDBObject(DBObjectToVariantConverter.FILES_FIELD + "." + DBObjectToVariantSourceEntryConverter.STUDYID_FIELD, 1)
.append(DBObjectToVariantConverter.FILES_FIELD + "." + DBObjectToVariantSourceEntryConverter.FILEID_FIELD, 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject("st.maf", 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject("st.mgf", 1), onBackground);
variantMongoCollection.createIndex(
new BasicDBObject(DBObjectToVariantConverter.CHROMOSOME_FIELD, 1)
.append(DBObjectToVariantConverter.START_FIELD, 1)
.append(DBObjectToVariantConverter.END_FIELD, 1), onBackground);
logger.debug("sent order to create indices");
>>>>>>>
logger.debug("POST");
if (!variantSourceWritten.getAndSet(true)) {
if (writeStudyConfiguration) {
writeStudyConfiguration();
}
if (writeVariantSource) {
writeSourceSummary(source);
}
DBObject onBackground = new BasicDBObject("background", true);
variantMongoCollection.createIndex(new BasicDBObject("_at.chunkIds", 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject("annot.xrefs.id", 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject("annot.ct.so", 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject(DBObjectToVariantConverter.IDS_FIELD, 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject(DBObjectToVariantConverter.CHROMOSOME_FIELD, 1), onBackground);
variantMongoCollection.createIndex(
new BasicDBObject(DBObjectToVariantConverter.FILES_FIELD + "." + DBObjectToVariantSourceEntryConverter.STUDYID_FIELD, 1)
.append(DBObjectToVariantConverter.FILES_FIELD + "." + DBObjectToVariantSourceEntryConverter.FILEID_FIELD, 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject("st.maf", 1), onBackground);
variantMongoCollection.createIndex(new BasicDBObject("st.mgf", 1), onBackground);
variantMongoCollection.createIndex(
new BasicDBObject(DBObjectToVariantConverter.CHROMOSOME_FIELD, 1)
.append(DBObjectToVariantConverter.START_FIELD, 1)
.append(DBObjectToVariantConverter.END_FIELD, 1), onBackground);
logger.debug("sent order to create indices");
} |
<<<<<<<
private RestResponse<Job> bwa() throws ClientException {
ObjectMap params = new AlignmentAnalysisWSService.BwaRunParams(
=======
private RestResponse<Job> bwa() throws IOException {
ObjectMap params = new AlignmentWebService.BwaRunParams(
>>>>>>>
private RestResponse<Job> bwa() throws ClientException {
ObjectMap params = new AlignmentWebService.BwaRunParams(
<<<<<<<
private RestResponse<Job> samtools() throws ClientException {
ObjectMap params = new AlignmentAnalysisWSService.SamtoolsRunParams(
=======
private RestResponse<Job> samtools() throws IOException {
ObjectMap params = new AlignmentWebService.SamtoolsRunParams(
>>>>>>>
private RestResponse<Job> samtools() throws ClientException {
ObjectMap params = new AlignmentWebService.SamtoolsRunParams(
<<<<<<<
private RestResponse<Job> deeptools() throws ClientException {
ObjectMap params = new AlignmentAnalysisWSService.DeeptoolsRunParams(
=======
private RestResponse<Job> deeptools() throws IOException {
ObjectMap params = new AlignmentWebService.DeeptoolsRunParams(
>>>>>>>
private RestResponse<Job> deeptools() throws ClientException {
ObjectMap params = new AlignmentWebService.DeeptoolsRunParams(
<<<<<<<
private RestResponse<Job> fastqc() throws ClientException {
ObjectMap params = new AlignmentAnalysisWSService.FastqcRunParams(
=======
private RestResponse<Job> fastqc() throws IOException {
ObjectMap params = new AlignmentWebService.FastqcRunParams(
>>>>>>>
private RestResponse<Job> fastqc() throws ClientException {
ObjectMap params = new AlignmentWebService.FastqcRunParams( |
<<<<<<<
import org.opencb.opencga.catalog.models.Job;
=======
>>>>>>>
<<<<<<<
import org.opencb.opencga.storage.core.local.AlignmentStorageManager;
=======
>>>>>>>
import org.opencb.opencga.storage.core.local.AlignmentStorageManager; |
<<<<<<<
INTERNAL_DATASTORES("internal.datastores", TEXT_ARRAY, ""),
=======
INTERNAL("internal", TEXT_ARRAY, ""),
>>>>>>>
INTERNAL_DATASTORES("internal.datastores", TEXT_ARRAY, ""),
INTERNAL("internal", TEXT_ARRAY, ""), |
<<<<<<<
import org.opencb.opencga.core.SgeManager;
import org.opencb.opencga.core.models.Job;
=======
import org.opencb.opencga.core.models.Job;
import org.opencb.opencga.catalog.monitor.executors.SgeManager;
>>>>>>>
import org.opencb.opencga.catalog.monitor.executors.SgeManager;
import org.opencb.opencga.core.models.Job; |
<<<<<<<
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicLong;
=======
import java.util.concurrent.TimeUnit;
>>>>>>>
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.TimeUnit;
<<<<<<<
ParallelTaskRunner.Task<Variant, Variant> progressTask;
ExecutorService executor;
if (VariantQueryCommandUtils.isStandardOutput(cliOptions)) {
progressTask = batch -> batch;
executor = null;
} else {
AtomicLong total = new AtomicLong(0);
executor = asyncCount(query, queryOptions, variantFetcher, total);
progressTask = getProgressTask(total);
}
=======
ParallelTaskRunner.Config config = ParallelTaskRunner.Config.builder()
.setNumTasks(1)
.setBatchSize(10)
.setAbortOnFail(true)
.build();
>>>>>>>
ParallelTaskRunner.Task<Variant, Variant> progressTask;
ExecutorService executor;
if (VariantQueryCommandUtils.isStandardOutput(cliOptions)) {
progressTask = batch -> batch;
executor = null;
} else {
AtomicLong total = new AtomicLong(0);
executor = asyncCount(query, queryOptions, variantFetcher, total);
progressTask = getProgressTask(total);
}
ParallelTaskRunner.Config config = ParallelTaskRunner.Config.builder()
.setNumTasks(1)
.setBatchSize(10)
.setAbortOnFail(true)
.build();
<<<<<<<
}, progressTask, exporter, new ParallelTaskRunner.Config(1, 10, 10, true, true));
=======
}, batch -> batch, exporter, config);
>>>>>>>
}, batch -> batch, exporter, config);
<<<<<<<
if (executor != null) {
executor.shutdownNow();
}
// exporter.open();
// exporter.pre();
// while (iterator.hasNext()) {
// exporter.write(iterator.next());
// }
// exporter.post();
// exporter.close();
// iterator.close();
=======
logger.info("Time fetching data: " + iterator.getTimeFetching(TimeUnit.MILLISECONDS) / 1000.0 + "s");
logger.info("Time converting data: " + iterator.getTimeConverting(TimeUnit.MILLISECONDS) / 1000.0 + "s");
>>>>>>>
if (executor != null) {
executor.shutdownNow();
}
logger.info("Time fetching data: " + iterator.getTimeFetching(TimeUnit.MILLISECONDS) / 1000.0 + "s");
logger.info("Time converting data: " + iterator.getTimeConverting(TimeUnit.MILLISECONDS) / 1000.0 + "s"); |
<<<<<<<
FacetQueryResult result = catalogSolrManager.facetedQuery(study, CatalogSolrManager.COHORT_SOLR_COLLECTION, query, options,
userId);
auditManager.auditFacet(userId, Enums.Resource.COHORT, study.getId(), study.getUuid(), auditParams,
=======
DataResult<FacetField> result = catalogSolrManager.facetedQuery(study, CatalogSolrManager.COHORT_SOLR_COLLECTION, query,
options, userId);
auditManager.auditFacet(userId, AuditRecord.Resource.COHORT, study.getId(), study.getUuid(), auditParams,
>>>>>>>
DataResult<FacetField> result = catalogSolrManager.facetedQuery(study, CatalogSolrManager.COHORT_SOLR_COLLECTION, query,
options, userId);
auditManager.auditFacet(userId, Enums.Resource.COHORT, study.getId(), study.getUuid(), auditParams, |
<<<<<<<
@Parameter(names = {"-d", "--database"}, description = "DataBase name", required = false, arity = 1)
public String dbName;
}
=======
public void printUsage(){
if(getCommand().isEmpty()) {
System.err.println("");
System.err.println("Program: OpenCGA Storage (OpenCB)");
System.err.println("Version: 0.6.0");
System.err.println("Description: Big Data platform for processing and analysing NGS data");
System.err.println("");
System.err.println("Usage: opencga-storage.sh [-h|--help] [--version] <command> [options]");
System.err.println("");
System.err.println("Commands:");
printMainUsage();
System.err.println("");
} else {
String parsedCommand = getCommand();
System.err.println("");
System.err.println("Usage: opencga-storage.sh " + parsedCommand + " [options]");
System.err.println("");
System.err.println("Options:");
printCommandUsage(jcommander.getCommands().get(parsedCommand));
System.err.println("");
}
}
private void printMainUsage() {
for (String s : jcommander.getCommands().keySet()) {
System.err.printf("%20s %s\n", s, jcommander.getCommandDescription(s));
}
}
private void printCommandUsage(JCommander commander) {
for (ParameterDescription parameterDescription : commander.getParameters()) {
String type = "";
if (parameterDescription.getParameterized().getParameter() != null && parameterDescription.getParameterized().getParameter().arity() > 0) {
type = parameterDescription.getParameterized().getGenericType().getTypeName().replace("java.lang.", "").toUpperCase();
}
System.err.printf("%5s %-20s %-10s %s [%s]\n",
(parameterDescription.getParameterized().getParameter() != null
&& parameterDescription.getParameterized().getParameter().required()) ? "*": "",
parameterDescription.getNames(),
type,
parameterDescription.getDescription(),
parameterDescription.getDefault());
}
}
>>>>>>>
@Parameter(names = {"-d", "--database"}, description = "DataBase name", required = false, arity = 1)
public String dbName;
}
public void printUsage(){
if(getCommand().isEmpty()) {
System.err.println("");
System.err.println("Program: OpenCGA Storage (OpenCB)");
System.err.println("Version: 0.6.0");
System.err.println("Description: Big Data platform for processing and analysing NGS data");
System.err.println("");
System.err.println("Usage: opencga-storage.sh [-h|--help] [--version] <command> [options]");
System.err.println("");
System.err.println("Commands:");
printMainUsage();
System.err.println("");
} else {
String parsedCommand = getCommand();
System.err.println("");
System.err.println("Usage: opencga-storage.sh " + parsedCommand + " [options]");
System.err.println("");
System.err.println("Options:");
printCommandUsage(jcommander.getCommands().get(parsedCommand));
System.err.println("");
}
}
private void printMainUsage() {
for (String s : jcommander.getCommands().keySet()) {
System.err.printf("%20s %s\n", s, jcommander.getCommandDescription(s));
}
}
private void printCommandUsage(JCommander commander) {
for (ParameterDescription parameterDescription : commander.getParameters()) {
String type = "";
if (parameterDescription.getParameterized().getParameter() != null && parameterDescription.getParameterized().getParameter().arity() > 0) {
type = parameterDescription.getParameterized().getGenericType().getTypeName().replace("java.lang.", "").toUpperCase();
}
System.err.printf("%5s %-20s %-10s %s [%s]\n",
(parameterDescription.getParameterized().getParameter() != null
&& parameterDescription.getParameterized().getParameter().required()) ? "*": "",
parameterDescription.getNames(),
type,
parameterDescription.getDescription(),
parameterDescription.getDefault());
}
} |
<<<<<<<
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_NAME.key(), new Document("$ne", group.getName()));
=======
.append(PRIVATE_ID, studyId)
.append(QueryParams.GROUP_ID.key(), new Document("$ne", group.getId()));
>>>>>>>
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_ID.key(), new Document("$ne", group.getId()));
<<<<<<<
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_NAME.key(), groupId)
=======
.append(PRIVATE_ID, studyId)
.append(QueryParams.GROUP_ID.key(), groupId)
>>>>>>>
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_ID.key(), groupId)
<<<<<<<
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_NAME.key(), groupId)
=======
.append(PRIVATE_ID, studyId)
.append(QueryParams.GROUP_ID.key(), groupId)
>>>>>>>
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_ID.key(), groupId)
<<<<<<<
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_NAME.key(), groupId)
=======
.append(PRIVATE_ID, studyId)
.append(QueryParams.GROUP_ID.key(), groupId)
>>>>>>>
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_ID.key(), groupId)
<<<<<<<
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_NAME.key(), groupId)
=======
.append(PRIVATE_ID, studyId)
.append(QueryParams.GROUP_ID.key(), groupId)
>>>>>>>
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_ID.key(), groupId)
<<<<<<<
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_NAME.key(), groupId)
=======
.append(PRIVATE_ID, studyId)
.append(QueryParams.GROUP_ID.key(), groupId)
>>>>>>>
.append(PRIVATE_UID, studyId)
.append(QueryParams.GROUP_ID.key(), groupId) |
<<<<<<<
if (Enums.ExecutionStatus.RUNNING.equals(executionStatus.getName())) {
AnalysisResult result = readAnalysisResult(Paths.get(job.getTmpDir().getUri()));
=======
if (Job.JobStatus.RUNNING.equals(jobStatus.getName())) {
String analysisId = String.valueOf(job.getAttributes().get(Job.OPENCGA_COMMAND));
AnalysisResult result = readAnalysisResult(analysisId, Paths.get(job.getTmpDir().getUri()));
>>>>>>>
if (Enums.ExecutionStatus.RUNNING.equals(executionStatus.getName())) {
String analysisId = String.valueOf(job.getAttributes().get(Job.OPENCGA_COMMAND));
AnalysisResult result = readAnalysisResult(analysisId, Paths.get(job.getTmpDir().getUri())); |
<<<<<<<
=======
import org.opencb.commons.datastore.core.DataResult;
import org.opencb.commons.datastore.core.ObjectMap;
>>>>>>>
import org.opencb.commons.datastore.core.DataResult;
import org.opencb.commons.datastore.core.ObjectMap;
<<<<<<<
import org.opencb.opencga.analysis.clinical.interpretation.TieringInterpretationConfiguration;
import org.opencb.opencga.analysis.exceptions.AnalysisException;
=======
>>>>>>>
import org.opencb.opencga.analysis.clinical.interpretation.TieringInterpretationConfiguration;
<<<<<<<
import org.opencb.oskar.analysis.result.AnalysisResult;
=======
import org.opencb.opencga.core.exception.AnalysisException;
>>>>>>> |
<<<<<<<
case VariantCommandOptions.SampleEligibilityCommandOptions.SAMPLE_ELIGIBILITY_RUN_COMMAND:
sampleEligibility();
break;
=======
case MUTATIONAL_SIGNATURE_RUN_COMMAND:
mutationalSignature();
break;
>>>>>>>
case VariantCommandOptions.SampleEligibilityCommandOptions.SAMPLE_ELIGIBILITY_RUN_COMMAND:
sampleEligibility();
case MUTATIONAL_SIGNATURE_RUN_COMMAND:
mutationalSignature();
break; |
<<<<<<<
List<FileReferenceParam> files, Map<String, Family.FamiliarRelationship> roleToProband,
ClinicalAnalystParam analyst, ClinicalAnalysisInternal internal, Interpretation interpretation,
List<Interpretation> secondaryInterpretations, ClinicalAnalysisQcUpdateParams qualityControl,
ClinicalConsent consent, String dueDate, List<ClinicalComment> comments, List<Alert> alerts,
Enums.Priority priority, List<String> flags, Map<String, Object> attributes, CustomStatusParams status) {
=======
List<FileReferenceParam> files, Boolean locked,
Map<String, ClinicalAnalysis.FamiliarRelationship> roleToProband, ClinicalAnalystParam analyst,
ClinicalAnalysisInternal internal, ClinicalAnalysisQcUpdateParams qualityControl, ClinicalConsent consent,
String dueDate, List<Comment> comments, List<Alert> alerts, Enums.Priority priority, List<String> flags,
Map<String, Object> attributes, CustomStatusParams status) {
>>>>>>>
List<FileReferenceParam> files, Boolean locked, ClinicalAnalystParam analyst,
ClinicalAnalysisInternal internal, ClinicalAnalysisQcUpdateParams qualityControl, ClinicalConsent consent,
String dueDate, List<ClinicalComment> comments, List<Alert> alerts, Enums.Priority priority,
List<String> flags, Map<String, Object> attributes, CustomStatusParams status) { |
<<<<<<<
return userManager.create(id, name, email, password, organization, diskQuota, options,
configuration.getAdmin().getPassword());
=======
return userManager.create(id, name, email, password, organization, quota, options,
catalogConfiguration.getAdmin().getPassword());
>>>>>>>
return userManager.create(id, name, email, password, organization, quota, options,
configuration.getAdmin().getPassword()); |
<<<<<<<
import org.opencb.opencga.core.SolrException;
import org.opencb.opencga.core.models.*;
=======
import org.opencb.opencga.core.models.DataStore;
import org.opencb.opencga.core.models.File;
import org.opencb.opencga.core.models.Sample;
import org.opencb.opencga.core.models.Study;
>>>>>>>
import org.opencb.opencga.core.SolrException;
import org.opencb.opencga.core.models.DataStore;
import org.opencb.opencga.core.models.File;
import org.opencb.opencga.core.models.Sample;
import org.opencb.opencga.core.models.Study; |
<<<<<<<
List<DBObject> cohorts = statsConverter.convertCohortsToStorageType(cohortStats, studyId, fileId); // TODO remove when we remove fileId
// List cohorts = statsConverter.convertCohortsToStorageType(cohortStats, variantSource.getStudyId()); // TODO use when we remove fileId
=======
List<DBObject> cohorts = statsConverter.convertCohortsToStorageType(cohortStats, variantSource.getStudyId(), variantSource.getFileId()); // TODO jmmut: remove when we remove fileId
// List cohorts = statsConverter.convertCohortsToStorageType(cohortStats, variantSource.getStudyId()); // TODO jmmut: use when we remove fileId
// add cohorts, overwriting old values if that cid, fid and sid already exists: remove and then add
// db.variants.update(
// {_id:<id>},
// {$pull:{st:{cid:{$in:["Cohort 1","cohort 2"]}, fid:{$in:["file 1", "file 2"]}, sid:{$in:["study 1", "study 2"]}}}}
// )
// db.variants.update(
// {_id:<id>},
// {$push:{st:{$each: [{cid:"Cohort 1", fid:"file 1", ... , value:3},{cid:"Cohort 2", ... , value:3}] }}}
// )
>>>>>>>
List<DBObject> cohorts = statsConverter.convertCohortsToStorageType(cohortStats, studyId, fileId); // TODO remove when we remove fileId
// List cohorts = statsConverter.convertCohortsToStorageType(cohortStats, variantSource.getStudyId()); // TODO use when we remove fileId
// add cohorts, overwriting old values if that cid, fid and sid already exists: remove and then add
// db.variants.update(
// {_id:<id>},
// {$pull:{st:{cid:{$in:["Cohort 1","cohort 2"]}, fid:{$in:["file 1", "file 2"]}, sid:{$in:["study 1", "study 2"]}}}}
// )
// db.variants.update(
// {_id:<id>},
// {$push:{st:{$each: [{cid:"Cohort 1", fid:"file 1", ... , value:3},{cid:"Cohort 2", ... , value:3}] }}}
// )
<<<<<<<
for (DBObject cohort : cohorts) { // remove already present elements one by one. TODO improve this. pullAll requires exact match and addToSet does not overwrite, we would need a putToSet
DBObject find = new BasicDBObject("_id", id)
.append(
DBObjectToVariantConverter.STATS_FIELD + "." + DBObjectToVariantStatsConverter.STUDY_ID,
cohort.get(DBObjectToVariantStatsConverter.STUDY_ID));
DBObject update = new BasicDBObject("$pull",
new BasicDBObject(DBObjectToVariantConverter.STATS_FIELD,
new BasicDBObject(DBObjectToVariantStatsConverter.STUDY_ID,
cohort.get(DBObjectToVariantStatsConverter.STUDY_ID))));
builder.find(find).updateOne(update);
=======
List<String> cohortIds = new ArrayList<>(cohorts.size());
List<String> fileIds = new ArrayList<>(cohorts.size());
List<String> studyIds = new ArrayList<>(cohorts.size());
for (DBObject cohort : cohorts) {
cohortIds.add((String) cohort.get(DBObjectToVariantStatsConverter.COHORT_ID));
fileIds.add((String) cohort.get(DBObjectToVariantStatsConverter.FILE_ID));
studyIds.add((String) cohort.get(DBObjectToVariantStatsConverter.STUDY_ID));
>>>>>>>
List<String> cohortIds = new ArrayList<>(cohorts.size());
List<String> fileIds = new ArrayList<>(cohorts.size());
List<String> studyIds = new ArrayList<>(cohorts.size());
for (DBObject cohort : cohorts) {
cohortIds.add((String) cohort.get(DBObjectToVariantStatsConverter.COHORT_ID));
fileIds.add((String) cohort.get(DBObjectToVariantStatsConverter.FILE_ID));
studyIds.add((String) cohort.get(DBObjectToVariantStatsConverter.STUDY_ID)); |
<<<<<<<
/*
* Copyright (C) 2012-2019 52°North Initiative for Geospatial Open Source
=======
/**
* Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source
>>>>>>>
/*
* Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source |
<<<<<<<
import org.opencb.opencga.catalog.auth.authentication.AuthenticationManager;
import org.opencb.opencga.catalog.auth.authentication.CatalogAuthenticationManager;
import org.opencb.opencga.catalog.auth.authentication.LDAPAuthenticationManager;
import org.opencb.opencga.catalog.auth.authentication.LDAPUtils;
=======
import org.opencb.opencga.catalog.auth.authentication.*;
>>>>>>>
import org.opencb.opencga.catalog.auth.authentication.*;
<<<<<<<
=======
ADMIN_TOKEN = authenticationManagerMap.get(INTERNAL_AUTHORIZATION).createNonExpiringToken("admin");
>>>>>>>
<<<<<<<
/**
* Create a new user.
*
* @param id User id
* @param name Name
* @param email Email
* @param password Encrypted Password
* @param organization Optional organization
* @param quota Maximum user disk quota
* @param accountType User account type. Full or guest.
* @param options Optional options
* @param token Authentication token needed if the registration is closed.
* @return The created user
* @throws CatalogException If user already exists, or unable to create a new user.
*/
public QueryResult<User> create(String id, String name, String email, String password, String organization, Long quota,
String accountType, QueryOptions options, String token) throws CatalogException {
=======
public QueryResult<User> create(User user, @Nullable String token) throws CatalogException {
>>>>>>>
public QueryResult<User> create(User user, @Nullable String token) throws CatalogException {
<<<<<<<
if (!ROOT.equals(getUserId(token))) {
=======
if (!"admin".equals(authenticationManagerMap.get(INTERNAL_AUTHORIZATION).getUserId(token))) {
>>>>>>>
if (!"admin".equals(authenticationManagerMap.get(INTERNAL_AUTHORIZATION).getUserId(token))) {
<<<<<<<
=======
* This method can only be run by the admin user. It will import users and groups from other authentication origins such as LDAP,
* Kerberos, etc into catalog.
* <p>
* @param authOrigin Id present in the catalog configuration of the authentication origin.
* @param accountType Type of the account to be created for the imported users (guest, full).
* @param params Object map containing other parameters that are useful to import users.
* @param sessionId Valid admin token.
* @return LdapImportResult Object containing a summary of the actions performed.
* @throws CatalogException catalogException
*/
@Deprecated
public LdapImportResult importFromExternalAuthOrigin(String authOrigin, String accountType, ObjectMap params, String sessionId)
throws CatalogException {
try {
if (!authenticationManagerMap.get(INTERNAL_AUTHORIZATION).getUserId(sessionId).equals("admin")) {
throw new CatalogException("Token does not belong to admin");
}
} catch (CatalogException e) {
// We build an LdapImportResult that will contain the error message + the input information provided.
logger.error(e.getMessage(), e);
LdapImportResult retResult = new LdapImportResult();
LdapImportResult.Input input = new LdapImportResult.Input(params.getAsStringList("users"), params.getString("group"),
params.getString("study-group"), authOrigin, accountType, params.getString("study"));
retResult.setInput(input);
retResult.setErrorMsg(e.getMessage());
return retResult;
}
return importFromExternalAuthOrigin(authOrigin, accountType, params);
}
/**
>>>>>>>
<<<<<<<
catalogManager.getStudyManager().createGroup(studyStr, studyGroup, StringUtils.join(userSet, ","), token);
=======
catalogManager.getStudyManager().createGroup(Long.toString(studyId), new Group(retResult.getInput().getStudyGroup(),
userSet.stream().collect(Collectors.toList())), ADMIN_TOKEN);
>>>>>>>
catalogManager.getStudyManager().createGroup(studyStr, new Group(studyGroup, userSet.stream().collect(Collectors.toList())),
authenticationManagerMap.get(INTERNAL_AUTHORIZATION).createToken("admin")); |
<<<<<<<
public boolean isAlive() throws IOException {
try {
return solrClient.ping().getResponse().get("status").equals("OK");
} catch (SolrException | SolrServerException e) {
logger.trace("Failed isAlive", e);
}
return false;
}
@Deprecated
=======
>>>>>>> |
<<<<<<<
import org.opencb.opencga.storage.core.StorageManagerException;
=======
import org.opencb.opencga.storage.core.StorageManagerFactory;
>>>>>>>
import org.opencb.opencga.storage.core.StorageManagerException;
import org.opencb.opencga.storage.core.StorageManagerFactory;
<<<<<<<
String commandLine = createCommandLine(study, file, index, sampleList, storageEngine,
temporalOutDirUri, indexFileModifyParams, dbName, sessionId, options);
=======
String commandLine = createCommandLine(study, originalFile, inputFile, sampleList,
temporalOutDirUri, indexAttributes, dataStore, options);
>>>>>>>
String commandLine = createCommandLine(study, originalFile, inputFile, sampleList,
temporalOutDirUri, indexAttributes, dataStore, sessionId, options);
<<<<<<<
private String createCommandLine(Study study, File file, File indexFile, List<Sample> sampleList, String storageEngine,
URI outDirUri, final ObjectMap indexFileModifyParams, final String dbName, String sessionId, QueryOptions options)
=======
private String createCommandLine(Study study, File originalFile, File inputFile, List<Sample> sampleList,
URI outDirUri, final ObjectMap indexAttributes, final DataStore dataStore, QueryOptions options)
>>>>>>>
private String createCommandLine(Study study, File originalFile, File inputFile, List<Sample> sampleList,
URI outDirUri, final ObjectMap indexAttributes, final DataStore dataStore,
String sessionId, QueryOptions options)
<<<<<<<
.append(" --include-genotypes ")
.append(" --compress-genotypes ")
.append(" --include-stats ")
.append(" -D").append(VariantStorageManager.STUDY_CONFIGURATION_MANAGER_CLASS_NAME).append("=").append(CatalogStudyConfigurationManager.class.getName())
.append(" -D").append("sessionId").append("=").append(sessionId)
.append(" --sample-ids ").append(sampleIdsString)
=======
// .append(" --sample-ids ").append(sampleIdsString)
>>>>>>>
.append(" -D").append(VariantStorageManager.STUDY_CONFIGURATION_MANAGER_CLASS_NAME).append("=").append(CatalogStudyConfigurationManager.class.getName())
.append(" -D").append("sessionId").append("=").append(sessionId)
.append(" --sample-ids ").append(sampleIdsString)
<<<<<<<
private List<Sample> getFileSamples(Study study, File file, ObjectMap indexFileModifyParams, boolean simulate, QueryOptions options, String sessionId)
throws AnalysisExecutionException, CatalogException {
=======
private List<Sample> getFileSamples(Study study, File file, ObjectMap fileModifyParams, boolean simulate, QueryOptions options, String sessionId)
throws CatalogException {
>>>>>>>
private List<Sample> getFileSamples(Study study, File file, ObjectMap fileModifyParams, boolean simulate, QueryOptions options, String sessionId)
throws CatalogException, AnalysisExecutionException { |
<<<<<<<
import org.opencb.opencga.core.common.TimeUtils;
import org.opencb.opencga.core.exception.AnalysisException;
=======
import org.opencb.opencga.core.analysis.result.Status;
import org.opencb.opencga.core.common.JacksonUtils;
>>>>>>>
import org.opencb.opencga.core.analysis.result.Status;
import org.opencb.opencga.core.common.JacksonUtils;
<<<<<<<
import org.opencb.opencga.core.models.common.Enums;
import org.opencb.opencga.core.analysis.result.Status;
=======
import org.opencb.opencga.core.models.Study;
import org.opencb.opencga.core.models.acls.AclParams;
import org.opencb.opencga.core.models.acls.permissions.FileAclEntry;
>>>>>>>
import org.opencb.opencga.core.models.Study;
import org.opencb.opencga.core.models.acls.AclParams;
import org.opencb.opencga.core.models.acls.permissions.FileAclEntry;
import org.opencb.opencga.core.models.common.Enums;
<<<<<<<
@Override
public void run() {
Query pendingJobsQuery = new Query(JobDBAdaptor.QueryParams.STATUS_NAME.key(), Enums.ExecutionStatus.PENDING);
Query queuedJobsQuery = new Query(JobDBAdaptor.QueryParams.STATUS_NAME.key(), Enums.ExecutionStatus.QUEUED);
Query runningJobsQuery = new Query(JobDBAdaptor.QueryParams.STATUS_NAME.key(), Enums.ExecutionStatus.RUNNING);
=======
this.defaultJobDir = Paths.get(catalogManager.getConfiguration().getJobDir());
pendingJobsQuery = new Query(JobDBAdaptor.QueryParams.STATUS_NAME.key(), Job.JobStatus.PENDING);
queuedJobsQuery = new Query(JobDBAdaptor.QueryParams.STATUS_NAME.key(), Job.JobStatus.QUEUED);
runningJobsQuery = new Query(JobDBAdaptor.QueryParams.STATUS_NAME.key(), Job.JobStatus.RUNNING);
>>>>>>>
this.defaultJobDir = Paths.get(catalogManager.getConfiguration().getJobDir());
pendingJobsQuery = new Query(JobDBAdaptor.QueryParams.STATUS_NAME.key(), Enums.ExecutionStatus.PENDING);
queuedJobsQuery = new Query(JobDBAdaptor.QueryParams.STATUS_NAME.key(), Enums.ExecutionStatus.QUEUED);
runningJobsQuery = new Query(JobDBAdaptor.QueryParams.STATUS_NAME.key(), Enums.ExecutionStatus.RUNNING);
<<<<<<<
private int checkQueuedJob(Job job) {
Enums.ExecutionStatus status = getCurrentStatus(job);
=======
protected int checkQueuedJob(Job job) {
Job.JobStatus status = getCurrentStatus(job);
>>>>>>>
protected int checkQueuedJob(Job job) {
Enums.ExecutionStatus status = getCurrentStatus(job);
<<<<<<<
private int checkPendingJob(Job job) {
String study = String.valueOf(job.getAttributes().getOrDefault(Job.OPENCGA_STUDY, ""));
if (study.isEmpty()) {
=======
protected int checkPendingJob(Job job) {
String study = String.valueOf(job.getAttributes().get(Job.OPENCGA_STUDY));
if (StringUtils.isEmpty(study)) {
>>>>>>>
protected int checkPendingJob(Job job) {
String study = String.valueOf(job.getAttributes().get(Job.OPENCGA_STUDY));
if (StringUtils.isEmpty(study)) {
<<<<<<<
String command = String.valueOf(job.getAttributes().getOrDefault(Job.OPENCGA_COMMAND, ""));
if (command.isEmpty()) {
=======
String command = String.valueOf(job.getAttributes().get(Job.OPENCGA_COMMAND));
if (StringUtils.isEmpty(command)) {
>>>>>>>
String command = String.valueOf(job.getAttributes().get(Job.OPENCGA_COMMAND));
if (StringUtils.isEmpty(command)) {
<<<<<<<
String subcommand = String.valueOf(job.getAttributes().getOrDefault(Job.OPENCGA_SUBCOMMAND, ""));
if (subcommand.isEmpty()) {
=======
String subcommand = String.valueOf(job.getAttributes().get(Job.OPENCGA_SUBCOMMAND));
if (StringUtils.isEmpty(subcommand)) {
>>>>>>>
String subcommand = String.valueOf(job.getAttributes().get(Job.OPENCGA_SUBCOMMAND));
if (StringUtils.isEmpty(subcommand)) {
<<<<<<<
String outDirPath = String.valueOf(job.getParams().getOrDefault("outdir", ""));
if (outDirPath.isEmpty()) {
return abortJob(job, "Missing mandatory output directory");
}
if (!outDirPath.endsWith("/")) {
outDirPath += "/";
}
=======
>>>>>>>
<<<<<<<
// Directory exists
OpenCGAResult<File> fileOpenCGAResult = fileManager.get(study, outDirPath, FileManager.INCLUDE_FILE_URI_PATH, token);
updateParams.setOutDir(fileOpenCGAResult.first());
=======
outDir = fileManager.get(study, outDirPath, FileManager.INCLUDE_FILE_URI_PATH, token).first();
>>>>>>>
outDir = fileManager.get(study, outDirPath, FileManager.INCLUDE_FILE_URI_PATH, token).first();
<<<<<<<
updateParams.setCommandLine(cliBuilder.toString());
updateParams.setInput(inputFiles);
logger.info("Updating job {} from {} to {}", job.getId(), Enums.ExecutionStatus.PENDING, Enums.ExecutionStatus.QUEUED);
updateParams.setStatus(new Enums.ExecutionStatus(Enums.ExecutionStatus.QUEUED));
try {
executeJob(job.getId(), updateParams.getCommandLine(), stdout, stderr, userToken);
jobManager.update(study, job.getId(), updateParams, QueryOptions.empty(), token);
} catch (CatalogException e) {
logger.error("Could not update job {}. {}", job.getId(), e.getMessage(), e);
return 0;
}
return 1;
=======
return cliBuilder.toString();
>>>>>>>
return cliBuilder.toString();
<<<<<<<
if ("variant".equals(command) && "index".equals(subCommand)) {
=======
if ("variant".equals(command) && "index".equals(subcommand)) {
int maxIndexJobs = catalogManager.getConfiguration().getAnalysis().getIndex().getVariant().getMaxConcurrentJobs();
logger.info("TODO: Check maximum number of slots for variant index");
>>>>>>>
if ("variant".equals(command) && "index".equals(subcommand)) {
int maxIndexJobs = catalogManager.getConfiguration().getAnalysis().getIndex().getVariant().getMaxConcurrentJobs();
logger.info("TODO: Check maximum number of slots for variant index");
<<<<<<<
logger.info("{} - Aborting job...", job.getId());
return setStatus(job, new Enums.ExecutionStatus(Enums.ExecutionStatus.ABORTED, description));
=======
logger.info("Aborting job: {} - Reason: '{}'", job.getId(), description);
return setStatus(job, new Job.JobStatus(Job.JobStatus.ABORTED, description));
>>>>>>>
logger.info("Aborting job: {} - Reason: '{}'", job.getId(), description);
return setStatus(job, new Enums.ExecutionStatus(Enums.ExecutionStatus.ABORTED, description));
<<<<<<<
private Enums.ExecutionStatus getCurrentStatus(Job job) {
Path tmpOutdirPath = Paths.get(job.getTmpDir().getUri());
=======
private Job.JobStatus getCurrentStatus(Job job) {
Path resultJson = getAnalysisResultPath(job);
>>>>>>>
private Enums.ExecutionStatus getCurrentStatus(Job job) {
Path resultJson = getAnalysisResultPath(job); |
<<<<<<<
public OpenCGAResult<Long> count(final Query query, final String user, final StudyAclEntry.StudyPermissions studyPermissions)
=======
public QueryResult<Long> count(long studyUid, final Query query, final String user,
final StudyAclEntry.StudyPermissions studyPermissions)
>>>>>>>
public OpenCGAResult<Long> count(long studyUid, final Query query, final String user,
final StudyAclEntry.StudyPermissions studyPermissions)
<<<<<<<
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), query.getLong(QueryParams.STUDY_UID.key()));
OpenCGAResult queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(studyQuery, QueryOptions.empty());
=======
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), studyUid);
QueryResult queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(studyQuery, QueryOptions.empty());
>>>>>>>
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), studyUid);
OpenCGAResult queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(studyQuery, QueryOptions.empty());
<<<<<<<
return new FileMongoDBIterator<>(mongoCursor, fileConverter, null, this,
dbAdaptorFactory.getCatalogSampleDBAdaptor(), query.getLong(PRIVATE_STUDY_UID), null, options);
=======
return new FileMongoDBIterator<>(mongoCursor, fileConverter, null, this, dbAdaptorFactory.getCatalogSampleDBAdaptor(), options);
>>>>>>>
return new FileMongoDBIterator<>(mongoCursor, fileConverter, null, this, dbAdaptorFactory.getCatalogSampleDBAdaptor(), options);
<<<<<<<
return new FileMongoDBIterator<>(mongoCursor, null, null, this,
dbAdaptorFactory.getCatalogSampleDBAdaptor(), query.getLong(PRIVATE_STUDY_UID), null, queryOptions);
=======
return new FileMongoDBIterator<>(mongoCursor, null, null, this, dbAdaptorFactory.getCatalogSampleDBAdaptor(), queryOptions);
>>>>>>>
return new FileMongoDBIterator<>(mongoCursor, null, null, this, dbAdaptorFactory.getCatalogSampleDBAdaptor(), queryOptions);
<<<<<<<
return new FileMongoDBIterator<>(mongoCursor, fileConverter, iteratorFilter, this,
dbAdaptorFactory.getCatalogSampleDBAdaptor(), query.getLong(PRIVATE_STUDY_UID), user, options);
=======
return new FileMongoDBIterator<>(mongoCursor, fileConverter, iteratorFilter, this, dbAdaptorFactory.getCatalogSampleDBAdaptor(),
studyUid, user, options);
>>>>>>>
return new FileMongoDBIterator<>(mongoCursor, fileConverter, iteratorFilter, this,
dbAdaptorFactory.getCatalogSampleDBAdaptor(), studyUid, user, options);
<<<<<<<
return new FileMongoDBIterator<>(mongoCursor, null, iteratorFilter, this,
dbAdaptorFactory.getCatalogSampleDBAdaptor(), query.getLong(PRIVATE_STUDY_UID), user, options);
=======
return new FileMongoDBIterator<>(mongoCursor, null, iteratorFilter, this, dbAdaptorFactory.getCatalogSampleDBAdaptor(), studyUid,
user, options);
>>>>>>>
return new FileMongoDBIterator<>(mongoCursor, null, iteratorFilter, this,
dbAdaptorFactory.getCatalogSampleDBAdaptor(), studyUid, user, options);
<<<<<<<
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), query.getLong(QueryParams.STUDY_UID.key()));
OpenCGAResult<Document> queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(studyQuery, QueryOptions.empty());
=======
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), studyUid);
QueryResult<Document> queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(studyQuery, QueryOptions.empty());
>>>>>>>
Query studyQuery = new Query(StudyDBAdaptor.QueryParams.UID.key(), studyUid);
OpenCGAResult queryResult = dbAdaptorFactory.getCatalogStudyDBAdaptor().nativeGet(studyQuery, QueryOptions.empty()); |
<<<<<<<
import org.opencb.opencga.catalog.utils.Constants;
import org.opencb.opencga.core.models.acls.AclParams;
=======
>>>>>>>
import org.opencb.opencga.catalog.utils.Constants; |
<<<<<<<
=======
* Variables Methods
*/
@Override
public QueryResult<VariableSet> createVariableSet(int studyId, String name, Boolean unique,
String description, Map<String, Object> attributes,
List<Variable> variables, String sessionId)
throws CatalogException {
ParamUtils.checkObj(variables, "Variables List");
Set<Variable> variablesSet = new HashSet<>(variables);
if (variables.size() != variablesSet.size()) {
throw new CatalogException("Error. Repeated variables");
}
return createVariableSet(studyId, name, unique, description, attributes, variablesSet, sessionId);
}
@Override
public QueryResult<VariableSet> createVariableSet(int studyId, String name, Boolean unique,
String description, Map<String, Object> attributes,
Set<Variable> variables, String sessionId)
throws CatalogException {
String userId = userDBAdaptor.getUserIdBySessionId(sessionId);
ParamUtils.checkParameter(sessionId, "sessionId");
ParamUtils.checkParameter(name, "name");
ParamUtils.checkObj(variables, "Variables Set");
unique = ParamUtils.defaultObject(unique, true);
description = ParamUtils.defaultString(description, "");
attributes = ParamUtils.defaultObject(attributes, new HashMap<String, Object>());
for (Variable variable : variables) {
ParamUtils.checkParameter(variable.getId(), "variable ID");
ParamUtils.checkObj(variable.getType(), "variable Type");
variable.setAllowedValues(ParamUtils.defaultObject(variable.getAllowedValues(), Collections.<String>emptyList()));
variable.setAttributes(ParamUtils.defaultObject(variable.getAttributes(), Collections.<String, Object>emptyMap()));
variable.setCategory(ParamUtils.defaultString(variable.getCategory(), ""));
variable.setDependsOn(ParamUtils.defaultString(variable.getDependsOn(), ""));
variable.setDescription(ParamUtils.defaultString(variable.getDescription(), ""));
// variable.setRank(defaultString(variable.getDescription(), ""));
}
authorizationManager.checkStudyPermission(studyId, userId, StudyPermission.MANAGE_SAMPLES);
VariableSet variableSet = new VariableSet(-1, name, unique, description, variables, attributes);
CatalogAnnotationsValidator.checkVariableSet(variableSet);
QueryResult<VariableSet> queryResult = sampleDBAdaptor.createVariableSet(studyId, variableSet);
auditManager.recordCreation(AuditRecord.Resource.variableSet, queryResult.first().getId(), userId, queryResult.first(), null, null);
return queryResult;
}
@Override
public QueryResult<VariableSet> readVariableSet(int variableSet, QueryOptions options, String sessionId) throws CatalogException {
String userId = userDBAdaptor.getUserIdBySessionId(sessionId);
int studyId = sampleDBAdaptor.getStudyIdByVariableSetId(variableSet);
authorizationManager.checkStudyPermission(studyId, userId, StudyPermission.READ_STUDY);
return sampleDBAdaptor.getVariableSet(variableSet, options);
}
@Override
public QueryResult<VariableSet> readAllVariableSets(int studyId, QueryOptions options, String sessionId) throws CatalogException {
String userId = userDBAdaptor.getUserIdBySessionId(sessionId);
authorizationManager.checkStudyPermission(studyId, userId, StudyPermission.READ_STUDY);
return sampleDBAdaptor.getAllVariableSets(studyId, options);
}
@Override
public QueryResult<VariableSet> deleteVariableSet(int variableSetId, QueryOptions queryOptions, String sessionId) throws CatalogException {
String userId = userDBAdaptor.getUserIdBySessionId(sessionId);
int studyId = sampleDBAdaptor.getStudyIdByVariableSetId(variableSetId);
authorizationManager.checkStudyPermission(studyId, userId, StudyPermission.MANAGE_SAMPLES);
QueryResult<VariableSet> queryResult = sampleDBAdaptor.deleteVariableSet(variableSetId, queryOptions);
auditManager.recordDeletion(AuditRecord.Resource.variableSet, variableSetId, userId, queryResult.first(), null, null);
return queryResult;
}
/*
>>>>>>> |
<<<<<<<
=======
import java.util.concurrent.atomic.AtomicBoolean;
>>>>>>>
import java.util.concurrent.atomic.AtomicBoolean;
import org.opencb.biodata.formats.io.FileFormatException;
<<<<<<<
import org.opencb.opencga.storage.core.variant.FileStudyConfigurationManager;
import org.opencb.opencga.storage.core.variant.StudyConfigurationManager;
=======
>>>>>>>
import org.opencb.opencga.storage.core.variant.FileStudyConfigurationManager;
import org.opencb.opencga.storage.core.variant.StudyConfigurationManager;
<<<<<<<
MongoCredentials getMongoCredentials() {
return getMongoCredentials(null);
}
MongoCredentials getMongoCredentials(String dbName) {
String host = properties.getProperty(OPENCGA_STORAGE_MONGODB_VARIANT_DB_HOST, "localhost");
int port = Integer.parseInt(properties.getProperty(OPENCGA_STORAGE_MONGODB_VARIANT_DB_PORT, "27017"));
=======
private MongoCredentials getMongoCredentials(String dbName) {
String hosts = properties.getProperty(OPENCGA_STORAGE_MONGODB_VARIANT_DB_HOSTS, "localhost");
List<DataStoreServerAddress> dataStoreServerAddresses = MongoCredentials.parseDataStoreServerAddresses(hosts);
// int port = Integer.parseInt(properties.getProperty(OPENCGA_STORAGE_MONGODB_VARIANT_DB_PORT, "27017"));
>>>>>>>
/* package */ MongoCredentials getMongoCredentials() {
return getMongoCredentials(null);
}
/* package */ MongoCredentials getMongoCredentials(String dbName) {
String hosts = properties.getProperty(OPENCGA_STORAGE_MONGODB_VARIANT_DB_HOSTS, "localhost");
List<DataStoreServerAddress> dataStoreServerAddresses = MongoCredentials.parseDataStoreServerAddresses(hosts);
// int port = Integer.parseInt(properties.getProperty(OPENCGA_STORAGE_MONGODB_VARIANT_DB_PORT, "27017"));
<<<<<<<
variantDBWriter.setVariantSource(source);
// variantDBWriter.setSamplesIds(samplesIds);
=======
variantDBWriter.setSamplesIds(samplesIds);
variantDBWriter.setThreadSyncronizationBoolean(atomicBoolean);
>>>>>>>
variantDBWriter.setVariantSource(source);
// variantDBWriter.setSamplesIds(samplesIds);
variantDBWriter.setThreadSyncronizationBoolean(atomicBoolean); |
<<<<<<<
import com.beust.jcommander.ParameterDescription;
import com.beust.jcommander.ParameterException;
=======
>>>>>>>
import com.beust.jcommander.ParameterDescription;
<<<<<<<
public void parse(String[] args) throws ParameterException {
jCommander.parse(args);
}
public String getCommand() {
return (jCommander.getParsedCommand() != null) ? jCommander.getParsedCommand() : "";
}
public String getSubCommand() {
String parsedCommand = jCommander.getParsedCommand();
if (jCommander.getCommands().containsKey(parsedCommand)) {
String subCommand = jCommander.getCommands().get(parsedCommand).getParsedCommand();
return subCommand != null ? subCommand : "";
} else {
return null;
}
}
=======
@Override
>>>>>>>
@Override
<<<<<<<
private void printCommands(JCommander commander) {
for (Map.Entry<String, JCommander> entry : commander.getCommands().entrySet()) {
System.err.printf("%14s %s\n", entry.getKey(), commander.getCommandDescription(entry.getKey()));
}
}
/*
* creating the following strings from the jCommander to create AutoComplete bash script
* commands="users projects studies files jobs individuals families samples variables cohorts alignments variant"
* users="create info update change-password delete projects login logout reset-password"
* .....
* users_create_options="--password --no-header --help --log-file --email --name --user --log-level --conf --metadata --verbose --organization --output-format --session-id"
* ...
* */
public void generateBashAutoComplete(String fileName, String bashFunctionName) throws IOException {
Map<String, JCommander> jCommands = jCommander.getCommands();
StringBuilder mainCommands = new StringBuilder();
StringBuilder subCommmands = new StringBuilder();
StringBuilder subCommmandsOptions = new StringBuilder();
for (String command : jCommands.keySet()) {
JCommander subCommand = jCommands.get(command);
mainCommands.append(command).append(" ");
subCommmands.append(command + "=" + "\"");
Map<String, JCommander> subSubCommands = subCommand.getCommands();
for (String sc : subSubCommands.keySet()) {
subCommmands.append(sc).append(" ");
subCommmandsOptions.append(command + "_");
// - is not allowed in bash main variable name, replacing it with _
subCommmandsOptions.append(sc.replace("-", "_") + "_" + "options=" + "\"");
JCommander subCommandOptions = subSubCommands.get(sc);
for (ParameterDescription param : subCommandOptions.getParameters()) {
if ("-D".equals(param.getLongestName())) {
continue; // -D excluded in autocomplete
}
subCommmandsOptions.append(param.getLongestName()).append(' ');
}
subCommmandsOptions.replace(0, subCommmandsOptions.length(), subCommmandsOptions.toString().trim()).append("\"" + "\n");
}
subCommmands.replace(0, subCommmands.length(), subCommmands.toString().trim()).append("\"" + "\n");
}
// Commands(Commands, subCommands and subCommandOptions) are populated intro three strings until this point,
// Now we write bash script commands and blend these strings into those as appropriate
StringBuilder autoComplete = new StringBuilder();
autoComplete.append("_" + bashFunctionName + "() \n { \n local cur prev opts \n COMPREPLY=() \n cur=" +
"$" + "{COMP_WORDS[COMP_CWORD]} \n prev=" + "$" +
"{COMP_WORDS[COMP_CWORD-1]} \n");
autoComplete.append("commands=\"").append(mainCommands.toString().trim()).append('"').append('\n');
autoComplete.append(subCommmands.toString());
autoComplete.append(subCommmandsOptions.toString());
autoComplete.append("if [[ ${#COMP_WORDS[@]} > 2 && ${#COMP_WORDS[@]} < 4 ]] ; then \n local options \n case " +
"$" + "{prev} in \n");
for (String command : mainCommands.toString().split(" ")) {
autoComplete.append("\t" + command + ") options=" + "\"" + "${" + command + "}" + "\"" + " ;; \n");
}
autoComplete.append("*) ;; \n esac \n COMPREPLY=( $( compgen -W " + "\"" + "$" + "options" + "\"" +
" -- ${cur}) ) \n return 0 \n elif [[ ${#COMP_WORDS[@]} > 3 ]] ; then \n local options \n case " + "$" +
"{COMP_WORDS[1]} in \n");
int subCommandIndex = 0;
for (String command : mainCommands.toString().split(" ")) {
autoComplete.append('\t').append(command).append(") \n");
autoComplete.append("\t\t case " + "$" + "{COMP_WORDS[2]} in \n");
String[] splittedSubCommands = subCommmands.toString().split("\n")[subCommandIndex]
.replace(command + "=" + "\"", "").replace("\"", "").split(" ");
for (String subCommand : splittedSubCommands) {
autoComplete.append("\t\t").append(subCommand).append(") options=").append("\"").append("${").
append(command).append("_").append(subCommand.replace("-", "_")).append("_options}").
append("\"").append(" ;; \n");
}
autoComplete.append("\t\t *) ;; esac ;; \n");
++subCommandIndex;
}
autoComplete.append("*) ;; esac \n COMPREPLY=( $( compgen -W " + "\"" + "$" + "options" + "\"" + " -- ${cur}) )" +
" \n return 0 \n fi \n if [[ ${cur} == * ]] ; then \n COMPREPLY=( $(compgen -W " + "\"" + "$" +
"{commands}" + "\"" + " -- ${cur}) ) \n return 0 \n fi \n } \n");
autoComplete.append("\ncomplete -F _opencga opencga.sh \n");
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));
writer.write(autoComplete.toString());
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public GeneralCliOptions.GeneralOptions getGeneralOptions() {
return generalOptions;
}
=======
>>>>>>>
/*
* creating the following strings from the jCommander to create AutoComplete bash script
* commands="users projects studies files jobs individuals families samples variables cohorts alignments variant"
* users="create info update change-password delete projects login logout reset-password"
* .....
* users_create_options="--password --no-header --help --log-file --email --name --user --log-level --conf --metadata --verbose --organization --output-format --session-id"
* ...
* */
public void generateBashAutoComplete(String fileName, String bashFunctionName) throws IOException {
Map<String, JCommander> jCommands = jCommander.getCommands();
StringBuilder mainCommands = new StringBuilder();
StringBuilder subCommmands = new StringBuilder();
StringBuilder subCommmandsOptions = new StringBuilder();
for (String command : jCommands.keySet()) {
JCommander subCommand = jCommands.get(command);
mainCommands.append(command).append(" ");
subCommmands.append(command + "=" + "\"");
Map<String, JCommander> subSubCommands = subCommand.getCommands();
for (String sc : subSubCommands.keySet()) {
subCommmands.append(sc).append(" ");
subCommmandsOptions.append(command + "_");
// - is not allowed in bash main variable name, replacing it with _
subCommmandsOptions.append(sc.replace("-", "_") + "_" + "options=" + "\"");
JCommander subCommandOptions = subSubCommands.get(sc);
for (ParameterDescription param : subCommandOptions.getParameters()) {
if ("-D".equals(param.getLongestName())) {
continue; // -D excluded in autocomplete
}
subCommmandsOptions.append(param.getLongestName()).append(' ');
}
subCommmandsOptions.replace(0, subCommmandsOptions.length(), subCommmandsOptions.toString().trim()).append("\"" + "\n");
}
subCommmands.replace(0, subCommmands.length(), subCommmands.toString().trim()).append("\"" + "\n");
}
// Commands(Commands, subCommands and subCommandOptions) are populated intro three strings until this point,
// Now we write bash script commands and blend these strings into those as appropriate
StringBuilder autoComplete = new StringBuilder();
autoComplete.append("_" + bashFunctionName + "() \n { \n local cur prev opts \n COMPREPLY=() \n cur=" +
"$" + "{COMP_WORDS[COMP_CWORD]} \n prev=" + "$" +
"{COMP_WORDS[COMP_CWORD-1]} \n");
autoComplete.append("commands=\"").append(mainCommands.toString().trim()).append('"').append('\n');
autoComplete.append(subCommmands.toString());
autoComplete.append(subCommmandsOptions.toString());
autoComplete.append("if [[ ${#COMP_WORDS[@]} > 2 && ${#COMP_WORDS[@]} < 4 ]] ; then \n local options \n case " +
"$" + "{prev} in \n");
for (String command : mainCommands.toString().split(" ")) {
autoComplete.append("\t" + command + ") options=" + "\"" + "${" + command + "}" + "\"" + " ;; \n");
}
autoComplete.append("*) ;; \n esac \n COMPREPLY=( $( compgen -W " + "\"" + "$" + "options" + "\"" +
" -- ${cur}) ) \n return 0 \n elif [[ ${#COMP_WORDS[@]} > 3 ]] ; then \n local options \n case " + "$" +
"{COMP_WORDS[1]} in \n");
int subCommandIndex = 0;
for (String command : mainCommands.toString().split(" ")) {
autoComplete.append('\t').append(command).append(") \n");
autoComplete.append("\t\t case " + "$" + "{COMP_WORDS[2]} in \n");
String[] splittedSubCommands = subCommmands.toString().split("\n")[subCommandIndex]
.replace(command + "=" + "\"", "").replace("\"", "").split(" ");
for (String subCommand : splittedSubCommands) {
autoComplete.append("\t\t").append(subCommand).append(") options=").append("\"").append("${").
append(command).append("_").append(subCommand.replace("-", "_")).append("_options}").
append("\"").append(" ;; \n");
}
autoComplete.append("\t\t *) ;; esac ;; \n");
++subCommandIndex;
}
autoComplete.append("*) ;; esac \n COMPREPLY=( $( compgen -W " + "\"" + "$" + "options" + "\"" + " -- ${cur}) )" +
" \n return 0 \n fi \n if [[ ${cur} == * ]] ; then \n COMPREPLY=( $(compgen -W " + "\"" + "$" +
"{commands}" + "\"" + " -- ${cur}) ) \n return 0 \n fi \n } \n");
autoComplete.append("\ncomplete -F _opencga opencga.sh \n");
try {
BufferedWriter writer = new BufferedWriter(new FileWriter(fileName));
writer.write(autoComplete.toString());
writer.close();
} catch (IOException e) {
e.printStackTrace();
}
}
public GeneralCliOptions.GeneralOptions getGeneralOptions() {
return generalOptions;
} |
<<<<<<<
import org.opencb.opencga.core.tools.result.ExecutionResultManager;
import org.opencb.opencga.core.tools.result.ExecutionResult;
import org.opencb.opencga.core.tools.result.Status;
=======
>>>>>>> |
<<<<<<<
@ApiOperation(value = "Update some sample attributes", position = 6)
public Response updateByPost(
@ApiParam(value = "sampleId", required = true) @PathParam("sample") String sampleStr,
@ApiParam(value = "Study [[user@]project:]study where study and project can be either the id or alias")
@QueryParam("study") String studyStr,
@ApiParam(value = "Create a new version of sample", defaultValue = "false")
@QueryParam(Constants.INCREMENT_VERSION) boolean incVersion,
@ApiParam(value = "Delete a specific annotation set. AnnotationSetName expected.")
@QueryParam(Constants.DELETE_ANNOTATION_SET) String deleteAnnotationSet,
@ApiParam(value = "Delete a specific annotation. Format: Comma separated list of annotationSetName:variable")
@QueryParam(Constants.DELETE_ANNOTATION) String deleteAnnotation,
@ApiParam(value = "params") UpdateSamplePOST parameters) {
=======
@ApiOperation(value = "Update some sample attributes", position = 6,
notes = "The entire sample is returned after the modification. Using include/exclude query parameters is encouraged to "
+ "avoid slowdowns when sending unnecessary information where possible")
@ApiImplicitParams({
@ApiImplicitParam(name = "include", value = "Fields included in the response, whole JSON path must be provided",
example = "name,attributes", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "exclude", value = "Fields excluded in the response, whole JSON path must be provided", example = "id,status", dataType = "string", paramType = "query")
})
public Response updateByPost(@ApiParam(value = "sampleId", required = true) @PathParam("sample") String sampleStr,
@ApiParam(value = "Study [[user@]project:]study where study and project can be either the id or alias")
@QueryParam("study") String studyStr,
@ApiParam(value = "Create a new version of sample", defaultValue = "false")
@QueryParam(Constants.INCREMENT_VERSION) boolean incVersion,
@ApiParam(value = "params", required = true) UpdateSamplePOST parameters) {
>>>>>>>
@ApiOperation(value = "Update some sample attributes", position = 6,
notes = "The entire sample is returned after the modification. Using include/exclude query parameters is encouraged to "
+ "avoid slowdowns when sending unnecessary information where possible")
@ApiImplicitParams({
@ApiImplicitParam(name = "include", value = "Fields included in the response, whole JSON path must be provided",
example = "name,attributes", dataType = "string", paramType = "query"),
@ApiImplicitParam(name = "exclude", value = "Fields excluded in the response, whole JSON path must be provided", example = "id,status", dataType = "string", paramType = "query")
})
public Response updateByPost(
@ApiParam(value = "sampleId", required = true) @PathParam("sample") String sampleStr,
@ApiParam(value = "Study [[user@]project:]study where study and project can be either the id or alias")
@QueryParam("study") String studyStr,
@ApiParam(value = "Create a new version of sample", defaultValue = "false")
@QueryParam(Constants.INCREMENT_VERSION) boolean incVersion,
@ApiParam(value = "Delete a specific annotation set. AnnotationSetName expected.")
@QueryParam(Constants.DELETE_ANNOTATION_SET) String deleteAnnotationSet,
@ApiParam(value = "Delete a specific annotation. Format: Comma separated list of annotationSetName:variable")
@QueryParam(Constants.DELETE_ANNOTATION) String deleteAnnotation,
@ApiParam(value = "params") UpdateSamplePOST parameters) { |
<<<<<<<
public void execute(String jobId, String commandLine, Path stdout, Path stderr, String token) throws Exception {
jobStatus.put(jobId, Enums.ExecutionStatus.QUEUED);
=======
public void execute(String jobId, String commandLine, Path stdout, Path stderr) throws Exception {
jobStatus.put(jobId, Job.JobStatus.QUEUED);
>>>>>>>
public void execute(String jobId, String commandLine, Path stdout, Path stderr) throws Exception {
jobStatus.put(jobId, Enums.ExecutionStatus.QUEUED);
<<<<<<<
Thread.currentThread().setName("LocalExecutor-" + nextThreadNum());
logger.info("Ready to run - {}", commandLine);
jobStatus.put(jobId, Enums.ExecutionStatus.RUNNING);
Command com = new Command(getCommandLine(commandLine, stdout, stderr));
Thread hook = new Thread(() -> {
logger.info("Running ShutdownHook. Job {id: " + jobId + "} has being aborted.");
com.setStatus(RunnableProcess.Status.KILLED);
com.setExitValue(-2);
closeOutputStreams(com);
jobStatus.put(jobId, Enums.ExecutionStatus.ERROR);
});
logger.info("==========================================");
logger.info("Executing job {}", jobId);
logger.debug("Executing commandLine {}", commandLine);
logger.info("==========================================");
System.err.println();
Runtime.getRuntime().addShutdownHook(hook);
com.run();
Runtime.getRuntime().removeShutdownHook(hook);
System.err.println();
logger.info("==========================================");
logger.info("Finished job {}", jobId);
logger.info("==========================================");
closeOutputStreams(com);
if (com.getStatus().equals(RunnableProcess.Status.DONE)) {
jobStatus.put(jobId, Enums.ExecutionStatus.DONE);
} else {
jobStatus.put(jobId, Enums.ExecutionStatus.ERROR);
=======
===================================");
logger.info("Executing job {}", jobId);
logger.debug("Executing commandLine {}", commandLine);
logger.info("==========================================");
System.err.println();
Runtime.getRuntime().addShutdownHook(hook);
com.run();
Runtime.getRuntime().removeShutdownHook(hook);
System.err.println();
logger.info("==========================================");
logger.info("Finished job {}", jobId);
logger.info("==========================================");
closeOutputStreams(com);
if (com.getStatus().equals(RunnableProcess.Status.DONE)) {
jobStatus.put(jobId, Job.JobStatus.DONE);
} else {
jobStatus.put(jobId, Job.JobStatus.ERROR);
=======
try {
Thread.currentThread().setName("LocalExecutor-" + nextThreadNum());
logger.info("Ready to run - {}", commandLine);
jobStatus.put(jobId, Job.JobStatus.RUNNING);
Command com = new Command(commandLine);
DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(stdout.toFile()));
com.setOutputOutputStream(dataOutputStream);
dataOutputStream = new DataOutputStream(new FileOutputStream(stderr.toFile()));
com.setErrorOutputStream(dataOutputStream);
Thread hook = new Thread(() -> {
logger.info("Running ShutdownHook. Job {id: " + jobId + "} has being aborted.");
com.setStatus(RunnableProcess.Status.KILLED);
com.setExitValue(-2);
closeOutputStreams(com);
jobStatus.put(jobId, Job.JobStatus.ERROR);
});
logger.info("==========================================");
logger.info("Executing job {}", jobId);
logger.debug("Executing commandLine {}", commandLine);
logger.info("==========================================");
System.err.println();
try {
Runtime.getRuntime().addShutdownHook(hook);
com.run();
} finally {
Runtime.getRuntime().removeShutdownHook(hook);
closeOutputStreams(com);
}
System.err.println();
logger.info("==========================================");
logger.info("Finished job {}", jobId);
logger.info("==========================================");
if (com.getStatus().equals(RunnableProcess.Status.DONE)) {
jobStatus.put(jobId, Job.JobStatus.DONE);
} else {
jobStatus.put(jobId, Job.JobStatus.ERROR);
}
} catch (Throwable throwable) {
logger.error("Error running job " + jobId, throwable);
jobStatus.put(jobId, Job.JobStatus.ERROR);
>>>>>>>
try {
Thread.currentThread().setName("LocalExecutor-" + nextThreadNum());
logger.info("Ready to run - {}", commandLine);
jobStatus.put(jobId, Enums.ExecutionStatus.RUNNING);
Command com = new Command(commandLine);
DataOutputStream dataOutputStream = new DataOutputStream(new FileOutputStream(stdout.toFile()));
com.setOutputOutputStream(dataOutputStream);
dataOutputStream = new DataOutputStream(new FileOutputStream(stderr.toFile()));
com.setErrorOutputStream(dataOutputStream);
Thread hook = new Thread(() -> {
logger.info("Running ShutdownHook. Job {id: " + jobId + "} has being aborted.");
com.setStatus(RunnableProcess.Status.KILLED);
com.setExitValue(-2);
closeOutputStreams(com);
jobStatus.put(jobId, Enums.ExecutionStatus.ERROR);
});
logger.info("==========================================");
logger.info("Executing job {}", jobId);
logger.debug("Executing commandLine {}", commandLine);
logger.info("==========================================");
System.err.println();
try {
Runtime.getRuntime().addShutdownHook(hook);
com.run();
} finally {
Runtime.getRuntime().removeShutdownHook(hook);
closeOutputStreams(com);
}
System.err.println();
logger.info("==========================================");
logger.info("Finished job {}", jobId);
logger.info("==========================================");
if (com.getStatus().equals(RunnableProcess.Status.DONE)) {
jobStatus.put(jobId, Enums.ExecutionStatus.DONE);
} else {
jobStatus.put(jobId, Enums.ExecutionStatus.ERROR);
}
} catch (Throwable throwable) {
logger.error("Error running job " + jobId, throwable);
jobStatus.put(jobId, Enums.ExecutionStatus.ERROR); |
<<<<<<<
SampleIndexQuery sampleIndexQuery = SampleIndexQueryParser.parseSampleIndexQuery(query, scm);
studyConfiguration = scm.getStudyConfiguration(sampleIndexQuery.getStudy(), null).first();
=======
SampleIndexQuery sampleIndexQuery = SampleIndexQuery.extractSampleIndexQuery(query, metadataManager);
studyMetadata = metadataManager.getStudyMetadata(sampleIndexQuery.getStudy());
>>>>>>>
SampleIndexQuery sampleIndexQuery = SampleIndexQueryParser.parseSampleIndexQuery(query, metadataManager);
studyMetadata = metadataManager.getStudyMetadata(sampleIndexQuery.getStudy());
<<<<<<<
SampleIndexQuery query = new SampleIndexQuery(regions, studyConfiguration.getStudyName(), samples, (byte) 0, operation);
iterator = sampleIndexDBAdaptor.iterator(query);
=======
iterator = sampleIndexDBAdaptor.iterator(regions, studyMetadata.getName(), samples, operation);
>>>>>>>
SampleIndexQuery query = new SampleIndexQuery(regions, studyMetadata.getStudyName(), samples, (byte) 0, operation);
iterator = sampleIndexDBAdaptor.iterator(query); |
<<<<<<<
public boolean canStabaliseInfusion(World world, BlockPos pos) {
return true;
=======
public boolean canStabaliseInfusion(World world, int x, int y, int z) {
return ConfigHandler.enableThaumcraftStablizers;
>>>>>>>
public boolean canStabaliseInfusion(World world, BlockPos pos) {
return ConfigHandler.enableThaumcraftStablizers; |
<<<<<<<
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.state.EnumProperty;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.registry.RegistryNamespaced;
import net.minecraft.util.registry.RegistryNamespacedDefaultedByKey;
=======
>>>>>>>
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.state.EnumProperty;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent;
import net.minecraft.util.registry.RegistryNamespaced;
import net.minecraft.util.registry.RegistryNamespacedDefaultedByKey;
<<<<<<<
// TODO 1.13 move these to eliminate dependence on botania proper in Ingredients
private static final int[] MAX_DAMAGE_ARRAY = new int[]{13, 15, 16, 11};
public static final IArmorMaterial MANASTEEL_ARMOR_MAT = new IArmorMaterial() {
private final int[] damageReduction = { 2, 5, 6, 2 };
@Override
public int getDurability(EntityEquipmentSlot slotIn) {
return 16 * MAX_DAMAGE_ARRAY[slotIn.getIndex()];
}
@Override
public int getDamageReductionAmount(EntityEquipmentSlot slotIn) {
return damageReduction[slotIn.getIndex()];
}
@Override
public int getEnchantability() {
return 18;
}
@Override
public SoundEvent getSoundEvent() {
return SoundEvents.ITEM_ARMOR_EQUIP_IRON;
}
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.manaSteel);
}
@Override
public String getName() {
return "manasteel";
}
@Override
public float getToughness() {
return 0;
}
};
public static final IItemTier MANASTEEL_ITEM_TIER = new IItemTier() {
@Override
public int getMaxUses() {
return 300;
}
@Override
public float getEfficiency() {
return 6.2F;
}
@Override
public float getAttackDamage() {
return 2;
}
@Override
public int getHarvestLevel() {
return 3;
}
@Override
public int getEnchantability() {
return 20;
}
@Nonnull
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.manaSteel);
}
};
public static final IArmorMaterial ELEMENTIUM_ARMOR_MAT = new IArmorMaterial() {
private final int[] damageReduction = { 2, 5, 6, 2 };
@Override
public int getDurability(EntityEquipmentSlot slotIn) {
return 18 * MAX_DAMAGE_ARRAY[slotIn.getIndex()];
}
@Override
public int getDamageReductionAmount(EntityEquipmentSlot slotIn) {
return damageReduction[slotIn.getIndex()];
}
@Override
public int getEnchantability() {
return 18;
}
@Override
public SoundEvent getSoundEvent() {
return SoundEvents.ITEM_ARMOR_EQUIP_IRON;
}
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.elementium);
}
@Override
public String getName() {
return "elementium";
}
@Override
public float getToughness() {
return 0;
}
};
public static final IItemTier ELEMENTIUM_ITEM_TIER = new IItemTier() {
@Override
public int getMaxUses() {
return 720;
}
@Override
public float getEfficiency() {
return 6.2F;
}
@Override
public float getAttackDamage() {
return 2;
}
@Override
public int getHarvestLevel() {
return 3;
}
@Override
public int getEnchantability() {
return 20;
}
@Nonnull
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.elementium);
}
};
public static final IArmorMaterial TERRASTEEL_ARMOR_MAT = new IArmorMaterial() {
private final int[] damageReduction = { 3, 6, 8, 3 };
@Override
public int getDurability(EntityEquipmentSlot slotIn) {
return 34 * MAX_DAMAGE_ARRAY[slotIn.getIndex()];
}
@Override
public int getDamageReductionAmount(EntityEquipmentSlot slotIn) {
return damageReduction[slotIn.getIndex()];
}
@Override
public int getEnchantability() {
return 26;
}
@Override
public SoundEvent getSoundEvent() {
return SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND;
}
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.terrasteel);
}
@Override
public String getName() {
return "terrasteel";
}
@Override
public float getToughness() {
return 3;
}
};
public static final IItemTier TERRASTEEL_ITEM_TIER = new IItemTier() {
@Override
public int getMaxUses() {
return 2300;
}
@Override
public float getEfficiency() {
return 9;
}
@Override
public float getAttackDamage() {
return 3;
}
@Override
public int getHarvestLevel() {
return 4;
}
@Override
public int getEnchantability() {
return 26;
}
@Nonnull
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.terrasteel);
}
};
public static final IArmorMaterial MANAWEAVE_ARMOR_MAT = new IArmorMaterial() {
private final int[] damageReduction = { 1, 2, 2, 1 };
@Override
public int getDurability(EntityEquipmentSlot slotIn) {
return 5 * MAX_DAMAGE_ARRAY[slotIn.getIndex()];
}
=======
public static final Set<Block> gaiaBreakBlacklist = new HashSet<>();
public static final ArmorMaterial manasteelArmorMaterial = EnumHelper.addArmorMaterial("MANASTEEL", "manasteel", 16,
new int[] { 2, 5, 6, 2 }, 18, SoundEvents.ITEM_ARMOR_EQUIP_IRON, 0);
public static final ToolMaterial manasteelToolMaterial = EnumHelper.addToolMaterial("MANASTEEL", 3, 300, 6.2F, 2F, 20);
>>>>>>>
public static final Set<Block> gaiaBreakBlacklist = new HashSet<>();
// TODO 1.13 move these to eliminate dependence on botania proper in Ingredients
private static final int[] MAX_DAMAGE_ARRAY = new int[]{13, 15, 16, 11};
public static final IArmorMaterial MANASTEEL_ARMOR_MAT = new IArmorMaterial() {
private final int[] damageReduction = { 2, 5, 6, 2 };
@Override
public int getDurability(EntityEquipmentSlot slotIn) {
return 16 * MAX_DAMAGE_ARRAY[slotIn.getIndex()];
}
@Override
public int getDamageReductionAmount(EntityEquipmentSlot slotIn) {
return damageReduction[slotIn.getIndex()];
}
@Override
public int getEnchantability() {
return 18;
}
@Override
public SoundEvent getSoundEvent() {
return SoundEvents.ITEM_ARMOR_EQUIP_IRON;
}
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.manaSteel);
}
@Override
public String getName() {
return "manasteel";
}
@Override
public float getToughness() {
return 0;
}
};
public static final IItemTier MANASTEEL_ITEM_TIER = new IItemTier() {
@Override
public int getMaxUses() {
return 300;
}
@Override
public float getEfficiency() {
return 6.2F;
}
@Override
public float getAttackDamage() {
return 2;
}
@Override
public int getHarvestLevel() {
return 3;
}
@Override
public int getEnchantability() {
return 20;
}
@Nonnull
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.manaSteel);
}
};
public static final IArmorMaterial ELEMENTIUM_ARMOR_MAT = new IArmorMaterial() {
private final int[] damageReduction = { 2, 5, 6, 2 };
@Override
public int getDurability(EntityEquipmentSlot slotIn) {
return 18 * MAX_DAMAGE_ARRAY[slotIn.getIndex()];
}
@Override
public int getDamageReductionAmount(EntityEquipmentSlot slotIn) {
return damageReduction[slotIn.getIndex()];
}
@Override
public int getEnchantability() {
return 18;
}
@Override
public SoundEvent getSoundEvent() {
return SoundEvents.ITEM_ARMOR_EQUIP_IRON;
}
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.elementium);
}
@Override
public String getName() {
return "elementium";
}
@Override
public float getToughness() {
return 0;
}
};
public static final IItemTier ELEMENTIUM_ITEM_TIER = new IItemTier() {
@Override
public int getMaxUses() {
return 720;
}
@Override
public float getEfficiency() {
return 6.2F;
}
@Override
public float getAttackDamage() {
return 2;
}
@Override
public int getHarvestLevel() {
return 3;
}
@Override
public int getEnchantability() {
return 20;
}
@Nonnull
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.elementium);
}
};
public static final IArmorMaterial TERRASTEEL_ARMOR_MAT = new IArmorMaterial() {
private final int[] damageReduction = { 3, 6, 8, 3 };
@Override
public int getDurability(EntityEquipmentSlot slotIn) {
return 34 * MAX_DAMAGE_ARRAY[slotIn.getIndex()];
}
@Override
public int getDamageReductionAmount(EntityEquipmentSlot slotIn) {
return damageReduction[slotIn.getIndex()];
}
@Override
public int getEnchantability() {
return 26;
}
@Override
public SoundEvent getSoundEvent() {
return SoundEvents.ITEM_ARMOR_EQUIP_DIAMOND;
}
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.terrasteel);
}
@Override
public String getName() {
return "terrasteel";
}
@Override
public float getToughness() {
return 3;
}
};
public static final IItemTier TERRASTEEL_ITEM_TIER = new IItemTier() {
@Override
public int getMaxUses() {
return 2300;
}
@Override
public float getEfficiency() {
return 9;
}
@Override
public float getAttackDamage() {
return 3;
}
@Override
public int getHarvestLevel() {
return 4;
}
@Override
public int getEnchantability() {
return 26;
}
@Nonnull
@Override
public Ingredient getRepairMaterial() {
return Ingredient.fromItems(ModItems.terrasteel);
}
};
public static final IArmorMaterial MANAWEAVE_ARMOR_MAT = new IArmorMaterial() {
private final int[] damageReduction = { 1, 2, 2, 1 };
@Override
public int getDurability(EntityEquipmentSlot slotIn) {
return 5 * MAX_DAMAGE_ARRAY[slotIn.getIndex()];
}
<<<<<<<
=======
registerDisposableBlock("dirt"); // Vanilla
registerDisposableBlock("sand"); // Vanilla
registerDisposableBlock("gravel"); // Vanilla
registerDisposableBlock("cobblestone"); // Vanilla
registerDisposableBlock("netherrack"); // Vanilla
registerSemiDisposableBlock("stoneAndesite"); // Vanilla
registerSemiDisposableBlock("stoneBasalt"); // Vanilla
registerSemiDisposableBlock("stoneDiorite"); // Vanilla
registerSemiDisposableBlock("stoneGranite"); // Vanilla
blacklistBlockFromGaiaGuardian(Blocks.BEACON);
>>>>>>>
blacklistBlockFromGaiaGuardian(Blocks.BEACON);
<<<<<<<
=======
private static String getMagnetKey(ItemStack stack) {
if(stack.isEmpty())
return "";
return "i_" + stack.getItem().getTranslationKey() + "@" + stack.getItemDamage();
}
private static String getMagnetKey(Block block, int meta) {
return "bm_" + block.getTranslationKey() + "@" + meta;
}
public static void blacklistBlockFromGaiaGuardian(Block block) {
gaiaBreakBlacklist.add(block);
}
>>>>>>>
public static void blacklistBlockFromGaiaGuardian(Block block) {
gaiaBreakBlacklist.add(block);
} |
<<<<<<<
import vazkii.botania.common.fixers.AttachedWills;
import vazkii.botania.common.fixers.CraftyCrateTE;
import vazkii.botania.common.fixers.FlattenItems;
import vazkii.botania.common.fixers.FlattenNBT;
=======
import vazkii.botania.common.integration.buildcraft.StatementAPIPlugin;
import vazkii.botania.common.integration.thaumcraft.TCAspects;
>>>>>>>
import vazkii.botania.common.fixers.AttachedWills;
import vazkii.botania.common.fixers.CraftyCrateTE;
import vazkii.botania.common.fixers.FlattenItems;
import vazkii.botania.common.fixers.FlattenNBT;
import vazkii.botania.common.integration.buildcraft.StatementAPIPlugin;
import vazkii.botania.common.integration.thaumcraft.TCAspects; |
<<<<<<<
GlStateManager.pushMatrix();
GlStateManager.disableDepth();
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
=======
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_BLEND);
>>>>>>>
GlStateManager.pushMatrix();
GL11.glPushAttrib(GL11.GL_LIGHTING);
GlStateManager.disableDepth();
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
<<<<<<<
GlStateManager.enableDepth();
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
GlStateManager.popMatrix();
=======
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopAttrib();
GL11.glPopMatrix();
>>>>>>>
GlStateManager.enableDepth();
GlStateManager.enableTexture2D();
GlStateManager.disableBlend();
GL11.glPopAttrib();
GlStateManager.popMatrix(); |
<<<<<<<
import com.fasterxml.jackson.databind.util.LookupCache;
import com.fasterxml.jackson.databind.util.SimpleLookupCache;
=======
>>>>>>>
<<<<<<<
private static final long serialVersionUID = 3L;
=======
private static final long serialVersionUID = 2L;
>>>>>>>
private static final long serialVersionUID = 3L;
<<<<<<<
// Looks like 'forClassAnnotations()' gets called so frequently that we
// should consider caching to avoid some of the lookups.
/**
* Transient cache: note that we do NOT have to add `readResolve()` for JDK serialization
* because {@link #forMapper(Object)} initializes it properly, when mapper get
* constructed.
*/
protected final transient LookupCache<JavaType,BasicBeanDescription> _cachedFCA;
=======
>>>>>>>
<<<<<<<
this(null);
}
protected BasicClassIntrospector(LookupCache<JavaType,BasicBeanDescription> cache) {
_cachedFCA = cache;
=======
>>>>>>> |
<<<<<<<
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
=======
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
>>>>>>>
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.Entity; |
<<<<<<<
boolean remote = supertile.getWorld().isRemote;
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
=======
int slowdown = getSlowdownFactor();
boolean remote = supertile.getWorldObj().isRemote;
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord - RANGE, supertile.zCoord - RANGE, supertile.xCoord + RANGE + 1, supertile.yCoord + RANGE + 1, supertile.zCoord + RANGE + 1));
>>>>>>>
int slowdown = getSlowdownFactor();
boolean remote = supertile.getWorld().isRemote;
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1))); |
<<<<<<<
boolean light = GL11.glGetBoolean(GL11.GL_LIGHTING);
GlStateManager.disableLighting();
=======
GL11.glPushAttrib(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_LIGHTING);
>>>>>>>
GL11.glPushAttrib(GL11.GL_LIGHTING);
GlStateManager.disableLighting();
<<<<<<<
if(light)
GlStateManager.enableLighting();
GlStateManager.enableDepth();
=======
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glPopAttrib();
>>>>>>>
GlStateManager.enableDepth();
GL11.glPopAttrib(); |
<<<<<<<
=======
@SideOnly(Side.CLIENT)
@Override
public void registerModels() {
ModelHandler.registerItemAppendMeta(this, SUBTYPES, LibItemNames.COSMETIC);
}
>>>>>>>
<<<<<<<
=======
renderStack = stack;
if (stack.getItemDamage() >= SUBTYPES || stack.getItemDamage() < 0) return;
Variants variant = Variants.values()[stack.getItemDamage()];
>>>>>>>
<<<<<<<
GlStateManager.translate(0F, -0.05F, -0.15F);
renderItem(stack);
=======
GlStateManager.translate(0F, -0.05F, 0F);
renderItem();
>>>>>>>
GlStateManager.translate(0F, -0.05F, 0F);
renderItem(stack); |
<<<<<<<
boolean armor = event.entityPlayer.getCurrentArmor(1) != null;
GlStateManager.translate(0F, 0.2F, 0F);
=======
GL11.glTranslatef(0F, 0.2F, 0F);
>>>>>>>
GlStateManager.translate(0F, 0.2F, 0F); |
<<<<<<<
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
=======
import net.minecraftforge.common.util.ForgeDirection;
import vazkii.botania.api.BotaniaAPI;
>>>>>>>
import net.minecraftforge.client.event.TextureStitchEvent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import vazkii.botania.api.BotaniaAPI;
<<<<<<<
MinecraftForge.EVENT_BUS.register(this);
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POOL_VARIANT, PoolVariant.DEFAULT));
=======
BotaniaAPI.blacklistBlockFromMagnet(this, Short.MAX_VALUE);
>>>>>>>
MinecraftForge.EVENT_BUS.register(this);
setDefaultState(blockState.getBaseState().withProperty(BotaniaStateProps.POOL_VARIANT, PoolVariant.DEFAULT));
BotaniaAPI.blacklistBlockFromMagnet(this, Short.MAX_VALUE);
<<<<<<<
@Override
public void addCollisionBoxesToList(World p_149743_1_, BlockPos pos, IBlockState state, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) {
float f = 1F / 16F;
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, pos, state, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 0.0F, f, 0.5F, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, pos, state, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, f);
super.addCollisionBoxesToList(p_149743_1_, pos, state, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, pos, state, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 0.5F, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, pos, state, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}
=======
@Override
public void addCollisionBoxesToList(World p_149743_1_, int p_149743_2_, int p_149743_3_, int p_149743_4_, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) {
float f = 1F / 16F;
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 0.0F, f, 0.5F, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, f);
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 0.5F, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, p_149743_2_, p_149743_3_, p_149743_4_, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}
>>>>>>>
@Override
public void addCollisionBoxesToList(World p_149743_1_, BlockPos pos, IBlockState state, AxisAlignedBB p_149743_5_, List p_149743_6_, Entity p_149743_7_) {
float f = 1F / 16F;
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, f, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, pos, state, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 0.0F, f, 0.5F, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, pos, state, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, f);
super.addCollisionBoxesToList(p_149743_1_, pos, state, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, pos, state, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 0.5F, 1.0F);
super.addCollisionBoxesToList(p_149743_1_, pos, state, p_149743_5_, p_149743_6_, p_149743_7_);
setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}
<<<<<<<
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
return LexiconData.pool;
=======
public LexiconEntry getEntry(World world, int x, int y, int z, EntityPlayer player, ItemStack lexicon) {
return world.getBlockMetadata(x, y, z) == 3 ? LexiconData.rainbowRod : LexiconData.pool;
>>>>>>>
public LexiconEntry getEntry(World world, BlockPos pos, EntityPlayer player, ItemStack lexicon) {
return world.getBlockMetadata(x, y, z) == 3 ? LexiconData.rainbowRod : LexiconData.pool; |
<<<<<<<
private static BlockSwapper addBlockSwapper(World world, EntityPlayer player, ItemStack stack, BlockPos origCoords, int steps, boolean leaves) {
=======
/**
* Adds a new block swapper to the provided world as the provided player.
* Block swappers are only added on the server, and a marker instance
* which is not actually ticked but contains the proper passed in
* information will be returned to the client.
*
* @param world The world to add the swapper to.
* @param player The player who is responsible for this swapper.
* @param stack The Terra Truncator which caused this block swapper.
* @param origCoords The original coordinates the swapper should start at.
* @param steps The range of the block swapper, in blocks.
* @param leaves If true, will treat leaves specially (see the BlockSwapper
* documentation).
* @return The created block swapper.
*/
private static BlockSwapper addBlockSwapper(World world, EntityPlayer player, ItemStack stack, ChunkCoordinates origCoords, int steps, boolean leaves) {
>>>>>>>
/**
* Adds a new block swapper to the provided world as the provided player.
* Block swappers are only added on the server, and a marker instance
* which is not actually ticked but contains the proper passed in
* information will be returned to the client.
*
* @param world The world to add the swapper to.
* @param player The player who is responsible for this swapper.
* @param stack The Terra Truncator which caused this block swapper.
* @param origCoords The original coordinates the swapper should start at.
* @param steps The range of the block swapper, in blocks.
* @param leaves If true, will treat leaves specially (see the BlockSwapper
* documentation).
* @return The created block swapper.
*/
private static BlockSwapper addBlockSwapper(World world, EntityPlayer player, ItemStack stack, BlockPos origCoords, int steps, boolean leaves) {
<<<<<<<
int dim = world.provider.getDimensionId();
=======
// Block swapper registration should only occur on the server
if(world.isRemote)
return swapper;
// If the mapping for this dimension doesn't exist, create it.
int dim = world.provider.dimensionId;
>>>>>>>
// Block swapper registration should only occur on the server
if(world.isRemote)
return swapper;
// If the mapping for this dimension doesn't exist, create it.
int dim = world.provider.getDimensionId(); |
<<<<<<<
@SubscribeEvent
public static void gatherData(GatherDataEvent evt) {
evt.getGenerator().addProvider(new BlockLootProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new BlockTagProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new ItemTagProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new StonecuttingProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new FloatingFlowerModelProvider(evt.getGenerator(), evt.getExistingFileHelper()));
evt.getGenerator().addProvider(new ItemModelProvider(evt.getGenerator(), evt.getExistingFileHelper()));
evt.getGenerator().addProvider(new BlockstateProvider(evt.getGenerator(), evt.getExistingFileHelper()));
}
=======
@SubscribeEvent
public static void gatherData(GatherDataEvent evt) {
if (evt.includeServer()) {
evt.getGenerator().addProvider(new BlockLootProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new BlockTagProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new ItemTagProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new StonecuttingProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new RecipeProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new SmeltingProvider(evt.getGenerator()));
}
}
>>>>>>>
@SubscribeEvent
public static void gatherData(GatherDataEvent evt) {
if (evt.includeServer()) {
evt.getGenerator().addProvider(new BlockLootProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new BlockTagProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new ItemTagProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new StonecuttingProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new RecipeProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new SmeltingProvider(evt.getGenerator()));
evt.getGenerator().addProvider(new FloatingFlowerModelProvider(evt.getGenerator(), evt.getExistingFileHelper()));
evt.getGenerator().addProvider(new ItemModelProvider(evt.getGenerator(), evt.getExistingFileHelper()));
evt.getGenerator().addProvider(new BlockstateProvider(evt.getGenerator(), evt.getExistingFileHelper()));
}
} |
<<<<<<<
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.IRecipeLayout;
import mezz.jei.api.gui.drawable.IDrawable;
import mezz.jei.api.gui.drawable.IDrawableStatic;
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
=======
>>>>>>> |
<<<<<<<
public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
ItemStack stack = player.getHeldItem(hand);
if(!stack.isEmpty() && stack.getItem() instanceof ItemDye) {
DyeColor newColor = ((ItemDye) stack.getItem()).color;
DyeColor oldColor = state.get(BotaniaStateProps.COLOR);
if(newColor != oldColor)
world.setBlockState(pos, state.with(BotaniaStateProps.COLOR, newColor));
return ActionResultType.SUCCESS;
}
=======
public boolean onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
>>>>>>>
public ActionResultType onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) { |
<<<<<<<
world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F);
=======
if(player == null) {
world.playSound(null, getPos(), ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F);
} else {
world.playSound(null, player.posX, player.posY, player.posZ, ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F);
}
>>>>>>>
if(player == null) {
world.playSound(null, getPos(), ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F);
} else {
world.playSound(null, player.getX(), player.getY(), player.getZ(), ModSounds.ding, SoundCategory.PLAYERS, 0.11F, 1F);
} |
<<<<<<<
final int types = 23;
=======
final int types = 24;
IIcon[] icons;
>>>>>>>
final int types = 24; |
<<<<<<<
registerDyesPetals();
registerRunes();
registerBows();
=======
registerItemModelMetas(rune, LibItemNames.RUNE, 16);
registerItemModelMetas(cosmetic, LibItemNames.COSMETIC, 32);
registerItemModelMetas(craftPattern, LibItemNames.CRAFT_PATTERN, 9);
>>>>>>>
registerDyesPetals();
registerRunes();
registerBows();
registerItemModelMetas(cosmetic, LibItemNames.COSMETIC, 32);
registerItemModelMetas(craftPattern, LibItemNames.CRAFT_PATTERN, 9);
<<<<<<<
registerItemModel(flowerBag);
registerItemModel(fertilizer);
registerItemModel(obedienceStick);
=======
registerItemModel(dirtRod);
registerItemModel(cobbleRod);
registerItemModel(fireRod);
registerItemModel(rainbowRod);
registerItemModel(skyDirtRod);
registerItemModel(tornadoRod);
registerItemModel(terraformRod);
>>>>>>>
registerItemModel(flowerBag);
registerItemModel(fertilizer);
registerItemModel(obedienceStick);
registerItemModel(dirtRod);
registerItemModel(cobbleRod);
registerItemModel(fireRod);
registerItemModel(rainbowRod);
registerItemModel(skyDirtRod);
registerItemModel(tornadoRod);
registerItemModel(terraformRod); |
<<<<<<<
=======
import vazkii.botania.api.state.enums.AltarVariant;
import vazkii.botania.api.state.enums.PoolVariant;
import vazkii.botania.client.core.handler.CorporeaInputHandler;
>>>>>>>
import vazkii.botania.client.core.handler.CorporeaInputHandler;
<<<<<<<
import vazkii.botania.common.lib.LibBlockNames;
=======
import vazkii.botania.common.item.brew.ItemBrewBase;
>>>>>>>
import vazkii.botania.common.lib.LibBlockNames;
import vazkii.botania.common.item.brew.ItemBrewBase;
<<<<<<<
subtypeRegistry.registerSubtypeInterpreter(Item.getItemFromBlock(ModBlocks.specialFlower), stack -> ItemBlockSpecialFlower.getType(stack).toString());
subtypeRegistry.registerSubtypeInterpreter(Item.getItemFromBlock(ModBlocks.floatingSpecialFlower), stack -> ItemBlockSpecialFlower.getType(stack).toString());
=======
subtypeRegistry.registerSubtypeInterpreter(Item.getItemFromBlock(ModBlocks.specialFlower), ItemBlockSpecialFlower::getType);
subtypeRegistry.registerSubtypeInterpreter(Item.getItemFromBlock(ModBlocks.floatingSpecialFlower), ItemBlockSpecialFlower::getType);
subtypeRegistry.registerSubtypeInterpreter(ModItems.brewVial, ItemBrewBase::getSubtype);
subtypeRegistry.registerSubtypeInterpreter(ModItems.brewFlask, ItemBrewBase::getSubtype);
subtypeRegistry.registerSubtypeInterpreter(ModItems.incenseStick, ItemBrewBase::getSubtype);
subtypeRegistry.registerSubtypeInterpreter(ModItems.bloodPendant, ItemBrewBase::getSubtype);
>>>>>>>
subtypeRegistry.registerSubtypeInterpreter(Item.getItemFromBlock(ModBlocks.specialFlower), stack -> ItemBlockSpecialFlower.getType(stack).toString());
subtypeRegistry.registerSubtypeInterpreter(Item.getItemFromBlock(ModBlocks.floatingSpecialFlower), stack -> ItemBlockSpecialFlower.getType(stack).toString());
subtypeRegistry.registerSubtypeInterpreter(ModItems.brewVial, ItemBrewBase::getSubtype);
subtypeRegistry.registerSubtypeInterpreter(ModItems.brewFlask, ItemBrewBase::getSubtype);
subtypeRegistry.registerSubtypeInterpreter(ModItems.incenseStick, ItemBrewBase::getSubtype);
subtypeRegistry.registerSubtypeInterpreter(ModItems.bloodPendant, ItemBrewBase::getSubtype);
<<<<<<<
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(LibBlockNames.SUBTILE_PUREDAISY), PureDaisyRecipeCategory.UID);
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), LibBlockNames.SUBTILE_PUREDAISY), PureDaisyRecipeCategory.UID);
=======
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(SUBTILE_ORECHID), OrechidRecipeCategory.UID);
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), SUBTILE_ORECHID), OrechidRecipeCategory.UID);
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(SUBTILE_ORECHID_IGNEM), OrechidIgnemRecipeCategory.UID);
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), SUBTILE_ORECHID_IGNEM), OrechidIgnemRecipeCategory.UID);
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(SUBTILE_PUREDAISY), PureDaisyRecipeCategory.UID);
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), SUBTILE_PUREDAISY), PureDaisyRecipeCategory.UID);
>>>>>>>
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(SUBTILE_ORECHID), OrechidRecipeCategory.UID);
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), SUBTILE_ORECHID), OrechidRecipeCategory.UID);
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(SUBTILE_ORECHID_IGNEM), OrechidIgnemRecipeCategory.UID);
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), SUBTILE_ORECHID_IGNEM), OrechidIgnemRecipeCategory.UID);
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(SUBTILE_PUREDAISY), PureDaisyRecipeCategory.UID);
registry.addRecipeCatalyst(ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), SUBTILE_PUREDAISY), PureDaisyRecipeCategory.UID); |
<<<<<<<
public static boolean rfApiLoaded = false;
=======
public static boolean storageDrawersLoaded = false;
>>>>>>>
public static boolean rfApiLoaded = false;
public static boolean storageDrawersLoaded = false;
<<<<<<<
rfApiLoaded = ModAPIManager.INSTANCE.hasAPI("CoFHAPI|energy");
=======
storageDrawersLoaded = Loader.isModLoaded("StorageDrawers");
>>>>>>>
rfApiLoaded = ModAPIManager.INSTANCE.hasAPI("CoFHAPI|energy");
storageDrawersLoaded = Loader.isModLoaded("StorageDrawers"); |
<<<<<<<
public int getLightValue(@Nonnull BlockState state, ILightReader world, @Nonnull BlockPos pos) {
if(world.getBlockState(pos).getBlock() != this)
return world.getBlockState(pos).getLightValue(world, pos);
TileAltar tile = (TileAltar) world.getTileEntity(pos);
return tile != null && tile.getFluid() == Fluids.LAVA ? 15 : 0;
=======
public int getLightValue(@Nonnull BlockState state, IEnviromentBlockReader world, @Nonnull BlockPos pos) {
TileEntity te = world.getTileEntity(pos);
if (te instanceof TileAltar && ((TileAltar) te).getFluid() == Fluids.LAVA) {
return 15;
} else {
return super.getLightValue(state, world, pos);
}
>>>>>>>
public int getLightValue(@Nonnull BlockState state, ILightReader world, @Nonnull BlockPos pos) {
TileEntity te = world.getTileEntity(pos);
if (te instanceof TileAltar && ((TileAltar) te).getFluid() == Fluids.LAVA) {
return 15;
} else {
return super.getLightValue(state, world, pos);
} |
<<<<<<<
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.003921569F);
if(isLightingEnabled)
GlStateManager.disableLighting();
=======
GL11.glPushAttrib(GL11.GL_LIGHTING);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
GL11.glDisable(GL11.GL_LIGHTING);
>>>>>>>
GL11.glPushAttrib(GL11.GL_LIGHTING);
GlStateManager.depthMask(false);
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.003921569F);
GlStateManager.disableLighting();
<<<<<<<
if(isLightingEnabled)
GlStateManager.enableLighting();
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
GlStateManager.disableBlend();
GlStateManager.depthMask(true);
=======
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
GL11.glPopAttrib();
>>>>>>>
GlStateManager.alphaFunc(GL11.GL_GREATER, 0.1F);
GlStateManager.disableBlend();
GlStateManager.depthMask(true);
GL11.glPopAttrib(); |
<<<<<<<
import vazkii.botania.common.item.ModItems;
import vazkii.botania.common.lib.LibMisc;
=======
import vazkii.botania.common.lib.LibItemNames;
import static vazkii.botania.common.item.ModItems.*;
>>>>>>>
import vazkii.botania.common.lib.LibItemNames;
import vazkii.botania.common.lib.LibMisc;
import static vazkii.botania.common.item.ModItems.*;
<<<<<<<
registerItemModel(ModBlocks.manaGlass);
registerItemModel(ModBlocks.elfGlass);
registerPylons();
=======
registerStandardBlocks();
registerManaResources();
>>>>>>>
registerPylons(); |
<<<<<<<
List<String> playersWhoAttacked = new ArrayList<>();
=======
List<UUID> playersWhoAttacked = new ArrayList();
>>>>>>>
List<UUID> playersWhoAttacked = new ArrayList<>();
<<<<<<<
if(!playersWhoAttacked.contains(player.getName()))
playersWhoAttacked.add(player.getName());
=======
if(!playersWhoAttacked.contains(player.getUniqueID()))
playersWhoAttacked.add(player.getUniqueID());
>>>>>>>
if(!playersWhoAttacked.contains(player.getUniqueID()))
playersWhoAttacked.add(player.getUniqueID()); |
<<<<<<<
=======
import net.minecraft.block.BlockDirt;
import net.minecraft.block.BlockStem;
>>>>>>>
import net.minecraft.block.BlockStem;
<<<<<<<
import net.minecraft.util.IItemProvider;
import net.minecraft.util.IStringSerializable;
=======
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
>>>>>>>
import net.minecraft.util.IItemProvider;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.EnumHand; |
<<<<<<<
boolean armor = event.entityPlayer.getCurrentArmor(1) != null;
GlStateManager.translate(0F, 0.2F, 0F);
=======
GL11.glTranslatef(0F, 0.2F, 0F);
>>>>>>>
GlStateManager.translate(0F, 0.2F, 0F); |
<<<<<<<
import net.minecraft.tileentity.TileEntityType;
import net.minecraftforge.registries.ObjectHolder;
=======
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
>>>>>>>
import net.minecraft.tileentity.TileEntityType;
import net.minecraftforge.registries.ObjectHolder;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.SPacketUpdateTileEntity;
<<<<<<<
IslandType type = IslandType.GRASS;
=======
private IslandType type = IslandType.GRASS;
>>>>>>>
private IslandType type = IslandType.GRASS; |
<<<<<<<
if(diluted) {
String s = StatCollector.translateToLocal("botaniamisc.pay2win");
mc.fontRendererObj.drawStringWithShadow(s, res.getScaledWidth() / 2 - mc.fontRendererObj.getStringWidth(s) / 2, y + 20, 0xFF8888);
}
GlStateManager.disableLighting();
GlStateManager.disableBlend();
=======
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_BLEND);
>>>>>>>
GlStateManager.disableLighting();
GlStateManager.disableBlend(); |
<<<<<<<
GlStateManager.color(1F, 1F, 1F, 0.7F + 0.3F * (float) (Math.sin(time / 5.0) + 0.5) * 2);
=======
float a = 0.1F + (1 - par1Entity.getDataWatcher().getWatchableObjectInt(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY)) * 0.8F;
GL11.glColor4f(1F, 1F, 1F, (0.7F + 0.3F * (float) (Math.sin(time / 5.0) + 0.5) * 2) * a);
>>>>>>>
float a = 0.1F + (1 - par1Entity.getDataWatcher().getWatchableObjectInt(EntitySpark.INVISIBILITY_DATA_WATCHER_KEY)) * 0.8F;
GlStateManager.color(1F, 1F, 1F, (0.7F + 0.3F * (float) (Math.sin(time / 5.0) + 0.5) * 2) * a);
<<<<<<<
GlStateManager.translate(-0.02F + (float) Math.sin(time / 20) * 0.2F, 0.24F + (float) Math.cos(time / 20) * 0.2F, 0.005F);
GlStateManager.scale(0.2F, 0.2F, 0.2F);
colorSpinningIcon(tEntity);
=======
GL11.glTranslatef(-0.02F + (float) Math.sin(time / 20) * 0.2F, 0.24F + (float) Math.cos(time / 20) * 0.2F, 0.005F);
GL11.glScalef(0.2F, 0.2F, 0.2F);
colorSpinningIcon(tEntity, a);
>>>>>>>
GlStateManager.translate(-0.02F + (float) Math.sin(time / 20) * 0.2F, 0.24F + (float) Math.cos(time / 20) * 0.2F, 0.005F);
GlStateManager.scale(0.2F, 0.2F, 0.2F);
colorSpinningIcon(tEntity, a); |
<<<<<<<
public SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser) {
return new FieldProperty(this, deser, _nullProvider);
}
@Override
public SettableBeanProperty withNullProvider(NullValueProvider nva) {
return new FieldProperty(this, _valueDeserializer, nva);
=======
public FieldProperty withValueDeserializer(JsonDeserializer<?> deser) {
if (_valueDeserializer == deser) {
return this;
}
return new FieldProperty(this, deser);
>>>>>>>
public SettableBeanProperty withValueDeserializer(JsonDeserializer<?> deser) {
if (_valueDeserializer == deser) {
return this;
}
return new FieldProperty(this, deser, _nullProvider);
}
@Override
public SettableBeanProperty withNullProvider(NullValueProvider nva) {
return new FieldProperty(this, _valueDeserializer, nva); |
<<<<<<<
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
=======
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
>>>>>>>
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
<<<<<<<
MinecraftForge.EVENT_BUS.register(new MultiblockRenderHandler());
=======
FMLCommonHandler.instance().bus().register(new CorporeaAutoCompleteHandler());
>>>>>>>
MinecraftForge.EVENT_BUS.register(new MultiblockRenderHandler());
FMLCommonHandler.instance().bus().register(new CorporeaAutoCompleteHandler()); |
<<<<<<<
if(block == Blocks.beacon && isTruePlayer(player) && !par3World.isRemote) {
if(par3World.getDifficulty() == EnumDifficulty.PEACEFUL) {
player.addChatMessage(new ChatComponentTranslation("botaniamisc.peacefulNoob").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
=======
if(block == Blocks.beacon && isTruePlayer(player)) {
if(par3World.difficultySetting == EnumDifficulty.PEACEFUL) {
if(!par3World.isRemote)
player.addChatMessage(new ChatComponentTranslation("botaniamisc.peacefulNoob").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
>>>>>>>
if(block == Blocks.beacon && isTruePlayer(player)) {
if(par3World.getDifficulty() == EnumDifficulty.PEACEFUL) {
if(!par3World.isRemote)
player.addChatMessage(new ChatComponentTranslation("botaniamisc.peacefulNoob").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); |
<<<<<<<
Color c = Color.getHSBColor(tile.getWorld().getTotalWorldTime() * 2 % 360 / 360F, 1F, 1F);
r = (float) c.getRed() / 255F;
g = (float) c.getGreen() / 255F;
b = (float) c.getBlue() / 255F;
=======
Color c = Color.getHSBColor(tile.getWorldObj().getTotalWorldTime() * 2 % 360 / 360F, 1F, 1F);
r = c.getRed() / 255F;
g = c.getGreen() / 255F;
b = c.getBlue() / 255F;
>>>>>>>
Color c = Color.getHSBColor(tile.getWorld().getTotalWorldTime() * 2 % 360 / 360F, 1F, 1F);
r = c.getRed() / 255F;
g = c.getGreen() / 255F;
b = c.getBlue() / 255F;
<<<<<<<
Botania.proxy.wispFX(tile.getWorld(), tile.getPos().getX() + 0.5, tile.getPos().getY() + 0.5, tile.getPos().getZ() + 0.5, r, g, b, 0.4F, mx, my, mz);
=======
Botania.proxy.wispFX(tile.getWorldObj(), tile.xCoord + 0.5, tile.yCoord + 0.5, tile.zCoord + 0.5, r, g, b, 0.4F, mx, my, mz);
>>>>>>>
Botania.proxy.wispFX(tile.getWorld(), tile.getPos().getX() + 0.5, tile.getPos().getY() + 0.5, tile.getPos().getZ() + 0.5, r, g, b, 0.4F, mx, my, mz); |
<<<<<<<
IInventory inv = InventoryHelper.getInventory(worldObj, getPos());
if(inv == null)
inv = InventoryHelper.getInventory(worldObj, getPos());
=======
IInventory inv = InventoryHelper.getInventory(worldObj, xCoord, yCoord - 1, zCoord);
if(inv == null || inv instanceof TileCorporeaFunnel)
inv = InventoryHelper.getInventory(worldObj, xCoord, yCoord - 2, zCoord);
>>>>>>>
IInventory inv = InventoryHelper.getInventory(worldObj, getPos().down());
if(inv == null || inv instanceof TileCorporeaFunnel)
inv = InventoryHelper.getInventory(worldObj, getPos().down(2));
<<<<<<<
if(inv != null && reqStack.stackSize == InventoryHelper.testInventoryInsertion(inv, reqStack, EnumFacing.UP))
=======
if(inv != null && !(inv instanceof TileCorporeaFunnel) && reqStack.stackSize == InventoryHelper.testInventoryInsertion(inv, reqStack, ForgeDirection.UP))
>>>>>>>
if(inv != null && !(inv instanceof TileCorporeaFunnel) && reqStack.stackSize == InventoryHelper.testInventoryInsertion(inv, reqStack, EnumFacing.UP)) |
<<<<<<<
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
List<EntityAnimal> animals = supertile.getWorld().getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
=======
List<EntityItem> items = supertile.getWorldObj().getEntitiesWithinAABB(EntityItem.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 + RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE));
List<EntityAnimal> animals = supertile.getWorldObj().getEntitiesWithinAABB(EntityAnimal.class, AxisAlignedBB.getBoundingBox(supertile.xCoord - RANGE, supertile.yCoord, supertile.zCoord - RANGE, supertile.xCoord + 1 +RANGE, supertile.yCoord + 1, supertile.zCoord + 1 +RANGE));
int slowdown = getSlowdownFactor();
>>>>>>>
List<EntityItem> items = supertile.getWorld().getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
List<EntityAnimal> animals = supertile.getWorld().getEntitiesWithinAABB(EntityAnimal.class, new AxisAlignedBB(supertile.getPos().add(-RANGE, -RANGE, -RANGE), supertile.getPos().add(RANGE + 1, RANGE + 1, RANGE + 1)));
int slowdown = getSlowdownFactor();
<<<<<<<
if(item.getAge() < 60 || item.isDead)
=======
if(item.age < (60 + slowdown) || item.isDead)
>>>>>>>
if(item.getAge() < (60 + slowdown) || item.isDead) |
<<<<<<<
Item inkwell = Item.itemRegistry.getObject(new ResourceLocation("thaumcraft", "scribing_tools"));
manaInkwellRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaInkwell), new ItemStack(inkwell), 35000);
=======
Item inkwell = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemInkwell");
manaInkwellRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaInkwell, 1, ModItems.manaInkwell.getMaxDamage()), new ItemStack(inkwell), 35000);
>>>>>>>
Item inkwell = Item.itemRegistry.getObject(new ResourceLocation("thaumcraft", "scribing_tools"));
manaInkwellRecipe = BotaniaAPI.registerManaInfusionRecipe(new ItemStack(ModItems.manaInkwell, 1, ModItems.manaInkwell.getMaxDamage()), new ItemStack(inkwell), 35000); |
<<<<<<<
import net.minecraft.block.Block;
=======
import javax.annotation.Nonnull;
>>>>>>>
import net.minecraft.block.Block;
import javax.annotation.Nonnull;
<<<<<<<
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IBlockReader;
=======
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.IBlockAccess;
>>>>>>>
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IBlockReader;
import net.minecraft.util.text.TextComponentTranslation;
<<<<<<<
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
=======
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import vazkii.botania.api.internal.VanillaPacketDispatcher;
>>>>>>>
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import vazkii.botania.api.internal.VanillaPacketDispatcher; |
<<<<<<<
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
=======
import vazkii.botania.api.BotaniaAPI;
>>>>>>>
import net.minecraftforge.fml.common.ObfuscationReflectionHelper;
import vazkii.botania.api.BotaniaAPI;
<<<<<<<
if(ManaItemHandler.requestManaExactForTool(stack, player, COST, true) && item != null) {
if(item instanceof EntityItem)
ObfuscationReflectionHelper.setPrivateValue(EntityItem.class, ((EntityItem) item), 5, LibObfuscation.PICKUP_DELAY);
if(item instanceof EntityLivingBase) {
EntityLivingBase targetEntity = (EntityLivingBase)item;
targetEntity.fallDistance = 0.0F;
if(targetEntity.getActivePotionEffect(Potion.moveSlowdown) == null)
targetEntity.addPotionEffect(new PotionEffect(Potion.moveSlowdown.id, 2, 3, true, true));
}
=======
if(item != null) {
if(BotaniaAPI.isEntityBlacklistedFromGravityRod(item.getClass()))
return stack;
if(ManaItemHandler.requestManaExactForTool(stack, player, COST, true)) {
if(item instanceof EntityItem)
((EntityItem)item).delayBeforeCanPickup = 5;
>>>>>>>
if(item != null) {
if(BotaniaAPI.isEntityBlacklistedFromGravityRod(item.getClass()))
return stack;
if(ManaItemHandler.requestManaExactForTool(stack, player, COST, true)) {
if(item instanceof EntityItem)
ObfuscationReflectionHelper.setPrivateValue(EntityItem.class, ((EntityItem) item), 5, LibObfuscation.PICKUP_DELAY); |
<<<<<<<
GlStateManager.color(1F, 1F, 1F, a);
GlStateManager.translate(d0, d1, d2);
boolean inf = tileentity.getWorld() == null ? forceMeta == 1 : tileentity.getBlockMetadata() == 1;
boolean dil = tileentity.getWorld() == null ? forceMeta == 2 : tileentity.getBlockMetadata() == 2;
=======
GL11.glColor4f(1F, 1F, 1F, a);
GL11.glTranslated(d0, d1, d2);
boolean inf = tileentity.getWorldObj() == null ? forceMeta == 1 : tileentity.getBlockMetadata() == 1;
boolean dil = tileentity.getWorldObj() == null ? forceMeta == 2 : tileentity.getBlockMetadata() == 2;
boolean fab = tileentity.getWorldObj() == null ? forceMeta == 3 : tileentity.getBlockMetadata() == 3;
>>>>>>>
GlStateManager.color(1F, 1F, 1F, a);
GlStateManager.translate(d0, d1, d2);
boolean inf = tileentity.getWorld() == null ? forceMeta == 1 : tileentity.getBlockMetadata() == 1;
boolean dil = tileentity.getWorld() == null ? forceMeta == 2 : tileentity.getBlockMetadata() == 2;
boolean fab = tileentity.getWorld() == null ? forceMeta == 3 : tileentity.getBlockMetadata() == 3;
<<<<<<<
GlStateManager.translate(0.5F, 1.5F, 0.5F);
GlStateManager.scale(1F, -1F, -1F);
int hex = pool.color.getMapColor().colorValue;
int r = (hex & 0xFF0000) >> 16;
int g = (hex & 0xFF00) >> 8;
int b = (hex & 0xFF);
GlStateManager.color(r, g, b, a);
=======
GL11.glTranslatef(0.5F, 1.5F, 0.5F);
GL11.glScalef(1F, -1F, -1F);
if(fab) {
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
if(tileentity != null)
time += new Random(tileentity.xCoord ^ tileentity.yCoord ^ tileentity.zCoord).nextInt(100000);
Color color = Color.getHSBColor(time * 0.005F, 0.6F, 1F);
GL11.glColor4ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) 255);
} else {
int color = pool.color;
float[] acolor = EntitySheep.fleeceColorTable[color];
GL11.glColor4f(acolor[0], acolor[1], acolor[2], a);
}
>>>>>>>
GlStateManager.translate(0.5F, 1.5F, 0.5F);
GlStateManager.scale(1F, -1F, -1F);
if(fab) {
float time = ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks;
if(tileentity != null)
time += new Random(tileentity.getPos().hashCode()).nextInt(100000);
Color color = Color.getHSBColor(time * 0.005F, 0.6F, 1F);
GlStateManager.color((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue(), (byte) 255);
} else {
int hex = pool.color.getMapColor().colorValue;
int r = (hex & 0xFF0000) >> 16;
int g = (hex & 0xFF00) >> 8;
int b = (hex & 0xFF);
GlStateManager.color(r, g, b, a);
} |
<<<<<<<
bindToUsernameS(player.getName(), stack);
=======
bindToUUIDS(player.getUniqueID(), stack);
>>>>>>>
bindToUUIDS(player.getUniqueID(), stack);
<<<<<<<
return isRightPlayer(player.getName(), stack);
=======
if(hasUUIDS(stack))
return isRightPlayer(player.getUniqueID(), stack);
return isRightPlayer(player.getCommandSenderName(), stack);
>>>>>>>
if(hasUUIDS(stack))
return isRightPlayer(player.getUniqueID(), stack);
return isRightPlayer(player.getName(), stack); |
<<<<<<<
if(!isManaBlock && !coords.equals(((BlockRayTraceResult) pos).getPos()))
entity.world.createExplosion(entity, entity.getX(), entity.getY(), entity.getZ(),
=======
if(!isManaBlock && !coords.equals(((BlockRayTraceResult) pos).getPos())) {
Entity cause = entity.getThrower() != null ? entity.getThrower() : entity;
entity.world.createExplosion(cause, entity.posX, entity.posY, entity.posZ,
>>>>>>>
if(!isManaBlock && !coords.equals(((BlockRayTraceResult) pos).getPos())) {
Entity cause = entity.getThrower() != null ? entity.getThrower() : entity;
entity.world.createExplosion(cause, entity.getX(), entity.getY(), entity.getZ(), |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.