id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
55,200 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/OrmLiteBaseActivity.java | OrmLiteBaseActivity.getHelper | public H getHelper() {
if (helper == null) {
if (!created) {
throw new IllegalStateException("A call has not been made to onCreate() yet so the helper is null");
} else if (destroyed) {
throw new IllegalStateException(
"A call to onDestroy has already been made and the helper cannot be used after ... | java | public H getHelper() {
if (helper == null) {
if (!created) {
throw new IllegalStateException("A call has not been made to onCreate() yet so the helper is null");
} else if (destroyed) {
throw new IllegalStateException(
"A call to onDestroy has already been made and the helper cannot be used after ... | [
"public",
"H",
"getHelper",
"(",
")",
"{",
"if",
"(",
"helper",
"==",
"null",
")",
"{",
"if",
"(",
"!",
"created",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"A call has not been made to onCreate() yet so the helper is null\"",
")",
";",
"}",
"els... | Get a helper for this action. | [
"Get",
"a",
"helper",
"for",
"this",
"action",
"."
] | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/OrmLiteBaseActivity.java#L34-L47 |
55,201 | j256/ormlite-android | src/main/java/com/j256/ormlite/android/apptools/BaseOrmLiteLoader.java | BaseOrmLiteLoader.onStartLoading | @Override
protected void onStartLoading() {
// XXX: do we really return the cached results _before_ checking if the content has changed?
if (cachedResults != null) {
deliverResult(cachedResults);
}
if (takeContentChanged() || cachedResults == null) {
forceLoad();
}
// watch for data changes
dao.reg... | java | @Override
protected void onStartLoading() {
// XXX: do we really return the cached results _before_ checking if the content has changed?
if (cachedResults != null) {
deliverResult(cachedResults);
}
if (takeContentChanged() || cachedResults == null) {
forceLoad();
}
// watch for data changes
dao.reg... | [
"@",
"Override",
"protected",
"void",
"onStartLoading",
"(",
")",
"{",
"// XXX: do we really return the cached results _before_ checking if the content has changed?",
"if",
"(",
"cachedResults",
"!=",
"null",
")",
"{",
"deliverResult",
"(",
"cachedResults",
")",
";",
"}",
... | Starts an asynchronous load of the data. When the result is ready the callbacks will be called on the UI thread.
If a previous load has been completed and is still valid the result may be passed to the callbacks immediately.
<p>
Must be called from the UI thread.
</p> | [
"Starts",
"an",
"asynchronous",
"load",
"of",
"the",
"data",
".",
"When",
"the",
"result",
"is",
"ready",
"the",
"callbacks",
"will",
"be",
"called",
"on",
"the",
"UI",
"thread",
".",
"If",
"a",
"previous",
"load",
"has",
"been",
"completed",
"and",
"is"... | e82327a868ae242f994730fe2389f79684d7bcab | https://github.com/j256/ormlite-android/blob/e82327a868ae242f994730fe2389f79684d7bcab/src/main/java/com/j256/ormlite/android/apptools/BaseOrmLiteLoader.java#L49-L60 |
55,202 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetrySender.java | TelemetrySender.executeRequest | private ResponseEntity<String> executeRequest(final TelemetryEventData eventData) {
final HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON.toString());
try {
final RestTemplate restTemplate = new RestTemplate();
final HttpE... | java | private ResponseEntity<String> executeRequest(final TelemetryEventData eventData) {
final HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON.toString());
try {
final RestTemplate restTemplate = new RestTemplate();
final HttpE... | [
"private",
"ResponseEntity",
"<",
"String",
">",
"executeRequest",
"(",
"final",
"TelemetryEventData",
"eventData",
")",
"{",
"final",
"HttpHeaders",
"headers",
"=",
"new",
"HttpHeaders",
"(",
")",
";",
"headers",
".",
"add",
"(",
"HttpHeaders",
".",
"CONTENT_TY... | Align the retry times with sdk | [
"Align",
"the",
"retry",
"times",
"with",
"sdk"
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/common/TelemetrySender.java#L39-L54 |
55,203 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java | SimpleDocumentDbRepository.save | @Override
public <S extends T> S save(S entity) {
Assert.notNull(entity, "entity must not be null");
// save entity
if (information.isNew(entity)) {
return operation.insert(information.getCollectionName(),
entity,
createKey(information.get... | java | @Override
public <S extends T> S save(S entity) {
Assert.notNull(entity, "entity must not be null");
// save entity
if (information.isNew(entity)) {
return operation.insert(information.getCollectionName(),
entity,
createKey(information.get... | [
"@",
"Override",
"public",
"<",
"S",
"extends",
"T",
">",
"S",
"save",
"(",
"S",
"entity",
")",
"{",
"Assert",
".",
"notNull",
"(",
"entity",
",",
"\"entity must not be null\"",
")",
";",
"// save entity",
"if",
"(",
"information",
".",
"isNew",
"(",
"en... | save entity without partition
@param entity to be saved
@param <S>
@return entity | [
"save",
"entity",
"without",
"partition"
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java#L63-L78 |
55,204 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java | SimpleDocumentDbRepository.saveAll | @Override
public <S extends T> Iterable<S> saveAll(Iterable<S> entities) {
Assert.notNull(entities, "Iterable entities should not be null");
entities.forEach(this::save);
return entities;
} | java | @Override
public <S extends T> Iterable<S> saveAll(Iterable<S> entities) {
Assert.notNull(entities, "Iterable entities should not be null");
entities.forEach(this::save);
return entities;
} | [
"@",
"Override",
"public",
"<",
"S",
"extends",
"T",
">",
"Iterable",
"<",
"S",
">",
"saveAll",
"(",
"Iterable",
"<",
"S",
">",
"entities",
")",
"{",
"Assert",
".",
"notNull",
"(",
"entities",
",",
"\"Iterable entities should not be null\"",
")",
";",
"ent... | batch save entities
@param entities
@param <S>
@return | [
"batch",
"save",
"entities"
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java#L95-L102 |
55,205 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java | SimpleDocumentDbRepository.findAll | @Override
public Iterable<T> findAll() {
return operation.findAll(information.getCollectionName(), information.getJavaType());
} | java | @Override
public Iterable<T> findAll() {
return operation.findAll(information.getCollectionName(), information.getJavaType());
} | [
"@",
"Override",
"public",
"Iterable",
"<",
"T",
">",
"findAll",
"(",
")",
"{",
"return",
"operation",
".",
"findAll",
"(",
"information",
".",
"getCollectionName",
"(",
")",
",",
"information",
".",
"getJavaType",
"(",
")",
")",
";",
"}"
] | find all entities from one collection without configuring partition key value
@return | [
"find",
"all",
"entities",
"from",
"one",
"collection",
"without",
"configuring",
"partition",
"key",
"value"
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java#L109-L112 |
55,206 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java | SimpleDocumentDbRepository.findAllById | @Override
public List<T> findAllById(Iterable<ID> ids) {
Assert.notNull(ids, "Iterable ids should not be null");
return operation.findByIds(ids, information.getJavaType(), information.getCollectionName());
} | java | @Override
public List<T> findAllById(Iterable<ID> ids) {
Assert.notNull(ids, "Iterable ids should not be null");
return operation.findByIds(ids, information.getJavaType(), information.getCollectionName());
} | [
"@",
"Override",
"public",
"List",
"<",
"T",
">",
"findAllById",
"(",
"Iterable",
"<",
"ID",
">",
"ids",
")",
"{",
"Assert",
".",
"notNull",
"(",
"ids",
",",
"\"Iterable ids should not be null\"",
")",
";",
"return",
"operation",
".",
"findByIds",
"(",
"id... | find entities based on id list from one collection without partitions
@param ids
@return | [
"find",
"entities",
"based",
"on",
"id",
"list",
"from",
"one",
"collection",
"without",
"partitions"
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java#L120-L125 |
55,207 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java | SimpleDocumentDbRepository.findById | @Override
public Optional<T> findById(ID id) {
Assert.notNull(id, "id must not be null");
if (id instanceof String && !StringUtils.hasText((String) id)) {
return Optional.empty();
}
return Optional.ofNullable(operation.findById(information.getCollectionName(), id, infor... | java | @Override
public Optional<T> findById(ID id) {
Assert.notNull(id, "id must not be null");
if (id instanceof String && !StringUtils.hasText((String) id)) {
return Optional.empty();
}
return Optional.ofNullable(operation.findById(information.getCollectionName(), id, infor... | [
"@",
"Override",
"public",
"Optional",
"<",
"T",
">",
"findById",
"(",
"ID",
"id",
")",
"{",
"Assert",
".",
"notNull",
"(",
"id",
",",
"\"id must not be null\"",
")",
";",
"if",
"(",
"id",
"instanceof",
"String",
"&&",
"!",
"StringUtils",
".",
"hasText",... | find one entity per id without partitions
@param id
@return | [
"find",
"one",
"entity",
"per",
"id",
"without",
"partitions"
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java#L133-L142 |
55,208 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java | SimpleDocumentDbRepository.deleteById | @Override
public void deleteById(ID id) {
Assert.notNull(id, "id to be deleted should not be null");
operation.deleteById(information.getCollectionName(), id, null);
} | java | @Override
public void deleteById(ID id) {
Assert.notNull(id, "id to be deleted should not be null");
operation.deleteById(information.getCollectionName(), id, null);
} | [
"@",
"Override",
"public",
"void",
"deleteById",
"(",
"ID",
"id",
")",
"{",
"Assert",
".",
"notNull",
"(",
"id",
",",
"\"id to be deleted should not be null\"",
")",
";",
"operation",
".",
"deleteById",
"(",
"information",
".",
"getCollectionName",
"(",
")",
"... | delete one document per id without configuring partition key value
@param id | [
"delete",
"one",
"document",
"per",
"id",
"without",
"configuring",
"partition",
"key",
"value"
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java#L159-L164 |
55,209 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java | SimpleDocumentDbRepository.delete | @Override
public void delete(T entity) {
Assert.notNull(entity, "entity to be deleted should not be null");
final String partitionKeyValue = information.getPartitionKeyFieldValue(entity);
operation.deleteById(information.getCollectionName(),
information.getId(entity),
... | java | @Override
public void delete(T entity) {
Assert.notNull(entity, "entity to be deleted should not be null");
final String partitionKeyValue = information.getPartitionKeyFieldValue(entity);
operation.deleteById(information.getCollectionName(),
information.getId(entity),
... | [
"@",
"Override",
"public",
"void",
"delete",
"(",
"T",
"entity",
")",
"{",
"Assert",
".",
"notNull",
"(",
"entity",
",",
"\"entity to be deleted should not be null\"",
")",
";",
"final",
"String",
"partitionKeyValue",
"=",
"information",
".",
"getPartitionKeyFieldVa... | delete one document per entity
@param entity | [
"delete",
"one",
"document",
"per",
"entity"
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java#L171-L180 |
55,210 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java | SimpleDocumentDbRepository.deleteAll | @Override
public void deleteAll(Iterable<? extends T> entities) {
Assert.notNull(entities, "Iterable entities should not be null");
StreamSupport.stream(entities.spliterator(), true).forEach(this::delete);
} | java | @Override
public void deleteAll(Iterable<? extends T> entities) {
Assert.notNull(entities, "Iterable entities should not be null");
StreamSupport.stream(entities.spliterator(), true).forEach(this::delete);
} | [
"@",
"Override",
"public",
"void",
"deleteAll",
"(",
"Iterable",
"<",
"?",
"extends",
"T",
">",
"entities",
")",
"{",
"Assert",
".",
"notNull",
"(",
"entities",
",",
"\"Iterable entities should not be null\"",
")",
";",
"StreamSupport",
".",
"stream",
"(",
"en... | delete list of entities without partitions
@param entities | [
"delete",
"list",
"of",
"entities",
"without",
"partitions"
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java#L195-L200 |
55,211 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java | SimpleDocumentDbRepository.existsById | @Override
public boolean existsById(ID primaryKey) {
Assert.notNull(primaryKey, "primaryKey should not be null");
return findById(primaryKey).isPresent();
} | java | @Override
public boolean existsById(ID primaryKey) {
Assert.notNull(primaryKey, "primaryKey should not be null");
return findById(primaryKey).isPresent();
} | [
"@",
"Override",
"public",
"boolean",
"existsById",
"(",
"ID",
"primaryKey",
")",
"{",
"Assert",
".",
"notNull",
"(",
"primaryKey",
",",
"\"primaryKey should not be null\"",
")",
";",
"return",
"findById",
"(",
"primaryKey",
")",
".",
"isPresent",
"(",
")",
";... | check if an entity exists per id without partition
@param primaryKey
@return | [
"check",
"if",
"an",
"entity",
"exists",
"per",
"id",
"without",
"partition"
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java#L208-L213 |
55,212 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java | SimpleDocumentDbRepository.findAll | @Override
public Page<T> findAll(Pageable pageable) {
Assert.notNull(pageable, "pageable should not be null");
return operation.findAll(pageable, information.getJavaType(), information.getCollectionName());
} | java | @Override
public Page<T> findAll(Pageable pageable) {
Assert.notNull(pageable, "pageable should not be null");
return operation.findAll(pageable, information.getJavaType(), information.getCollectionName());
} | [
"@",
"Override",
"public",
"Page",
"<",
"T",
">",
"findAll",
"(",
"Pageable",
"pageable",
")",
"{",
"Assert",
".",
"notNull",
"(",
"pageable",
",",
"\"pageable should not be null\"",
")",
";",
"return",
"operation",
".",
"findAll",
"(",
"pageable",
",",
"inf... | FindQuerySpecGenerator
Returns a Page of entities meeting the paging restriction provided in the Pageable object.
@param pageable
@return a page of entities | [
"FindQuerySpecGenerator",
"Returns",
"a",
"Page",
"of",
"entities",
"meeting",
"the",
"paging",
"restriction",
"provided",
"in",
"the",
"Pageable",
"object",
"."
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/repository/support/SimpleDocumentDbRepository.java#L236-L241 |
55,213 | Microsoft/spring-data-cosmosdb | src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/MappingDocumentDbConverter.java | MappingDocumentDbConverter.toDocumentDBValue | public static Object toDocumentDBValue(Object fromPropertyValue) {
if (fromPropertyValue == null) {
return null;
}
// com.microsoft.azure.documentdb.JsonSerializable#set(String, T) cannot set values for Date and Enum correctly
if (fromPropertyValue instanceof Date) {
... | java | public static Object toDocumentDBValue(Object fromPropertyValue) {
if (fromPropertyValue == null) {
return null;
}
// com.microsoft.azure.documentdb.JsonSerializable#set(String, T) cannot set values for Date and Enum correctly
if (fromPropertyValue instanceof Date) {
... | [
"public",
"static",
"Object",
"toDocumentDBValue",
"(",
"Object",
"fromPropertyValue",
")",
"{",
"if",
"(",
"fromPropertyValue",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"// com.microsoft.azure.documentdb.JsonSerializable#set(String, T) cannot set values for Date a... | Convert a property value to the value stored in CosmosDB
@param fromPropertyValue
@return | [
"Convert",
"a",
"property",
"value",
"to",
"the",
"value",
"stored",
"in",
"CosmosDB"
] | f349fce5892f225794eae865ca9a12191cac243c | https://github.com/Microsoft/spring-data-cosmosdb/blob/f349fce5892f225794eae865ca9a12191cac243c/src/main/java/com/microsoft/azure/spring/data/cosmosdb/core/convert/MappingDocumentDbConverter.java#L166-L182 |
55,214 | revelc/formatter-maven-plugin | src/main/java/net/revelc/code/formatter/model/Profiles.java | Profiles.addProfile | public void addProfile(Profile profile) {
if (PROFILE_KIND.equals(profile.getKind())) {
this.profileList.add(profile.getSettings());
}
} | java | public void addProfile(Profile profile) {
if (PROFILE_KIND.equals(profile.getKind())) {
this.profileList.add(profile.getSettings());
}
} | [
"public",
"void",
"addProfile",
"(",
"Profile",
"profile",
")",
"{",
"if",
"(",
"PROFILE_KIND",
".",
"equals",
"(",
"profile",
".",
"getKind",
"(",
")",
")",
")",
"{",
"this",
".",
"profileList",
".",
"add",
"(",
"profile",
".",
"getSettings",
"(",
")"... | Adds the profile.
@param profile
the profile | [
"Adds",
"the",
"profile",
"."
] | a237073ce6220e73ad6b1faef412fe0660485cf4 | https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/model/Profiles.java#L40-L44 |
55,215 | revelc/formatter-maven-plugin | src/main/java/net/revelc/code/formatter/model/RuleSet.java | RuleSet.addRuleInstances | @Override
public void addRuleInstances(Digester digester) {
digester.addObjectCreate("profiles", Profiles.class);
digester.addObjectCreate(PROFILES_PROFILE, Profile.class);
digester.addObjectCreate(PROFILES_PROFILE_SETTING, Setting.class);
digester.addSetNext(PROFILES_PROFILE, "addP... | java | @Override
public void addRuleInstances(Digester digester) {
digester.addObjectCreate("profiles", Profiles.class);
digester.addObjectCreate(PROFILES_PROFILE, Profile.class);
digester.addObjectCreate(PROFILES_PROFILE_SETTING, Setting.class);
digester.addSetNext(PROFILES_PROFILE, "addP... | [
"@",
"Override",
"public",
"void",
"addRuleInstances",
"(",
"Digester",
"digester",
")",
"{",
"digester",
".",
"addObjectCreate",
"(",
"\"profiles\"",
",",
"Profiles",
".",
"class",
")",
";",
"digester",
".",
"addObjectCreate",
"(",
"PROFILES_PROFILE",
",",
"Pro... | Adds the rule instances.
@param digester
the digester
@see org.apache.commons.digester3.RuleSetBase#addRuleInstances(org.apache.commons.digester3.Digester) | [
"Adds",
"the",
"rule",
"instances",
"."
] | a237073ce6220e73ad6b1faef412fe0660485cf4 | https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/model/RuleSet.java#L37-L49 |
55,216 | revelc/formatter-maven-plugin | src/main/java/net/revelc/code/formatter/FormatterMojo.java | FormatterMojo.addCollectionFiles | List<File> addCollectionFiles(File newBasedir) {
final DirectoryScanner ds = new DirectoryScanner();
ds.setBasedir(newBasedir);
if (this.includes != null && this.includes.length > 0) {
ds.setIncludes(this.includes);
} else {
ds.setIncludes(DEFAULT_INCLUDES);
... | java | List<File> addCollectionFiles(File newBasedir) {
final DirectoryScanner ds = new DirectoryScanner();
ds.setBasedir(newBasedir);
if (this.includes != null && this.includes.length > 0) {
ds.setIncludes(this.includes);
} else {
ds.setIncludes(DEFAULT_INCLUDES);
... | [
"List",
"<",
"File",
">",
"addCollectionFiles",
"(",
"File",
"newBasedir",
")",
"{",
"final",
"DirectoryScanner",
"ds",
"=",
"new",
"DirectoryScanner",
"(",
")",
";",
"ds",
".",
"setBasedir",
"(",
"newBasedir",
")",
";",
"if",
"(",
"this",
".",
"includes",... | Add source files to the files list. | [
"Add",
"source",
"files",
"to",
"the",
"files",
"list",
"."
] | a237073ce6220e73ad6b1faef412fe0660485cf4 | https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/FormatterMojo.java#L369-L389 |
55,217 | revelc/formatter-maven-plugin | src/main/java/net/revelc/code/formatter/FormatterMojo.java | FormatterMojo.storeFileHashCache | private void storeFileHashCache(Properties props) {
File cacheFile = new File(this.targetDirectory, CACHE_PROPERTIES_FILENAME);
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(cacheFile))) {
props.store(out, null);
} catch (IOException e) {
getLog().... | java | private void storeFileHashCache(Properties props) {
File cacheFile = new File(this.targetDirectory, CACHE_PROPERTIES_FILENAME);
try (OutputStream out = new BufferedOutputStream(new FileOutputStream(cacheFile))) {
props.store(out, null);
} catch (IOException e) {
getLog().... | [
"private",
"void",
"storeFileHashCache",
"(",
"Properties",
"props",
")",
"{",
"File",
"cacheFile",
"=",
"new",
"File",
"(",
"this",
".",
"targetDirectory",
",",
"CACHE_PROPERTIES_FILENAME",
")",
";",
"try",
"(",
"OutputStream",
"out",
"=",
"new",
"BufferedOutpu... | Store file hash cache.
@param props
the props | [
"Store",
"file",
"hash",
"cache",
"."
] | a237073ce6220e73ad6b1faef412fe0660485cf4 | https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/FormatterMojo.java#L411-L418 |
55,218 | revelc/formatter-maven-plugin | src/main/java/net/revelc/code/formatter/FormatterMojo.java | FormatterMojo.readFileHashCacheFile | private Properties readFileHashCacheFile() {
Properties props = new Properties();
Log log = getLog();
if (!this.targetDirectory.exists()) {
this.targetDirectory.mkdirs();
} else if (!this.targetDirectory.isDirectory()) {
log.warn("Something strange here as the '" ... | java | private Properties readFileHashCacheFile() {
Properties props = new Properties();
Log log = getLog();
if (!this.targetDirectory.exists()) {
this.targetDirectory.mkdirs();
} else if (!this.targetDirectory.isDirectory()) {
log.warn("Something strange here as the '" ... | [
"private",
"Properties",
"readFileHashCacheFile",
"(",
")",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"Log",
"log",
"=",
"getLog",
"(",
")",
";",
"if",
"(",
"!",
"this",
".",
"targetDirectory",
".",
"exists",
"(",
")",
")",
"... | Read file hash cache file.
@return the properties | [
"Read",
"file",
"hash",
"cache",
"file",
"."
] | a237073ce6220e73ad6b1faef412fe0660485cf4 | https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/FormatterMojo.java#L425-L447 |
55,219 | revelc/formatter-maven-plugin | src/main/java/net/revelc/code/formatter/FormatterMojo.java | FormatterMojo.formatFile | private void formatFile(File file, ResultCollector rc, Properties hashCache, String basedirPath)
throws MojoFailureException, MojoExecutionException {
try {
doFormatFile(file, rc, hashCache, basedirPath, false);
} catch (IOException | MalformedTreeException | BadLocationException... | java | private void formatFile(File file, ResultCollector rc, Properties hashCache, String basedirPath)
throws MojoFailureException, MojoExecutionException {
try {
doFormatFile(file, rc, hashCache, basedirPath, false);
} catch (IOException | MalformedTreeException | BadLocationException... | [
"private",
"void",
"formatFile",
"(",
"File",
"file",
",",
"ResultCollector",
"rc",
",",
"Properties",
"hashCache",
",",
"String",
"basedirPath",
")",
"throws",
"MojoFailureException",
",",
"MojoExecutionException",
"{",
"try",
"{",
"doFormatFile",
"(",
"file",
",... | Format file.
@param file
the file
@param rc
the rc
@param hashCache
the hash cache
@param basedirPath
the basedir path | [
"Format",
"file",
"."
] | a237073ce6220e73ad6b1faef412fe0660485cf4 | https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/FormatterMojo.java#L461-L469 |
55,220 | revelc/formatter-maven-plugin | src/main/java/net/revelc/code/formatter/FormatterMojo.java | FormatterMojo.readFileAsString | private String readFileAsString(File file) throws java.io.IOException {
StringBuilder fileData = new StringBuilder(1000);
try (BufferedReader reader = new BufferedReader(ReaderFactory.newReader(file, this.encoding))) {
char[] buf = new char[1024];
int numRead = 0;
whi... | java | private String readFileAsString(File file) throws java.io.IOException {
StringBuilder fileData = new StringBuilder(1000);
try (BufferedReader reader = new BufferedReader(ReaderFactory.newReader(file, this.encoding))) {
char[] buf = new char[1024];
int numRead = 0;
whi... | [
"private",
"String",
"readFileAsString",
"(",
"File",
"file",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
"{",
"StringBuilder",
"fileData",
"=",
"new",
"StringBuilder",
"(",
"1000",
")",
";",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"Buf... | Read the given file and return the content as a string.
@param file
the file
@return the string
@throws IOException
Signals that an I/O exception has occurred. | [
"Read",
"the",
"given",
"file",
"and",
"return",
"the",
"content",
"as",
"a",
"string",
"."
] | a237073ce6220e73ad6b1faef412fe0660485cf4 | https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/FormatterMojo.java#L597-L609 |
55,221 | revelc/formatter-maven-plugin | src/main/java/net/revelc/code/formatter/FormatterMojo.java | FormatterMojo.writeStringToFile | private void writeStringToFile(String str, File file) throws IOException {
if (!file.exists() && file.isDirectory()) {
return;
}
try (BufferedWriter bw = new BufferedWriter(WriterFactory.newWriter(file, this.encoding))) {
bw.write(str);
}
} | java | private void writeStringToFile(String str, File file) throws IOException {
if (!file.exists() && file.isDirectory()) {
return;
}
try (BufferedWriter bw = new BufferedWriter(WriterFactory.newWriter(file, this.encoding))) {
bw.write(str);
}
} | [
"private",
"void",
"writeStringToFile",
"(",
"String",
"str",
",",
"File",
"file",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"file",
".",
"exists",
"(",
")",
"&&",
"file",
".",
"isDirectory",
"(",
")",
")",
"{",
"return",
";",
"}",
"try",
"(... | Write the given string to a file.
@param str
the str
@param file
the file
@throws IOException
Signals that an I/O exception has occurred. | [
"Write",
"the",
"given",
"string",
"to",
"a",
"file",
"."
] | a237073ce6220e73ad6b1faef412fe0660485cf4 | https://github.com/revelc/formatter-maven-plugin/blob/a237073ce6220e73ad6b1faef412fe0660485cf4/src/main/java/net/revelc/code/formatter/FormatterMojo.java#L621-L629 |
55,222 | codecentric/spring-boot-starter-batch-web | batch-web-spring-boot-autoconfigure/src/main/java/de/codecentric/batch/web/JobOperationsController.java | JobOperationsController.getNextJobParameters | private JobParameters getNextJobParameters(Job job) throws JobParametersNotFoundException {
String jobIdentifier = job.getName();
JobParameters jobParameters;
List<JobInstance> lastInstances = jobExplorer.getJobInstances(jobIdentifier, 0, 1);
JobParametersIncrementer incrementer = job.getJobParametersIncrement... | java | private JobParameters getNextJobParameters(Job job) throws JobParametersNotFoundException {
String jobIdentifier = job.getName();
JobParameters jobParameters;
List<JobInstance> lastInstances = jobExplorer.getJobInstances(jobIdentifier, 0, 1);
JobParametersIncrementer incrementer = job.getJobParametersIncrement... | [
"private",
"JobParameters",
"getNextJobParameters",
"(",
"Job",
"job",
")",
"throws",
"JobParametersNotFoundException",
"{",
"String",
"jobIdentifier",
"=",
"job",
".",
"getName",
"(",
")",
";",
"JobParameters",
"jobParameters",
";",
"List",
"<",
"JobInstance",
">",... | Borrowed from CommandLineJobRunner.
@param job
the job that we need to find the next parameters for
@return the next job parameters if they can be located
@throws JobParametersNotFoundException
if there is a problem | [
"Borrowed",
"from",
"CommandLineJobRunner",
"."
] | faf5f59f179f82621dd6709cbde6240214f51864 | https://github.com/codecentric/spring-boot-starter-batch-web/blob/faf5f59f179f82621dd6709cbde6240214f51864/batch-web-spring-boot-autoconfigure/src/main/java/de/codecentric/batch/web/JobOperationsController.java#L233-L251 |
55,223 | codecentric/spring-boot-starter-batch-web | batch-web-spring-boot-samples/batch-boot-simple/src/main/java/de/codecentric/batch/simple/item/DummyItemReader.java | DummyItemReader.read | @Override
public String read() throws Exception {
String item = null;
if (index < input.length) {
item = input[index++];
LOGGER.info(item);
return item;
} else {
return null;
}
} | java | @Override
public String read() throws Exception {
String item = null;
if (index < input.length) {
item = input[index++];
LOGGER.info(item);
return item;
} else {
return null;
}
} | [
"@",
"Override",
"public",
"String",
"read",
"(",
")",
"throws",
"Exception",
"{",
"String",
"item",
"=",
"null",
";",
"if",
"(",
"index",
"<",
"input",
".",
"length",
")",
"{",
"item",
"=",
"input",
"[",
"index",
"++",
"]",
";",
"LOGGER",
".",
"in... | Reads next record from input | [
"Reads",
"next",
"record",
"from",
"input"
] | faf5f59f179f82621dd6709cbde6240214f51864 | https://github.com/codecentric/spring-boot-starter-batch-web/blob/faf5f59f179f82621dd6709cbde6240214f51864/batch-web-spring-boot-samples/batch-boot-simple/src/main/java/de/codecentric/batch/simple/item/DummyItemReader.java#L21-L32 |
55,224 | Netflix/astyanax | astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java | ShardedDistributedMessageQueue.getShardKey | String getShardKey(Message message) {
return getShardKey(message.getTokenTime(), this.modShardPolicy.getMessageShard(message, metadata));
} | java | String getShardKey(Message message) {
return getShardKey(message.getTokenTime(), this.modShardPolicy.getMessageShard(message, metadata));
} | [
"String",
"getShardKey",
"(",
"Message",
"message",
")",
"{",
"return",
"getShardKey",
"(",
"message",
".",
"getTokenTime",
"(",
")",
",",
"this",
".",
"modShardPolicy",
".",
"getMessageShard",
"(",
"message",
",",
"metadata",
")",
")",
";",
"}"
] | Return the shard for this message
@param message
@return | [
"Return",
"the",
"shard",
"for",
"this",
"message"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java#L420-L422 |
55,225 | Netflix/astyanax | astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java | ShardedDistributedMessageQueue.getShardKey | private String getShardKey(long messageTime, int modShard) {
long timePartition;
if (metadata.getPartitionDuration() != null)
timePartition = (messageTime / metadata.getPartitionDuration()) % metadata.getPartitionCount();
else
timePartition = 0;
return getName() +... | java | private String getShardKey(long messageTime, int modShard) {
long timePartition;
if (metadata.getPartitionDuration() != null)
timePartition = (messageTime / metadata.getPartitionDuration()) % metadata.getPartitionCount();
else
timePartition = 0;
return getName() +... | [
"private",
"String",
"getShardKey",
"(",
"long",
"messageTime",
",",
"int",
"modShard",
")",
"{",
"long",
"timePartition",
";",
"if",
"(",
"metadata",
".",
"getPartitionDuration",
"(",
")",
"!=",
"null",
")",
"timePartition",
"=",
"(",
"messageTime",
"/",
"m... | Return the shard for this timestamp
@param messageTime
@param modShard
@return | [
"Return",
"the",
"shard",
"for",
"this",
"timestamp"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java#L430-L437 |
55,226 | Netflix/astyanax | astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java | ShardedDistributedMessageQueue.getKeyHistory | @Override
public List<MessageHistory> getKeyHistory(String key, Long startTime, Long endTime, int count) throws MessageQueueException {
List<MessageHistory> list = Lists.newArrayList();
ColumnList<UUID> columns;
try {
columns = keyspace.prepareQuery(historyColumnFamily)
... | java | @Override
public List<MessageHistory> getKeyHistory(String key, Long startTime, Long endTime, int count) throws MessageQueueException {
List<MessageHistory> list = Lists.newArrayList();
ColumnList<UUID> columns;
try {
columns = keyspace.prepareQuery(historyColumnFamily)
... | [
"@",
"Override",
"public",
"List",
"<",
"MessageHistory",
">",
"getKeyHistory",
"(",
"String",
"key",
",",
"Long",
"startTime",
",",
"Long",
"endTime",
",",
"int",
"count",
")",
"throws",
"MessageQueueException",
"{",
"List",
"<",
"MessageHistory",
">",
"list"... | Return history for a single key for the specified time range
TODO: honor the time range :) | [
"Return",
"history",
"for",
"a",
"single",
"key",
"for",
"the",
"specified",
"time",
"range"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java#L988-L1010 |
55,227 | Netflix/astyanax | astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java | ShardedDistributedMessageQueue.peekMessages | @Override
public List<Message> peekMessages(int itemsToPeek) throws MessageQueueException {
List<Message> messages = Lists.newArrayList();
for (MessageQueueShard shard : shardReaderPolicy.listShards()) {
messages.addAll(peekMessages(shard.getName(), itemsToPeek - messages.size()));
... | java | @Override
public List<Message> peekMessages(int itemsToPeek) throws MessageQueueException {
List<Message> messages = Lists.newArrayList();
for (MessageQueueShard shard : shardReaderPolicy.listShards()) {
messages.addAll(peekMessages(shard.getName(), itemsToPeek - messages.size()));
... | [
"@",
"Override",
"public",
"List",
"<",
"Message",
">",
"peekMessages",
"(",
"int",
"itemsToPeek",
")",
"throws",
"MessageQueueException",
"{",
"List",
"<",
"Message",
">",
"messages",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"(",
"MessageQue... | Iterate through shards attempting to extract itemsToPeek items. Will return
once itemToPeek items have been read or all shards have been checked.
Note that this call does not take into account the message trigger time and
will likely return messages that aren't due to be executed yet.
@return List of items | [
"Iterate",
"through",
"shards",
"attempting",
"to",
"extract",
"itemsToPeek",
"items",
".",
"Will",
"return",
"once",
"itemToPeek",
"items",
"have",
"been",
"read",
"or",
"all",
"shards",
"have",
"been",
"checked",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java#L1020-L1032 |
55,228 | Netflix/astyanax | astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java | ShardedDistributedMessageQueue.peekMessages | private Collection<Message> peekMessages(String shardName, int itemsToPeek) throws MessageQueueException {
try {
ColumnList<MessageQueueEntry> result = keyspace.prepareQuery(queueColumnFamily)
.setConsistencyLevel(consistencyLevel)
.getKey(shardName)
... | java | private Collection<Message> peekMessages(String shardName, int itemsToPeek) throws MessageQueueException {
try {
ColumnList<MessageQueueEntry> result = keyspace.prepareQuery(queueColumnFamily)
.setConsistencyLevel(consistencyLevel)
.getKey(shardName)
... | [
"private",
"Collection",
"<",
"Message",
">",
"peekMessages",
"(",
"String",
"shardName",
",",
"int",
"itemsToPeek",
")",
"throws",
"MessageQueueException",
"{",
"try",
"{",
"ColumnList",
"<",
"MessageQueueEntry",
">",
"result",
"=",
"keyspace",
".",
"prepareQuery... | Peek into messages contained in the shard. This call does not take trigger time into account
and will return messages that are not yet due to be executed
@param shardName
@param itemsToPeek
@return
@throws MessageQueueException | [
"Peek",
"into",
"messages",
"contained",
"in",
"the",
"shard",
".",
"This",
"call",
"does",
"not",
"take",
"trigger",
"time",
"into",
"account",
"and",
"will",
"return",
"messages",
"that",
"are",
"not",
"yet",
"due",
"to",
"be",
"executed"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java#L1042-L1069 |
55,229 | Netflix/astyanax | astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java | ShardedDistributedMessageQueue.extractMessageFromColumn | Message extractMessageFromColumn(Column<MessageQueueEntry> column) {
// Next, parse the message metadata and add a timeout entry
Message message = null;
try {
ByteArrayInputStream bais = new ByteArrayInputStream(column.getByteArrayValue());
message = mapper.readValue(bais... | java | Message extractMessageFromColumn(Column<MessageQueueEntry> column) {
// Next, parse the message metadata and add a timeout entry
Message message = null;
try {
ByteArrayInputStream bais = new ByteArrayInputStream(column.getByteArrayValue());
message = mapper.readValue(bais... | [
"Message",
"extractMessageFromColumn",
"(",
"Column",
"<",
"MessageQueueEntry",
">",
"column",
")",
"{",
"// Next, parse the message metadata and add a timeout entry",
"Message",
"message",
"=",
"null",
";",
"try",
"{",
"ByteArrayInputStream",
"bais",
"=",
"new",
"ByteArr... | Extract a message body from a column
@param column
@return | [
"Extract",
"a",
"message",
"body",
"from",
"a",
"column"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java#L1076-L1092 |
55,230 | Netflix/astyanax | astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java | ShardedDistributedMessageQueue.hasMessages | private boolean hasMessages(String shardName) throws MessageQueueException {
UUID currentTime = TimeUUIDUtils.getUniqueTimeUUIDinMicros();
try {
ColumnList<MessageQueueEntry> result = keyspace.prepareQuery(queueColumnFamily)
.setConsistencyLevel(consistencyLevel)
... | java | private boolean hasMessages(String shardName) throws MessageQueueException {
UUID currentTime = TimeUUIDUtils.getUniqueTimeUUIDinMicros();
try {
ColumnList<MessageQueueEntry> result = keyspace.prepareQuery(queueColumnFamily)
.setConsistencyLevel(consistencyLevel)
... | [
"private",
"boolean",
"hasMessages",
"(",
"String",
"shardName",
")",
"throws",
"MessageQueueException",
"{",
"UUID",
"currentTime",
"=",
"TimeUUIDUtils",
".",
"getUniqueTimeUUIDinMicros",
"(",
")",
";",
"try",
"{",
"ColumnList",
"<",
"MessageQueueEntry",
">",
"resu... | Fast check to see if a shard has messages to process
@param shardName
@throws MessageQueueException | [
"Fast",
"check",
"to",
"see",
"if",
"a",
"shard",
"has",
"messages",
"to",
"process"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-queue/src/main/java/com/netflix/astyanax/recipes/queue/ShardedDistributedMessageQueue.java#L1099-L1125 |
55,231 | Netflix/astyanax | astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java | ColumnPrefixDistributedRowLock.verifyLock | public void verifyLock(long curTimeInMicros) throws Exception, BusyLockException, StaleLockException {
if (lockColumn == null)
throw new IllegalStateException("verifyLock() called without attempting to take the lock");
// Read back all columns. There should be only 1 if we got the ... | java | public void verifyLock(long curTimeInMicros) throws Exception, BusyLockException, StaleLockException {
if (lockColumn == null)
throw new IllegalStateException("verifyLock() called without attempting to take the lock");
// Read back all columns. There should be only 1 if we got the ... | [
"public",
"void",
"verifyLock",
"(",
"long",
"curTimeInMicros",
")",
"throws",
"Exception",
",",
"BusyLockException",
",",
"StaleLockException",
"{",
"if",
"(",
"lockColumn",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"verifyLock() called witho... | Verify that the lock was acquired. This shouldn't be called unless it's part of a recipe
built on top of ColumnPrefixDistributedRowLock.
@param curTimeInMicros
@throws BusyLockException | [
"Verify",
"that",
"the",
"lock",
"was",
"acquired",
".",
"This",
"shouldn",
"t",
"be",
"called",
"unless",
"it",
"s",
"part",
"of",
"a",
"recipe",
"built",
"on",
"top",
"of",
"ColumnPrefixDistributedRowLock",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java#L282-L303 |
55,232 | Netflix/astyanax | astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java | ColumnPrefixDistributedRowLock.release | @Override
public void release() throws Exception {
if (!locksToDelete.isEmpty() || lockColumn != null) {
MutationBatch m = keyspace.prepareMutationBatch().setConsistencyLevel(consistencyLevel);
fillReleaseMutation(m, false);
m.execute();
}
} | java | @Override
public void release() throws Exception {
if (!locksToDelete.isEmpty() || lockColumn != null) {
MutationBatch m = keyspace.prepareMutationBatch().setConsistencyLevel(consistencyLevel);
fillReleaseMutation(m, false);
m.execute();
}
} | [
"@",
"Override",
"public",
"void",
"release",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"locksToDelete",
".",
"isEmpty",
"(",
")",
"||",
"lockColumn",
"!=",
"null",
")",
"{",
"MutationBatch",
"m",
"=",
"keyspace",
".",
"prepareMutationBatch",
"... | Release the lock by releasing this and any other stale lock columns | [
"Release",
"the",
"lock",
"by",
"releasing",
"this",
"and",
"any",
"other",
"stale",
"lock",
"columns"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java#L308-L315 |
55,233 | Netflix/astyanax | astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java | ColumnPrefixDistributedRowLock.releaseLocks | public Map<String, Long> releaseLocks(boolean force) throws Exception {
Map<String, Long> locksToDelete = readLockColumns();
MutationBatch m = keyspace.prepareMutationBatch().setConsistencyLevel(consistencyLevel);
ColumnListMutation<String> row = m.withRow(columnFamily, key);
long now =... | java | public Map<String, Long> releaseLocks(boolean force) throws Exception {
Map<String, Long> locksToDelete = readLockColumns();
MutationBatch m = keyspace.prepareMutationBatch().setConsistencyLevel(consistencyLevel);
ColumnListMutation<String> row = m.withRow(columnFamily, key);
long now =... | [
"public",
"Map",
"<",
"String",
",",
"Long",
">",
"releaseLocks",
"(",
"boolean",
"force",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"Long",
">",
"locksToDelete",
"=",
"readLockColumns",
"(",
")",
";",
"MutationBatch",
"m",
"=",
"keyspace... | Delete locks columns. Set force=true to remove locks that haven't
expired yet.
This operation first issues a read to cassandra and then deletes columns
in the response.
@param force - Force delete of non expired locks as well
@return Map of locks released
@throws Exception | [
"Delete",
"locks",
"columns",
".",
"Set",
"force",
"=",
"true",
"to",
"remove",
"locks",
"that",
"haven",
"t",
"expired",
"yet",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java#L428-L442 |
55,234 | Netflix/astyanax | astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java | ColumnPrefixDistributedRowLock.generateTimeoutValue | private ByteBuffer generateTimeoutValue(long timeout) {
if (columnFamily.getDefaultValueSerializer() == ByteBufferSerializer.get() ||
columnFamily.getDefaultValueSerializer() == LongSerializer.get()) {
return LongSerializer.get().toByteBuffer(timeout);
}
else {
... | java | private ByteBuffer generateTimeoutValue(long timeout) {
if (columnFamily.getDefaultValueSerializer() == ByteBufferSerializer.get() ||
columnFamily.getDefaultValueSerializer() == LongSerializer.get()) {
return LongSerializer.get().toByteBuffer(timeout);
}
else {
... | [
"private",
"ByteBuffer",
"generateTimeoutValue",
"(",
"long",
"timeout",
")",
"{",
"if",
"(",
"columnFamily",
".",
"getDefaultValueSerializer",
"(",
")",
"==",
"ByteBufferSerializer",
".",
"get",
"(",
")",
"||",
"columnFamily",
".",
"getDefaultValueSerializer",
"(",... | Generate the expire time value to put in the column value.
@param timeout | [
"Generate",
"the",
"expire",
"time",
"value",
"to",
"put",
"in",
"the",
"column",
"value",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java#L482-L490 |
55,235 | Netflix/astyanax | astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java | ColumnPrefixDistributedRowLock.readTimeoutValue | public long readTimeoutValue(Column<?> column) {
if (columnFamily.getDefaultValueSerializer() == ByteBufferSerializer.get() ||
columnFamily.getDefaultValueSerializer() == LongSerializer.get()) {
return column.getLongValue();
}
else {
return Long.parseLong(colu... | java | public long readTimeoutValue(Column<?> column) {
if (columnFamily.getDefaultValueSerializer() == ByteBufferSerializer.get() ||
columnFamily.getDefaultValueSerializer() == LongSerializer.get()) {
return column.getLongValue();
}
else {
return Long.parseLong(colu... | [
"public",
"long",
"readTimeoutValue",
"(",
"Column",
"<",
"?",
">",
"column",
")",
"{",
"if",
"(",
"columnFamily",
".",
"getDefaultValueSerializer",
"(",
")",
"==",
"ByteBufferSerializer",
".",
"get",
"(",
")",
"||",
"columnFamily",
".",
"getDefaultValueSerializ... | Read the expiration time from the column value
@param column | [
"Read",
"the",
"expiration",
"time",
"from",
"the",
"column",
"value"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/ColumnPrefixDistributedRowLock.java#L496-L504 |
55,236 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/util/WriteAheadMutationBatchExecutor.java | WriteAheadMutationBatchExecutor.replayWal | public List<ListenableFuture<OperationResult<Void>>> replayWal(int count) {
List<ListenableFuture<OperationResult<Void>>> futures = Lists.newArrayList();
WriteAheadEntry walEntry;
while (null != (walEntry = wal.readNextEntry()) && count-- > 0) {
MutationBatch m = keyspace.prepareMuta... | java | public List<ListenableFuture<OperationResult<Void>>> replayWal(int count) {
List<ListenableFuture<OperationResult<Void>>> futures = Lists.newArrayList();
WriteAheadEntry walEntry;
while (null != (walEntry = wal.readNextEntry()) && count-- > 0) {
MutationBatch m = keyspace.prepareMuta... | [
"public",
"List",
"<",
"ListenableFuture",
"<",
"OperationResult",
"<",
"Void",
">",
">",
">",
"replayWal",
"(",
"int",
"count",
")",
"{",
"List",
"<",
"ListenableFuture",
"<",
"OperationResult",
"<",
"Void",
">>>",
"futures",
"=",
"Lists",
".",
"newArrayLis... | Replay records from the WAL | [
"Replay",
"records",
"from",
"the",
"WAL"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/util/WriteAheadMutationBatchExecutor.java#L71-L85 |
55,237 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/util/WriteAheadMutationBatchExecutor.java | WriteAheadMutationBatchExecutor.execute | public ListenableFuture<OperationResult<Void>> execute(final MutationBatch m) throws WalException {
final WriteAheadEntry walEntry = wal.createEntry();
walEntry.writeMutation(m);
return executeWalEntry(walEntry, m);
} | java | public ListenableFuture<OperationResult<Void>> execute(final MutationBatch m) throws WalException {
final WriteAheadEntry walEntry = wal.createEntry();
walEntry.writeMutation(m);
return executeWalEntry(walEntry, m);
} | [
"public",
"ListenableFuture",
"<",
"OperationResult",
"<",
"Void",
">",
">",
"execute",
"(",
"final",
"MutationBatch",
"m",
")",
"throws",
"WalException",
"{",
"final",
"WriteAheadEntry",
"walEntry",
"=",
"wal",
".",
"createEntry",
"(",
")",
";",
"walEntry",
"... | Write a mutation to the wal and execute it | [
"Write",
"a",
"mutation",
"to",
"the",
"wal",
"and",
"execute",
"it"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/util/WriteAheadMutationBatchExecutor.java#L90-L94 |
55,238 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java | Mapping.getColumnValue | public <V> V getColumnValue(T instance, String columnName,
Class<V> valueClass) {
Field field = fields.get(columnName);
if (field == null) {
throw new IllegalArgumentException("Column not found: "
+ columnName);
}
try {
return value... | java | public <V> V getColumnValue(T instance, String columnName,
Class<V> valueClass) {
Field field = fields.get(columnName);
if (field == null) {
throw new IllegalArgumentException("Column not found: "
+ columnName);
}
try {
return value... | [
"public",
"<",
"V",
">",
"V",
"getColumnValue",
"(",
"T",
"instance",
",",
"String",
"columnName",
",",
"Class",
"<",
"V",
">",
"valueClass",
")",
"{",
"Field",
"field",
"=",
"fields",
".",
"get",
"(",
"columnName",
")",
";",
"if",
"(",
"field",
"=="... | Return the value for the given column from the given instance
@param instance
the instance
@param columnName
name of the column (must match a corresponding annotated field
in the instance's class)
@param valueClass
type of the value (must match the actual native type in the
instance's class)
@return value | [
"Return",
"the",
"value",
"for",
"the",
"given",
"column",
"from",
"the",
"given",
"instance"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java#L180-L192 |
55,239 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java | Mapping.setColumnValue | public <V> void setColumnValue(T instance, String columnName, V value) {
Field field = fields.get(columnName);
if (field == null) {
throw new IllegalArgumentException("Column not found: "
+ columnName);
}
try {
field.set(instance, value);
... | java | public <V> void setColumnValue(T instance, String columnName, V value) {
Field field = fields.get(columnName);
if (field == null) {
throw new IllegalArgumentException("Column not found: "
+ columnName);
}
try {
field.set(instance, value);
... | [
"public",
"<",
"V",
">",
"void",
"setColumnValue",
"(",
"T",
"instance",
",",
"String",
"columnName",
",",
"V",
"value",
")",
"{",
"Field",
"field",
"=",
"fields",
".",
"get",
"(",
"columnName",
")",
";",
"if",
"(",
"field",
"==",
"null",
")",
"{",
... | Set the value for the given column for the given instance
@param instance
the instance
@param columnName
name of the column (must match a corresponding annotated field
in the instance's class)
@param value
The value (must match the actual native type in the instance's
class) | [
"Set",
"the",
"value",
"for",
"the",
"given",
"column",
"for",
"the",
"given",
"instance"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java#L219-L230 |
55,240 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java | Mapping.fillMutation | public void fillMutation(T instance, ColumnListMutation<String> mutation) {
for (String fieldName : getNames()) {
Coercions.setColumnMutationFromField(instance, fields.get(fieldName), fieldName, mutation);
}
} | java | public void fillMutation(T instance, ColumnListMutation<String> mutation) {
for (String fieldName : getNames()) {
Coercions.setColumnMutationFromField(instance, fields.get(fieldName), fieldName, mutation);
}
} | [
"public",
"void",
"fillMutation",
"(",
"T",
"instance",
",",
"ColumnListMutation",
"<",
"String",
">",
"mutation",
")",
"{",
"for",
"(",
"String",
"fieldName",
":",
"getNames",
"(",
")",
")",
"{",
"Coercions",
".",
"setColumnMutationFromField",
"(",
"instance"... | Map a bean to a column mutation. i.e. set the columns in the mutation to
the corresponding values from the instance
@param instance
instance
@param mutation
mutation | [
"Map",
"a",
"bean",
"to",
"a",
"column",
"mutation",
".",
"i",
".",
"e",
".",
"set",
"the",
"columns",
"in",
"the",
"mutation",
"to",
"the",
"corresponding",
"values",
"from",
"the",
"instance"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java#L241-L245 |
55,241 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java | Mapping.newInstance | public T newInstance(ColumnList<String> columns)
throws IllegalAccessException, InstantiationException {
return initInstance(clazz.newInstance(), columns);
} | java | public T newInstance(ColumnList<String> columns)
throws IllegalAccessException, InstantiationException {
return initInstance(clazz.newInstance(), columns);
} | [
"public",
"T",
"newInstance",
"(",
"ColumnList",
"<",
"String",
">",
"columns",
")",
"throws",
"IllegalAccessException",
",",
"InstantiationException",
"{",
"return",
"initInstance",
"(",
"clazz",
".",
"newInstance",
"(",
")",
",",
"columns",
")",
";",
"}"
] | Allocate a new instance and populate it with the values from the given
column list
@param columns
column list
@return the allocated instance
@throws IllegalAccessException
if a new instance could not be instantiated
@throws InstantiationException
if a new instance could not be instantiated | [
"Allocate",
"a",
"new",
"instance",
"and",
"populate",
"it",
"with",
"the",
"values",
"from",
"the",
"given",
"column",
"list"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java#L259-L262 |
55,242 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java | Mapping.initInstance | public T initInstance(T instance, ColumnList<String> columns) {
for (com.netflix.astyanax.model.Column<String> column : columns) {
Field field = fields.get(column.getName());
if (field != null) { // otherwise it may be a column that was
// removed, etc.
... | java | public T initInstance(T instance, ColumnList<String> columns) {
for (com.netflix.astyanax.model.Column<String> column : columns) {
Field field = fields.get(column.getName());
if (field != null) { // otherwise it may be a column that was
// removed, etc.
... | [
"public",
"T",
"initInstance",
"(",
"T",
"instance",
",",
"ColumnList",
"<",
"String",
">",
"columns",
")",
"{",
"for",
"(",
"com",
".",
"netflix",
".",
"astyanax",
".",
"model",
".",
"Column",
"<",
"String",
">",
"column",
":",
"columns",
")",
"{",
... | Populate the given instance with the values from the given column list
@param instance
instance
@param columns
column this
@return instance (as a convenience for chaining) | [
"Populate",
"the",
"given",
"instance",
"with",
"the",
"values",
"from",
"the",
"given",
"column",
"list"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java#L273-L282 |
55,243 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java | Mapping.getAll | public List<T> getAll(Rows<?, String> rows) throws InstantiationException,
IllegalAccessException {
List<T> list = Lists.newArrayList();
for (Row<?, String> row : rows) {
if (!row.getColumns().isEmpty()) {
list.add(newInstance(row.getColumns()));
}
... | java | public List<T> getAll(Rows<?, String> rows) throws InstantiationException,
IllegalAccessException {
List<T> list = Lists.newArrayList();
for (Row<?, String> row : rows) {
if (!row.getColumns().isEmpty()) {
list.add(newInstance(row.getColumns()));
}
... | [
"public",
"List",
"<",
"T",
">",
"getAll",
"(",
"Rows",
"<",
"?",
",",
"String",
">",
"rows",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"List",
"<",
"T",
">",
"list",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
... | Load a set of rows into new instances populated with values from the
column lists
@param rows
the rows
@return list of new instances
@throws IllegalAccessException
if a new instance could not be instantiated
@throws InstantiationException
if a new instance could not be instantiated | [
"Load",
"a",
"set",
"of",
"rows",
"into",
"new",
"instances",
"populated",
"with",
"values",
"from",
"the",
"column",
"lists"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/Mapping.java#L296-L305 |
55,244 | Netflix/astyanax | astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/CFRowKeysQueryGen.java | CFRowKeysQueryGen.getQueryStatement | public BoundStatement getQueryStatement(CqlRowSliceQueryImpl<?,?> rowSliceQuery, boolean useCaching) {
switch (rowSliceQuery.getColQueryType()) {
case AllColumns:
return SelectAllColumnsForRowKeys.getBoundStatement(rowSliceQuery, useCaching);
case ColumnSet:
return SelectColumnSetForRowKeys.getBoundState... | java | public BoundStatement getQueryStatement(CqlRowSliceQueryImpl<?,?> rowSliceQuery, boolean useCaching) {
switch (rowSliceQuery.getColQueryType()) {
case AllColumns:
return SelectAllColumnsForRowKeys.getBoundStatement(rowSliceQuery, useCaching);
case ColumnSet:
return SelectColumnSetForRowKeys.getBoundState... | [
"public",
"BoundStatement",
"getQueryStatement",
"(",
"CqlRowSliceQueryImpl",
"<",
"?",
",",
"?",
">",
"rowSliceQuery",
",",
"boolean",
"useCaching",
")",
"{",
"switch",
"(",
"rowSliceQuery",
".",
"getColQueryType",
"(",
")",
")",
"{",
"case",
"AllColumns",
":",... | Main method that is used to generate the java driver statement from the given Astyanax row slice query.
Note that the method allows the caller to specify whether to use caching or not.
If caching is disabled, then the PreparedStatement is generated every time
If caching is enabled, then the cached PreparedStatement is... | [
"Main",
"method",
"that",
"is",
"used",
"to",
"generate",
"the",
"java",
"driver",
"statement",
"from",
"the",
"given",
"Astyanax",
"row",
"slice",
"query",
".",
"Note",
"that",
"the",
"method",
"allows",
"the",
"caller",
"to",
"specify",
"whether",
"to",
... | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/CFRowKeysQueryGen.java#L266-L283 |
55,245 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/HostConnectionPoolPartition.java | HostConnectionPoolPartition.setPools | public synchronized boolean setPools(Collection<HostConnectionPool<CL>> newPools) {
Set<HostConnectionPool<CL>> toRemove = Sets.newHashSet(this.pools);
// Add new pools not previously seen
boolean didChange = false;
for (HostConnectionPool<CL> pool : newPools) {
if (... | java | public synchronized boolean setPools(Collection<HostConnectionPool<CL>> newPools) {
Set<HostConnectionPool<CL>> toRemove = Sets.newHashSet(this.pools);
// Add new pools not previously seen
boolean didChange = false;
for (HostConnectionPool<CL> pool : newPools) {
if (... | [
"public",
"synchronized",
"boolean",
"setPools",
"(",
"Collection",
"<",
"HostConnectionPool",
"<",
"CL",
">",
">",
"newPools",
")",
"{",
"Set",
"<",
"HostConnectionPool",
"<",
"CL",
">>",
"toRemove",
"=",
"Sets",
".",
"newHashSet",
"(",
"this",
".",
"pools"... | Sets all pools for this partition. Removes old partitions and adds new
one.
@param newPools | [
"Sets",
"all",
"pools",
"for",
"this",
"partition",
".",
"Removes",
"old",
"partitions",
"and",
"adds",
"new",
"one",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/HostConnectionPoolPartition.java#L64-L84 |
55,246 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/HostConnectionPoolPartition.java | HostConnectionPoolPartition.addPool | public synchronized boolean addPool(HostConnectionPool<CL> pool) {
if (this.pools.add(pool)) {
refresh();
return true;
}
return false;
} | java | public synchronized boolean addPool(HostConnectionPool<CL> pool) {
if (this.pools.add(pool)) {
refresh();
return true;
}
return false;
} | [
"public",
"synchronized",
"boolean",
"addPool",
"(",
"HostConnectionPool",
"<",
"CL",
">",
"pool",
")",
"{",
"if",
"(",
"this",
".",
"pools",
".",
"add",
"(",
"pool",
")",
")",
"{",
"refresh",
"(",
")",
";",
"return",
"true",
";",
"}",
"return",
"fal... | Add a new pool to the partition. Checks to see if the pool already
existed. If so then there is no need to refresh the pool.
@param pool
@return True if anything changed | [
"Add",
"a",
"new",
"pool",
"to",
"the",
"partition",
".",
"Checks",
"to",
"see",
"if",
"the",
"pool",
"already",
"existed",
".",
"If",
"so",
"then",
"there",
"is",
"no",
"need",
"to",
"refresh",
"the",
"pool",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/HostConnectionPoolPartition.java#L92-L98 |
55,247 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/HostConnectionPoolPartition.java | HostConnectionPoolPartition.refresh | public synchronized void refresh() {
List<HostConnectionPool<CL>> pools = Lists.newArrayList();
for (HostConnectionPool<CL> pool : this.pools) {
if (!pool.isReconnecting()) {
pools.add(pool);
}
}
this.activePools.set(strategy.sortAndfilterPartition... | java | public synchronized void refresh() {
List<HostConnectionPool<CL>> pools = Lists.newArrayList();
for (HostConnectionPool<CL> pool : this.pools) {
if (!pool.isReconnecting()) {
pools.add(pool);
}
}
this.activePools.set(strategy.sortAndfilterPartition... | [
"public",
"synchronized",
"void",
"refresh",
"(",
")",
"{",
"List",
"<",
"HostConnectionPool",
"<",
"CL",
">>",
"pools",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"(",
"HostConnectionPool",
"<",
"CL",
">",
"pool",
":",
"this",
".",
"pools"... | Refresh the partition | [
"Refresh",
"the",
"partition"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/HostConnectionPoolPartition.java#L135-L143 |
55,248 | Netflix/astyanax | astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/OneStepDistributedRowLock.java | OneStepDistributedRowLock.fillReleaseMutation | public void fillReleaseMutation(MutationBatch m, boolean excludeCurrentLock) {
// Add the deletes to the end of the mutation
ColumnListMutation<C> row = m.withRow(columnFamily, key);
for (C c : locksToDelete) {
row.deleteColumn(c);
}
if (!excludeCurrentLock && lockCol... | java | public void fillReleaseMutation(MutationBatch m, boolean excludeCurrentLock) {
// Add the deletes to the end of the mutation
ColumnListMutation<C> row = m.withRow(columnFamily, key);
for (C c : locksToDelete) {
row.deleteColumn(c);
}
if (!excludeCurrentLock && lockCol... | [
"public",
"void",
"fillReleaseMutation",
"(",
"MutationBatch",
"m",
",",
"boolean",
"excludeCurrentLock",
")",
"{",
"// Add the deletes to the end of the mutation",
"ColumnListMutation",
"<",
"C",
">",
"row",
"=",
"m",
".",
"withRow",
"(",
"columnFamily",
",",
"key",
... | Fill a mutation that will release the locks. This may be used from a
separate recipe to release multiple locks.
@param m | [
"Fill",
"a",
"mutation",
"that",
"will",
"release",
"the",
"locks",
".",
"This",
"may",
"be",
"used",
"from",
"a",
"separate",
"recipe",
"to",
"release",
"multiple",
"locks",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/locks/OneStepDistributedRowLock.java#L441-L451 |
55,249 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/shallows/EmptyCheckpointManager.java | EmptyCheckpointManager.trackCheckpoint | @Override
public void trackCheckpoint(String startToken, String checkpointToken) {
tokenMap.put(startToken, checkpointToken);
} | java | @Override
public void trackCheckpoint(String startToken, String checkpointToken) {
tokenMap.put(startToken, checkpointToken);
} | [
"@",
"Override",
"public",
"void",
"trackCheckpoint",
"(",
"String",
"startToken",
",",
"String",
"checkpointToken",
")",
"{",
"tokenMap",
".",
"put",
"(",
"startToken",
",",
"checkpointToken",
")",
";",
"}"
] | Do nothing since checkpoints aren't being persisted. | [
"Do",
"nothing",
"since",
"checkpoints",
"aren",
"t",
"being",
"persisted",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/shallows/EmptyCheckpointManager.java#L31-L34 |
55,250 | Netflix/astyanax | astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftConverter.java | ThriftConverter.getColumnParent | public static <K> ColumnParent getColumnParent(ColumnFamily<?, ?> columnFamily, ColumnPath<?> path)
throws BadRequestException {
ColumnParent cp = new ColumnParent();
cp.setColumn_family(columnFamily.getName());
if (path != null) {
Iterator<ByteBuffer> columns = path.iter... | java | public static <K> ColumnParent getColumnParent(ColumnFamily<?, ?> columnFamily, ColumnPath<?> path)
throws BadRequestException {
ColumnParent cp = new ColumnParent();
cp.setColumn_family(columnFamily.getName());
if (path != null) {
Iterator<ByteBuffer> columns = path.iter... | [
"public",
"static",
"<",
"K",
">",
"ColumnParent",
"getColumnParent",
"(",
"ColumnFamily",
"<",
"?",
",",
"?",
">",
"columnFamily",
",",
"ColumnPath",
"<",
"?",
">",
"path",
")",
"throws",
"BadRequestException",
"{",
"ColumnParent",
"cp",
"=",
"new",
"Column... | Construct a Hector ColumnParent based on the information in the query and
the type of column family being queried.
@param <K>
@param columnFamily
@param path
@return
@throws BadRequestException | [
"Construct",
"a",
"Hector",
"ColumnParent",
"based",
"on",
"the",
"information",
"in",
"the",
"query",
"and",
"the",
"type",
"of",
"column",
"family",
"being",
"queried",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftConverter.java#L68-L79 |
55,251 | Netflix/astyanax | astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftConverter.java | ThriftConverter.getColumnPath | public static <K> org.apache.cassandra.thrift.ColumnPath getColumnPath(ColumnFamily<?, ?> columnFamily,
ColumnPath<?> path) throws BadRequestException {
org.apache.cassandra.thrift.ColumnPath cp = new org.apache.cassandra.thrift.ColumnPath();
cp.setColumn_family(columnFamily.getName());
... | java | public static <K> org.apache.cassandra.thrift.ColumnPath getColumnPath(ColumnFamily<?, ?> columnFamily,
ColumnPath<?> path) throws BadRequestException {
org.apache.cassandra.thrift.ColumnPath cp = new org.apache.cassandra.thrift.ColumnPath();
cp.setColumn_family(columnFamily.getName());
... | [
"public",
"static",
"<",
"K",
">",
"org",
".",
"apache",
".",
"cassandra",
".",
"thrift",
".",
"ColumnPath",
"getColumnPath",
"(",
"ColumnFamily",
"<",
"?",
",",
"?",
">",
"columnFamily",
",",
"ColumnPath",
"<",
"?",
">",
"path",
")",
"throws",
"BadReque... | Construct a Thrift ColumnPath based on the information in the query and
the type of column family being queried.
@param <K>
@param columnFamily
@param path
@return
@throws NotFoundException
@throws InvalidRequestException
@throws TException | [
"Construct",
"a",
"Thrift",
"ColumnPath",
"based",
"on",
"the",
"information",
"in",
"the",
"query",
"and",
"the",
"type",
"of",
"column",
"family",
"being",
"queried",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftConverter.java#L93-L112 |
55,252 | Netflix/astyanax | astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftConverter.java | ThriftConverter.getPredicate | public static <C> SlicePredicate getPredicate(ColumnSlice<C> columns, Serializer<C> colSer) {
// Get all the columns
if (columns == null) {
SlicePredicate predicate = new SlicePredicate();
predicate.setSlice_range(new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new b... | java | public static <C> SlicePredicate getPredicate(ColumnSlice<C> columns, Serializer<C> colSer) {
// Get all the columns
if (columns == null) {
SlicePredicate predicate = new SlicePredicate();
predicate.setSlice_range(new SliceRange(ByteBuffer.wrap(new byte[0]), ByteBuffer.wrap(new b... | [
"public",
"static",
"<",
"C",
">",
"SlicePredicate",
"getPredicate",
"(",
"ColumnSlice",
"<",
"C",
">",
"columns",
",",
"Serializer",
"<",
"C",
">",
"colSer",
")",
"{",
"// Get all the columns",
"if",
"(",
"columns",
"==",
"null",
")",
"{",
"SlicePredicate",... | Return a Hector SlicePredicate based on the provided column slice
@param <C>
@param columns
@param colSer
@return | [
"Return",
"a",
"Hector",
"SlicePredicate",
"based",
"on",
"the",
"provided",
"column",
"slice"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftConverter.java#L122-L145 |
55,253 | Netflix/astyanax | astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftConverter.java | ThriftConverter.ToConnectionPoolException | public static ConnectionException ToConnectionPoolException(Throwable e) {
if (e instanceof ConnectionException) {
return (ConnectionException) e;
}
LOGGER.debug(e.getMessage());
if (e instanceof InvalidRequestException) {
return new com.netflix.astyanax.connectio... | java | public static ConnectionException ToConnectionPoolException(Throwable e) {
if (e instanceof ConnectionException) {
return (ConnectionException) e;
}
LOGGER.debug(e.getMessage());
if (e instanceof InvalidRequestException) {
return new com.netflix.astyanax.connectio... | [
"public",
"static",
"ConnectionException",
"ToConnectionPoolException",
"(",
"Throwable",
"e",
")",
"{",
"if",
"(",
"e",
"instanceof",
"ConnectionException",
")",
"{",
"return",
"(",
"ConnectionException",
")",
"e",
";",
"}",
"LOGGER",
".",
"debug",
"(",
"e",
... | Convert from Thrift exceptions to an internal ConnectionPoolException
@param e
@return | [
"Convert",
"from",
"Thrift",
"exceptions",
"to",
"an",
"internal",
"ConnectionPoolException"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftConverter.java#L153-L203 |
55,254 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java | SimpleHostConnectionPool.borrowConnection | @Override
public Connection<CL> borrowConnection(int timeout) throws ConnectionException {
Connection<CL> connection = null;
long startTime = System.currentTimeMillis();
try {
// Try to get a free connection without blocking.
connection = availableConnections.poll();
... | java | @Override
public Connection<CL> borrowConnection(int timeout) throws ConnectionException {
Connection<CL> connection = null;
long startTime = System.currentTimeMillis();
try {
// Try to get a free connection without blocking.
connection = availableConnections.poll();
... | [
"@",
"Override",
"public",
"Connection",
"<",
"CL",
">",
"borrowConnection",
"(",
"int",
"timeout",
")",
"throws",
"ConnectionException",
"{",
"Connection",
"<",
"CL",
">",
"connection",
"=",
"null",
";",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMi... | Create a connection as long the max hasn't been reached
@param timeout
- Max wait timeout if max connections have been allocated and
pool is empty. 0 to throw a MaxConnsPerHostReachedException.
@return
@throws TimeoutException
if timeout specified and no new connection is available
MaxConnsPerHostReachedException if m... | [
"Create",
"a",
"connection",
"as",
"long",
"the",
"max",
"hasn",
"t",
"been",
"reached"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java#L183-L212 |
55,255 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java | SimpleHostConnectionPool.waitForConnection | private Connection<CL> waitForConnection(int timeout) throws ConnectionException {
Connection<CL> connection = null;
long startTime = System.currentTimeMillis();
try {
blockedThreads.incrementAndGet();
connection = availableConnections.poll(timeout, TimeUnit.MILLISECONDS)... | java | private Connection<CL> waitForConnection(int timeout) throws ConnectionException {
Connection<CL> connection = null;
long startTime = System.currentTimeMillis();
try {
blockedThreads.incrementAndGet();
connection = availableConnections.poll(timeout, TimeUnit.MILLISECONDS)... | [
"private",
"Connection",
"<",
"CL",
">",
"waitForConnection",
"(",
"int",
"timeout",
")",
"throws",
"ConnectionException",
"{",
"Connection",
"<",
"CL",
">",
"connection",
"=",
"null",
";",
"long",
"startTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")"... | Internal method to wait for a connection from the available connection
pool.
@param timeout
@return
@throws ConnectionException | [
"Internal",
"method",
"to",
"wait",
"for",
"a",
"connection",
"from",
"the",
"available",
"connection",
"pool",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java#L222-L244 |
55,256 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java | SimpleHostConnectionPool.returnConnection | @Override
public boolean returnConnection(Connection<CL> connection) {
returnedCount.incrementAndGet();
monitor.incConnectionReturned(host);
ConnectionException ce = connection.getLastException();
if (ce != null) {
if (ce instanceof IsDeadConnectionException) {
... | java | @Override
public boolean returnConnection(Connection<CL> connection) {
returnedCount.incrementAndGet();
monitor.incConnectionReturned(host);
ConnectionException ce = connection.getLastException();
if (ce != null) {
if (ce instanceof IsDeadConnectionException) {
... | [
"@",
"Override",
"public",
"boolean",
"returnConnection",
"(",
"Connection",
"<",
"CL",
">",
"connection",
")",
"{",
"returnedCount",
".",
"incrementAndGet",
"(",
")",
";",
"monitor",
".",
"incConnectionReturned",
"(",
"host",
")",
";",
"ConnectionException",
"c... | Return a connection to this host
@param connection | [
"Return",
"a",
"connection",
"to",
"this",
"host"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java#L251-L283 |
55,257 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java | SimpleHostConnectionPool.markAsDown | @Override
public void markAsDown(ConnectionException reason) {
// Make sure we're not triggering the reconnect process more than once
if (isReconnecting.compareAndSet(false, true)) {
markedDownCount.incrementAndGet();
if (reason != null && !(reason i... | java | @Override
public void markAsDown(ConnectionException reason) {
// Make sure we're not triggering the reconnect process more than once
if (isReconnecting.compareAndSet(false, true)) {
markedDownCount.incrementAndGet();
if (reason != null && !(reason i... | [
"@",
"Override",
"public",
"void",
"markAsDown",
"(",
"ConnectionException",
"reason",
")",
"{",
"// Make sure we're not triggering the reconnect process more than once",
"if",
"(",
"isReconnecting",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"marke... | Mark the host as down. No new connections will be created from this host.
Connections currently in use will be allowed to continue processing. | [
"Mark",
"the",
"host",
"as",
"down",
".",
"No",
"new",
"connections",
"will",
"be",
"created",
"from",
"this",
"host",
".",
"Connections",
"currently",
"in",
"use",
"will",
"be",
"allowed",
"to",
"continue",
"processing",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java#L312-L367 |
55,258 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java | SimpleHostConnectionPool.tryOpenAsync | private boolean tryOpenAsync() {
Connection<CL> connection = null;
// Try to open a new connection, as long as we haven't reached the max
if (activeCount.get() < config.getMaxConnsPerHost()) {
try {
if (activeCount.incrementAndGet() <= config.getMaxConnsPerHost()) {
... | java | private boolean tryOpenAsync() {
Connection<CL> connection = null;
// Try to open a new connection, as long as we haven't reached the max
if (activeCount.get() < config.getMaxConnsPerHost()) {
try {
if (activeCount.incrementAndGet() <= config.getMaxConnsPerHost()) {
... | [
"private",
"boolean",
"tryOpenAsync",
"(",
")",
"{",
"Connection",
"<",
"CL",
">",
"connection",
"=",
"null",
";",
"// Try to open a new connection, as long as we haven't reached the max",
"if",
"(",
"activeCount",
".",
"get",
"(",
")",
"<",
"config",
".",
"getMaxCo... | Try to open a new connection asynchronously. We don't actually return a
connection here. Instead, the connection will be added to idle queue when
it's ready. | [
"Try",
"to",
"open",
"a",
"new",
"connection",
"asynchronously",
".",
"We",
"don",
"t",
"actually",
"return",
"a",
"connection",
"here",
".",
"Instead",
"the",
"connection",
"will",
"be",
"added",
"to",
"idle",
"queue",
"when",
"it",
"s",
"ready",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java#L416-L474 |
55,259 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java | SimpleHostConnectionPool.discardIdleConnections | private void discardIdleConnections() {
List<Connection<CL>> connections = Lists.newArrayList();
availableConnections.drainTo(connections);
activeCount.addAndGet(-connections.size());
for (Connection<CL> connection : connections) {
try {
closedConnections.inc... | java | private void discardIdleConnections() {
List<Connection<CL>> connections = Lists.newArrayList();
availableConnections.drainTo(connections);
activeCount.addAndGet(-connections.size());
for (Connection<CL> connection : connections) {
try {
closedConnections.inc... | [
"private",
"void",
"discardIdleConnections",
"(",
")",
"{",
"List",
"<",
"Connection",
"<",
"CL",
">>",
"connections",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"availableConnections",
".",
"drainTo",
"(",
"connections",
")",
";",
"activeCount",
".",
... | Drain all idle connections and close them. Connections that are currently borrowed
will not be closed here. | [
"Drain",
"all",
"idle",
"connections",
"and",
"close",
"them",
".",
"Connections",
"that",
"are",
"currently",
"borrowed",
"will",
"not",
"be",
"closed",
"here",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/SimpleHostConnectionPool.java#L555-L569 |
55,260 | Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java | CompositeColumnEntityMapper.fillMutationBatch | public void fillMutationBatch(ColumnListMutation<ByteBuffer> clm, Object entity) throws IllegalArgumentException, IllegalAccessException {
List<?> list = (List<?>) containerField.get(entity);
if (list != null) {
for (Object element : list) {
fillColumnMutation(clm, element);
... | java | public void fillMutationBatch(ColumnListMutation<ByteBuffer> clm, Object entity) throws IllegalArgumentException, IllegalAccessException {
List<?> list = (List<?>) containerField.get(entity);
if (list != null) {
for (Object element : list) {
fillColumnMutation(clm, element);
... | [
"public",
"void",
"fillMutationBatch",
"(",
"ColumnListMutation",
"<",
"ByteBuffer",
">",
"clm",
",",
"Object",
"entity",
")",
"throws",
"IllegalArgumentException",
",",
"IllegalAccessException",
"{",
"List",
"<",
"?",
">",
"list",
"=",
"(",
"List",
"<",
"?",
... | Iterate through the list and create a column for each element
@param clm
@param entity
@throws IllegalArgumentException
@throws IllegalAccessException | [
"Iterate",
"through",
"the",
"list",
"and",
"create",
"a",
"column",
"for",
"each",
"element"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java#L111-L118 |
55,261 | Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java | CompositeColumnEntityMapper.fillColumnMutation | public void fillColumnMutation(ColumnListMutation<ByteBuffer> clm, Object entity) {
try {
ByteBuffer columnName = toColumnName(entity);
ByteBuffer value = valueMapper.toByteBuffer(entity);
clm.putColumn(columnName, value);
} catch(Exception e) {
... | java | public void fillColumnMutation(ColumnListMutation<ByteBuffer> clm, Object entity) {
try {
ByteBuffer columnName = toColumnName(entity);
ByteBuffer value = valueMapper.toByteBuffer(entity);
clm.putColumn(columnName, value);
} catch(Exception e) {
... | [
"public",
"void",
"fillColumnMutation",
"(",
"ColumnListMutation",
"<",
"ByteBuffer",
">",
"clm",
",",
"Object",
"entity",
")",
"{",
"try",
"{",
"ByteBuffer",
"columnName",
"=",
"toColumnName",
"(",
"entity",
")",
";",
"ByteBuffer",
"value",
"=",
"valueMapper",
... | Add a column based on the provided entity
@param clm
@param entity | [
"Add",
"a",
"column",
"based",
"on",
"the",
"provided",
"entity"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java#L138-L147 |
55,262 | Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java | CompositeColumnEntityMapper.setField | public boolean setField(Object entity, ColumnList<ByteBuffer> columns) throws Exception {
List<Object> list = getOrCreateField(entity);
// Iterate through columns and add embedded entities to the list
for (com.netflix.astyanax.model.Column<ByteBuffer> c : columns) {
list... | java | public boolean setField(Object entity, ColumnList<ByteBuffer> columns) throws Exception {
List<Object> list = getOrCreateField(entity);
// Iterate through columns and add embedded entities to the list
for (com.netflix.astyanax.model.Column<ByteBuffer> c : columns) {
list... | [
"public",
"boolean",
"setField",
"(",
"Object",
"entity",
",",
"ColumnList",
"<",
"ByteBuffer",
">",
"columns",
")",
"throws",
"Exception",
"{",
"List",
"<",
"Object",
">",
"list",
"=",
"getOrCreateField",
"(",
"entity",
")",
";",
"// Iterate through columns and... | Set the collection field using the provided column list of embedded entities
@param entity
@param name
@param column
@return
@throws Exception | [
"Set",
"the",
"collection",
"field",
"using",
"the",
"provided",
"column",
"list",
"of",
"embedded",
"entities"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeColumnEntityMapper.java#L178-L187 |
55,263 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/serializers/ByteBufferOutputStream.java | ByteBufferOutputStream.getBufferList | public List<ByteBuffer> getBufferList() {
List<ByteBuffer> result = buffers;
reset();
for (ByteBuffer buffer : result) {
buffer.flip();
}
return result;
} | java | public List<ByteBuffer> getBufferList() {
List<ByteBuffer> result = buffers;
reset();
for (ByteBuffer buffer : result) {
buffer.flip();
}
return result;
} | [
"public",
"List",
"<",
"ByteBuffer",
">",
"getBufferList",
"(",
")",
"{",
"List",
"<",
"ByteBuffer",
">",
"result",
"=",
"buffers",
";",
"reset",
"(",
")",
";",
"for",
"(",
"ByteBuffer",
"buffer",
":",
"result",
")",
"{",
"buffer",
".",
"flip",
"(",
... | Returns all data written and resets the stream to be empty. | [
"Returns",
"all",
"data",
"written",
"and",
"resets",
"the",
"stream",
"to",
"be",
"empty",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/serializers/ByteBufferOutputStream.java#L60-L67 |
55,264 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/serializers/ByteBufferOutputStream.java | ByteBufferOutputStream.prepend | public void prepend(List<ByteBuffer> lists) {
for (ByteBuffer buffer : lists) {
buffer.position(buffer.limit());
}
buffers.addAll(0, lists);
} | java | public void prepend(List<ByteBuffer> lists) {
for (ByteBuffer buffer : lists) {
buffer.position(buffer.limit());
}
buffers.addAll(0, lists);
} | [
"public",
"void",
"prepend",
"(",
"List",
"<",
"ByteBuffer",
">",
"lists",
")",
"{",
"for",
"(",
"ByteBuffer",
"buffer",
":",
"lists",
")",
"{",
"buffer",
".",
"position",
"(",
"buffer",
".",
"limit",
"(",
")",
")",
";",
"}",
"buffers",
".",
"addAll"... | Prepend a list of ByteBuffers to this stream. | [
"Prepend",
"a",
"list",
"of",
"ByteBuffers",
"to",
"this",
"stream",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/serializers/ByteBufferOutputStream.java#L87-L92 |
55,265 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/model/ColumnPath.java | ColumnPath.append | public <C2> ColumnPath<C> append(C2 name, Serializer<C2> ser) {
path.add(ByteBuffer.wrap(ser.toBytes(name)));
return this;
} | java | public <C2> ColumnPath<C> append(C2 name, Serializer<C2> ser) {
path.add(ByteBuffer.wrap(ser.toBytes(name)));
return this;
} | [
"public",
"<",
"C2",
">",
"ColumnPath",
"<",
"C",
">",
"append",
"(",
"C2",
"name",
",",
"Serializer",
"<",
"C2",
">",
"ser",
")",
"{",
"path",
".",
"add",
"(",
"ByteBuffer",
".",
"wrap",
"(",
"ser",
".",
"toBytes",
"(",
"name",
")",
")",
")",
... | Add a depth to the path
@param <C>
@param ser
@param name
@return | [
"Add",
"a",
"depth",
"to",
"the",
"path"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/model/ColumnPath.java#L76-L79 |
55,266 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/util/TimeUUIDUtils.java | TimeUUIDUtils.getUniqueTimeUUIDinMillis | public static java.util.UUID getUniqueTimeUUIDinMillis() {
return new java.util.UUID(UUIDGen.newTime(), UUIDGen.getClockSeqAndNode());
} | java | public static java.util.UUID getUniqueTimeUUIDinMillis() {
return new java.util.UUID(UUIDGen.newTime(), UUIDGen.getClockSeqAndNode());
} | [
"public",
"static",
"java",
".",
"util",
".",
"UUID",
"getUniqueTimeUUIDinMillis",
"(",
")",
"{",
"return",
"new",
"java",
".",
"util",
".",
"UUID",
"(",
"UUIDGen",
".",
"newTime",
"(",
")",
",",
"UUIDGen",
".",
"getClockSeqAndNode",
"(",
")",
")",
";",
... | Gets a new and unique time uuid in milliseconds. It is useful to use in a
TimeUUIDType sorted column family.
@return the time uuid | [
"Gets",
"a",
"new",
"and",
"unique",
"time",
"uuid",
"in",
"milliseconds",
".",
"It",
"is",
"useful",
"to",
"use",
"in",
"a",
"TimeUUIDType",
"sorted",
"column",
"family",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/util/TimeUUIDUtils.java#L42-L44 |
55,267 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/util/TimeUUIDUtils.java | TimeUUIDUtils.asByteBuffer | public static ByteBuffer asByteBuffer(java.util.UUID uuid) {
if (uuid == null) {
return null;
}
return ByteBuffer.wrap(asByteArray(uuid));
} | java | public static ByteBuffer asByteBuffer(java.util.UUID uuid) {
if (uuid == null) {
return null;
}
return ByteBuffer.wrap(asByteArray(uuid));
} | [
"public",
"static",
"ByteBuffer",
"asByteBuffer",
"(",
"java",
".",
"util",
".",
"UUID",
"uuid",
")",
"{",
"if",
"(",
"uuid",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"ByteBuffer",
".",
"wrap",
"(",
"asByteArray",
"(",
"uuid",
")",... | Coverts a java.util.UUID into a ByteBuffer.
@param uuid
a java.util.UUID
@return a ByteBuffer representaion of the param UUID | [
"Coverts",
"a",
"java",
".",
"util",
".",
"UUID",
"into",
"a",
"ByteBuffer",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/util/TimeUUIDUtils.java#L179-L185 |
55,268 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/util/TimeUUIDUtils.java | TimeUUIDUtils.uuid | public static UUID uuid(ByteBuffer bb) {
bb = bb.slice();
return new UUID(bb.getLong(), bb.getLong());
} | java | public static UUID uuid(ByteBuffer bb) {
bb = bb.slice();
return new UUID(bb.getLong(), bb.getLong());
} | [
"public",
"static",
"UUID",
"uuid",
"(",
"ByteBuffer",
"bb",
")",
"{",
"bb",
"=",
"bb",
".",
"slice",
"(",
")",
";",
"return",
"new",
"UUID",
"(",
"bb",
".",
"getLong",
"(",
")",
",",
"bb",
".",
"getLong",
"(",
")",
")",
";",
"}"
] | Converts a ByteBuffer containing a UUID into a java.util.UUID
@param bb
a ByteBuffer containing a UUID
@return a java.util.UUID | [
"Converts",
"a",
"ByteBuffer",
"containing",
"a",
"UUID",
"into",
"a",
"java",
".",
"util",
".",
"UUID"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/util/TimeUUIDUtils.java#L199-L202 |
55,269 | Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java | CompositeEntityMapper.toColumnName | private ByteBuffer toColumnName(Object obj) {
SimpleCompositeBuilder composite = new SimpleCompositeBuilder(bufferSize, Equality.EQUAL);
// Iterate through each component and add to a CompositeType structure
for (FieldMapper<?> mapper : components) {
try {
composite.... | java | private ByteBuffer toColumnName(Object obj) {
SimpleCompositeBuilder composite = new SimpleCompositeBuilder(bufferSize, Equality.EQUAL);
// Iterate through each component and add to a CompositeType structure
for (FieldMapper<?> mapper : components) {
try {
composite.... | [
"private",
"ByteBuffer",
"toColumnName",
"(",
"Object",
"obj",
")",
"{",
"SimpleCompositeBuilder",
"composite",
"=",
"new",
"SimpleCompositeBuilder",
"(",
"bufferSize",
",",
"Equality",
".",
"EQUAL",
")",
";",
"// Iterate through each component and add to a CompositeType st... | Return the column name byte buffer for this entity
@param obj
@return | [
"Return",
"the",
"column",
"name",
"byte",
"buffer",
"for",
"this",
"entity"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java#L226-L239 |
55,270 | Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java | CompositeEntityMapper.constructEntity | T constructEntity(K id, com.netflix.astyanax.model.Column<ByteBuffer> column) {
try {
// First, construct the parent class and give it an id
T entity = clazz.newInstance();
idMapper.setValue(entity, id);
setEntityFieldsFromColumnName(entity, column.getRawName().du... | java | T constructEntity(K id, com.netflix.astyanax.model.Column<ByteBuffer> column) {
try {
// First, construct the parent class and give it an id
T entity = clazz.newInstance();
idMapper.setValue(entity, id);
setEntityFieldsFromColumnName(entity, column.getRawName().du... | [
"T",
"constructEntity",
"(",
"K",
"id",
",",
"com",
".",
"netflix",
".",
"astyanax",
".",
"model",
".",
"Column",
"<",
"ByteBuffer",
">",
"column",
")",
"{",
"try",
"{",
"// First, construct the parent class and give it an id",
"T",
"entity",
"=",
"clazz",
"."... | Construct an entity object from a row key and column list.
@param id
@param cl
@return | [
"Construct",
"an",
"entity",
"object",
"from",
"a",
"row",
"key",
"and",
"column",
"list",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java#L248-L259 |
55,271 | Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java | CompositeEntityMapper.fromColumn | Object fromColumn(K id, com.netflix.astyanax.model.Column<ByteBuffer> c) {
try {
// Allocate a new entity
Object entity = clazz.newInstance();
idMapper.setValue(entity, id);
setEntityFieldsFromColumnName(entity, c.getRawName().duplicate());
... | java | Object fromColumn(K id, com.netflix.astyanax.model.Column<ByteBuffer> c) {
try {
// Allocate a new entity
Object entity = clazz.newInstance();
idMapper.setValue(entity, id);
setEntityFieldsFromColumnName(entity, c.getRawName().duplicate());
... | [
"Object",
"fromColumn",
"(",
"K",
"id",
",",
"com",
".",
"netflix",
".",
"astyanax",
".",
"model",
".",
"Column",
"<",
"ByteBuffer",
">",
"c",
")",
"{",
"try",
"{",
"// Allocate a new entity",
"Object",
"entity",
"=",
"clazz",
".",
"newInstance",
"(",
")... | Return an object from the column
@param cl
@return | [
"Return",
"an",
"object",
"from",
"the",
"column"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java#L312-L324 |
55,272 | Netflix/astyanax | astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java | CompositeEntityMapper.getComparatorType | public String getComparatorType() {
StringBuilder sb = new StringBuilder();
sb.append("CompositeType(");
sb.append(StringUtils.join(
Collections2.transform(components, new Function<FieldMapper<?>, String>() {
public String apply(FieldMapper<?> input) {
... | java | public String getComparatorType() {
StringBuilder sb = new StringBuilder();
sb.append("CompositeType(");
sb.append(StringUtils.join(
Collections2.transform(components, new Function<FieldMapper<?>, String>() {
public String apply(FieldMapper<?> input) {
... | [
"public",
"String",
"getComparatorType",
"(",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"sb",
".",
"append",
"(",
"\"CompositeType(\"",
")",
";",
"sb",
".",
"append",
"(",
"StringUtils",
".",
"join",
"(",
"Collections2",
... | Return the cassandra comparator type for this composite structure
@return | [
"Return",
"the",
"cassandra",
"comparator",
"type",
"for",
"this",
"composite",
"structure"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-entity-mapper/src/main/java/com/netflix/astyanax/entitystore/CompositeEntityMapper.java#L356-L368 |
55,273 | Netflix/astyanax | astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/uniqueness/RowUniquenessConstraint.java | RowUniquenessConstraint.readData | public ByteBuffer readData() throws Exception {
ColumnList<C> result = keyspace
.prepareQuery(columnFamily)
.setConsistencyLevel(consistencyLevel)
.getKey(key)
.execute()
.getResult();
boolean hasColumn ... | java | public ByteBuffer readData() throws Exception {
ColumnList<C> result = keyspace
.prepareQuery(columnFamily)
.setConsistencyLevel(consistencyLevel)
.getKey(key)
.execute()
.getResult();
boolean hasColumn ... | [
"public",
"ByteBuffer",
"readData",
"(",
")",
"throws",
"Exception",
"{",
"ColumnList",
"<",
"C",
">",
"result",
"=",
"keyspace",
".",
"prepareQuery",
"(",
"columnFamily",
")",
".",
"setConsistencyLevel",
"(",
"consistencyLevel",
")",
".",
"getKey",
"(",
"key"... | Read the data stored with the unique row. This data is normally a 'foreign' key to
another column family.
@return
@throws Exception | [
"Read",
"the",
"data",
"stored",
"with",
"the",
"unique",
"row",
".",
"This",
"data",
"is",
"normally",
"a",
"foreign",
"key",
"to",
"another",
"column",
"family",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/uniqueness/RowUniquenessConstraint.java#L156-L180 |
55,274 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/util/Callables.java | Callables.decorateWithBarrier | public static <T> Callable<T> decorateWithBarrier(CyclicBarrier barrier, Callable<T> callable) {
return new BarrierCallableDecorator<T>(barrier, callable);
} | java | public static <T> Callable<T> decorateWithBarrier(CyclicBarrier barrier, Callable<T> callable) {
return new BarrierCallableDecorator<T>(barrier, callable);
} | [
"public",
"static",
"<",
"T",
">",
"Callable",
"<",
"T",
">",
"decorateWithBarrier",
"(",
"CyclicBarrier",
"barrier",
",",
"Callable",
"<",
"T",
">",
"callable",
")",
"{",
"return",
"new",
"BarrierCallableDecorator",
"<",
"T",
">",
"(",
"barrier",
",",
"ca... | Create a callable that waits on a barrier before starting execution
@param barrier
@param callable
@return | [
"Create",
"a",
"callable",
"that",
"waits",
"on",
"a",
"barrier",
"before",
"starting",
"execution"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/util/Callables.java#L28-L30 |
55,275 | Netflix/astyanax | astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java | ThriftKeyspaceImpl.executeDdlOperation | private synchronized <R> OperationResult<R> executeDdlOperation(AbstractOperationImpl<R> operation, RetryPolicy retry)
throws OperationException, ConnectionException {
ConnectionException lastException = null;
for (int i = 0; i < 2; i++) {
operation.setPinnedHost(ddlHost);
... | java | private synchronized <R> OperationResult<R> executeDdlOperation(AbstractOperationImpl<R> operation, RetryPolicy retry)
throws OperationException, ConnectionException {
ConnectionException lastException = null;
for (int i = 0; i < 2; i++) {
operation.setPinnedHost(ddlHost);
... | [
"private",
"synchronized",
"<",
"R",
">",
"OperationResult",
"<",
"R",
">",
"executeDdlOperation",
"(",
"AbstractOperationImpl",
"<",
"R",
">",
"operation",
",",
"RetryPolicy",
"retry",
")",
"throws",
"OperationException",
",",
"ConnectionException",
"{",
"Connectio... | Attempt to execute the DDL operation on the same host
@param operation
@param retry
@return
@throws OperationException
@throws ConnectionException | [
"Attempt",
"to",
"execute",
"the",
"DDL",
"operation",
"on",
"the",
"same",
"host"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java#L529-L547 |
55,276 | Netflix/astyanax | astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java | ThriftKeyspaceImpl.precheckSchemaAgreement | private void precheckSchemaAgreement(Client client) throws Exception {
Map<String, List<String>> schemas = client.describe_schema_versions();
if (schemas.size() > 1) {
throw new SchemaDisagreementException("Can't change schema due to pending schema agreement");
}
} | java | private void precheckSchemaAgreement(Client client) throws Exception {
Map<String, List<String>> schemas = client.describe_schema_versions();
if (schemas.size() > 1) {
throw new SchemaDisagreementException("Can't change schema due to pending schema agreement");
}
} | [
"private",
"void",
"precheckSchemaAgreement",
"(",
"Client",
"client",
")",
"throws",
"Exception",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"schemas",
"=",
"client",
".",
"describe_schema_versions",
"(",
")",
";",
"if",
"(",
"schemas"... | Do a quick check to see if there is a schema disagreement. This is done as an extra precaution
to reduce the chances of putting the cluster into a bad state. This will not gurantee however, that
by the time a schema change is made the cluster will be in the same state.
@param client
@throws Exception | [
"Do",
"a",
"quick",
"check",
"to",
"see",
"if",
"there",
"is",
"a",
"schema",
"disagreement",
".",
"This",
"is",
"done",
"as",
"an",
"extra",
"precaution",
"to",
"reduce",
"the",
"chances",
"of",
"putting",
"the",
"cluster",
"into",
"a",
"bad",
"state",
... | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java#L762-L767 |
55,277 | Netflix/astyanax | astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java | ThriftKeyspaceImpl.toThriftColumnFamilyDefinition | private ThriftColumnFamilyDefinitionImpl toThriftColumnFamilyDefinition(Map<String, Object> options, ColumnFamily columnFamily) {
ThriftColumnFamilyDefinitionImpl def = new ThriftColumnFamilyDefinitionImpl();
Map<String, Object> internalOptions = Maps.newHashMap();
if (options != null)
... | java | private ThriftColumnFamilyDefinitionImpl toThriftColumnFamilyDefinition(Map<String, Object> options, ColumnFamily columnFamily) {
ThriftColumnFamilyDefinitionImpl def = new ThriftColumnFamilyDefinitionImpl();
Map<String, Object> internalOptions = Maps.newHashMap();
if (options != null)
... | [
"private",
"ThriftColumnFamilyDefinitionImpl",
"toThriftColumnFamilyDefinition",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
",",
"ColumnFamily",
"columnFamily",
")",
"{",
"ThriftColumnFamilyDefinitionImpl",
"def",
"=",
"new",
"ThriftColumnFamilyDefinitionImpl",... | Convert a Map of options to an internal thrift column family definition
@param options | [
"Convert",
"a",
"Map",
"of",
"options",
"to",
"an",
"internal",
"thrift",
"column",
"family",
"definition"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java#L773-L794 |
55,278 | Netflix/astyanax | astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java | ThriftKeyspaceImpl.toThriftKeyspaceDefinition | private ThriftKeyspaceDefinitionImpl toThriftKeyspaceDefinition(final Map<String, Object> options) {
ThriftKeyspaceDefinitionImpl def = new ThriftKeyspaceDefinitionImpl();
Map<String, Object> internalOptions = Maps.newHashMap();
if (options != null)
internalOptions.putAll(op... | java | private ThriftKeyspaceDefinitionImpl toThriftKeyspaceDefinition(final Map<String, Object> options) {
ThriftKeyspaceDefinitionImpl def = new ThriftKeyspaceDefinitionImpl();
Map<String, Object> internalOptions = Maps.newHashMap();
if (options != null)
internalOptions.putAll(op... | [
"private",
"ThriftKeyspaceDefinitionImpl",
"toThriftKeyspaceDefinition",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
")",
"{",
"ThriftKeyspaceDefinitionImpl",
"def",
"=",
"new",
"ThriftKeyspaceDefinitionImpl",
"(",
")",
";",
"Map",
"<",
"String"... | Convert a Map of options to an internal thrift keyspace definition
@param options | [
"Convert",
"a",
"Map",
"of",
"options",
"to",
"an",
"internal",
"thrift",
"keyspace",
"definition"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java#L800-L819 |
55,279 | Netflix/astyanax | astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/CqlAllRowsQueryImpl.java | CqlAllRowsQueryImpl.startTasks | private List<Future<Boolean>> startTasks(ExecutorService executor, List<Callable<Boolean>> callables) {
List<Future<Boolean>> tasks = Lists.newArrayList();
for (Callable<Boolean> callable : callables) {
tasks.add(executor.submit(callable));
}
return tasks;
} | java | private List<Future<Boolean>> startTasks(ExecutorService executor, List<Callable<Boolean>> callables) {
List<Future<Boolean>> tasks = Lists.newArrayList();
for (Callable<Boolean> callable : callables) {
tasks.add(executor.submit(callable));
}
return tasks;
} | [
"private",
"List",
"<",
"Future",
"<",
"Boolean",
">",
">",
"startTasks",
"(",
"ExecutorService",
"executor",
",",
"List",
"<",
"Callable",
"<",
"Boolean",
">",
">",
"callables",
")",
"{",
"List",
"<",
"Future",
"<",
"Boolean",
">>",
"tasks",
"=",
"Lists... | Submit all the callables to the executor by synchronize their execution so they all start
AFTER the have all been submitted.
@param executor
@param callables
@return | [
"Submit",
"all",
"the",
"callables",
"to",
"the",
"executor",
"by",
"synchronize",
"their",
"execution",
"so",
"they",
"all",
"start",
"AFTER",
"the",
"have",
"all",
"been",
"submitted",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/CqlAllRowsQueryImpl.java#L434-L440 |
55,280 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/MappingUtil.java | MappingUtil.remove | public <T, K> void remove(ColumnFamily<K, String> columnFamily, T item)
throws Exception {
@SuppressWarnings({ "unchecked" })
Class<T> clazz = (Class<T>) item.getClass();
Mapping<T> mapping = getMapping(clazz);
@SuppressWarnings({ "unchecked" })
Class<K> idFieldClass ... | java | public <T, K> void remove(ColumnFamily<K, String> columnFamily, T item)
throws Exception {
@SuppressWarnings({ "unchecked" })
Class<T> clazz = (Class<T>) item.getClass();
Mapping<T> mapping = getMapping(clazz);
@SuppressWarnings({ "unchecked" })
Class<K> idFieldClass ... | [
"public",
"<",
"T",
",",
"K",
">",
"void",
"remove",
"(",
"ColumnFamily",
"<",
"K",
",",
"String",
">",
"columnFamily",
",",
"T",
"item",
")",
"throws",
"Exception",
"{",
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
"}",
")",
"Class",
"<",
"T",
... | Remove the given item
@param columnFamily
column family of the item
@param item
the item to remove
@throws Exception
errors | [
"Remove",
"the",
"given",
"item"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/MappingUtil.java#L92-L111 |
55,281 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/MappingUtil.java | MappingUtil.getAll | public <T, K> List<T> getAll(ColumnFamily<K, String> columnFamily,
Class<T> itemClass) throws Exception {
Mapping<T> mapping = getMapping(itemClass);
Rows<K, String> result = keyspace.prepareQuery(columnFamily)
.getAllRows().execute().getResult();
return mapping.getAl... | java | public <T, K> List<T> getAll(ColumnFamily<K, String> columnFamily,
Class<T> itemClass) throws Exception {
Mapping<T> mapping = getMapping(itemClass);
Rows<K, String> result = keyspace.prepareQuery(columnFamily)
.getAllRows().execute().getResult();
return mapping.getAl... | [
"public",
"<",
"T",
",",
"K",
">",
"List",
"<",
"T",
">",
"getAll",
"(",
"ColumnFamily",
"<",
"K",
",",
"String",
">",
"columnFamily",
",",
"Class",
"<",
"T",
">",
"itemClass",
")",
"throws",
"Exception",
"{",
"Mapping",
"<",
"T",
">",
"mapping",
"... | Get all rows of the specified item
@param columnFamily
column family of the item
@param itemClass
item's class
@return new instances with the item's columns propagated
@throws Exception
errors | [
"Get",
"all",
"rows",
"of",
"the",
"specified",
"item"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/MappingUtil.java#L178-L184 |
55,282 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/MappingUtil.java | MappingUtil.getMapping | public <T> Mapping<T> getMapping(Class<T> clazz) {
return (cache != null) ? cache.getMapping(clazz, annotationSet)
: new Mapping<T>(clazz, annotationSet);
} | java | public <T> Mapping<T> getMapping(Class<T> clazz) {
return (cache != null) ? cache.getMapping(clazz, annotationSet)
: new Mapping<T>(clazz, annotationSet);
} | [
"public",
"<",
"T",
">",
"Mapping",
"<",
"T",
">",
"getMapping",
"(",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"(",
"cache",
"!=",
"null",
")",
"?",
"cache",
".",
"getMapping",
"(",
"clazz",
",",
"annotationSet",
")",
":",
"new",
"Mappi... | Return the mapping instance for the given class
@param clazz
the class
@return mapping instance (new or from cache) | [
"Return",
"the",
"mapping",
"instance",
"for",
"the",
"given",
"class"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/mapping/MappingUtil.java#L193-L196 |
55,283 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java | AbstractHostPartitionConnectionPool.start | @Override
public void start() {
ConnectionPoolMBeanManager.getInstance().registerMonitor(config.getName(), this);
String seeds = config.getSeeds();
if (seeds != null && !seeds.isEmpty()) {
setHosts(config.getSeedHosts());
}
config.getLatencyScoreStrategy().start... | java | @Override
public void start() {
ConnectionPoolMBeanManager.getInstance().registerMonitor(config.getName(), this);
String seeds = config.getSeeds();
if (seeds != null && !seeds.isEmpty()) {
setHosts(config.getSeedHosts());
}
config.getLatencyScoreStrategy().start... | [
"@",
"Override",
"public",
"void",
"start",
"(",
")",
"{",
"ConnectionPoolMBeanManager",
".",
"getInstance",
"(",
")",
".",
"registerMonitor",
"(",
"config",
".",
"getName",
"(",
")",
",",
"this",
")",
";",
"String",
"seeds",
"=",
"config",
".",
"getSeeds"... | Starts the conn pool and resources associated with it | [
"Starts",
"the",
"conn",
"pool",
"and",
"resources",
"associated",
"with",
"it"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java#L114-L134 |
55,284 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java | AbstractHostPartitionConnectionPool.shutdown | @Override
public void shutdown() {
ConnectionPoolMBeanManager.getInstance().unregisterMonitor(config.getName(), this);
for (Entry<Host, HostConnectionPool<CL>> pool : hosts.entrySet()) {
pool.getValue().shutdown();
}
config.getLatencyScoreStrategy().shutdown();
... | java | @Override
public void shutdown() {
ConnectionPoolMBeanManager.getInstance().unregisterMonitor(config.getName(), this);
for (Entry<Host, HostConnectionPool<CL>> pool : hosts.entrySet()) {
pool.getValue().shutdown();
}
config.getLatencyScoreStrategy().shutdown();
... | [
"@",
"Override",
"public",
"void",
"shutdown",
"(",
")",
"{",
"ConnectionPoolMBeanManager",
".",
"getInstance",
"(",
")",
".",
"unregisterMonitor",
"(",
"config",
".",
"getName",
"(",
")",
",",
"this",
")",
";",
"for",
"(",
"Entry",
"<",
"Host",
",",
"Ho... | Clean up resources associated with the conn pool | [
"Clean",
"up",
"resources",
"associated",
"with",
"the",
"conn",
"pool"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java#L139-L149 |
55,285 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java | AbstractHostPartitionConnectionPool.addHost | @Override
public final synchronized boolean addHost(Host host, boolean refresh) {
// Already exists
if (hosts.containsKey(host)) {
// Check to see if we are adding token ranges or if the token ranges changed
// which will force a rebuild of the token topology
Host... | java | @Override
public final synchronized boolean addHost(Host host, boolean refresh) {
// Already exists
if (hosts.containsKey(host)) {
// Check to see if we are adding token ranges or if the token ranges changed
// which will force a rebuild of the token topology
Host... | [
"@",
"Override",
"public",
"final",
"synchronized",
"boolean",
"addHost",
"(",
"Host",
"host",
",",
"boolean",
"refresh",
")",
"{",
"// Already exists",
"if",
"(",
"hosts",
".",
"containsKey",
"(",
"host",
")",
")",
"{",
"// Check to see if we are adding token ran... | Add host to the system. May need to rebuild the partition map of the system
@param host
@param refresh | [
"Add",
"host",
"to",
"the",
"system",
".",
"May",
"need",
"to",
"rebuild",
"the",
"partition",
"map",
"of",
"the",
"system"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java#L186-L232 |
55,286 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java | AbstractHostPartitionConnectionPool.getActivePools | @Override
public List<HostConnectionPool<CL>> getActivePools() {
return ImmutableList.copyOf(topology.getAllPools().getPools());
} | java | @Override
public List<HostConnectionPool<CL>> getActivePools() {
return ImmutableList.copyOf(topology.getAllPools().getPools());
} | [
"@",
"Override",
"public",
"List",
"<",
"HostConnectionPool",
"<",
"CL",
">",
">",
"getActivePools",
"(",
")",
"{",
"return",
"ImmutableList",
".",
"copyOf",
"(",
"topology",
".",
"getAllPools",
"(",
")",
".",
"getPools",
"(",
")",
")",
";",
"}"
] | list of all active pools
@return {@link List<HostConnectionPool>} | [
"list",
"of",
"all",
"active",
"pools"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java#L259-L262 |
55,287 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java | AbstractHostPartitionConnectionPool.removeHost | @Override
public synchronized boolean removeHost(Host host, boolean refresh) {
HostConnectionPool<CL> pool = hosts.remove(host);
if (pool != null) {
topology.removePool(pool);
rebuildPartitions();
monitor.onHostRemoved(host);
pool.shutdown();
... | java | @Override
public synchronized boolean removeHost(Host host, boolean refresh) {
HostConnectionPool<CL> pool = hosts.remove(host);
if (pool != null) {
topology.removePool(pool);
rebuildPartitions();
monitor.onHostRemoved(host);
pool.shutdown();
... | [
"@",
"Override",
"public",
"synchronized",
"boolean",
"removeHost",
"(",
"Host",
"host",
",",
"boolean",
"refresh",
")",
"{",
"HostConnectionPool",
"<",
"CL",
">",
"pool",
"=",
"hosts",
".",
"remove",
"(",
"host",
")",
";",
"if",
"(",
"pool",
"!=",
"null... | Remove host from the system. Shuts down pool associated with the host and rebuilds partition map
@param host
@param refresh | [
"Remove",
"host",
"from",
"the",
"system",
".",
"Shuts",
"down",
"pool",
"associated",
"with",
"the",
"host",
"and",
"rebuilds",
"partition",
"map"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java#L277-L290 |
55,288 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java | AbstractHostPartitionConnectionPool.executeWithFailover | @Override
public <R> OperationResult<R> executeWithFailover(Operation<CL, R> op, RetryPolicy retry)
throws ConnectionException {
//Tracing operation
OperationTracer opsTracer = config.getOperationTracer();
final AstyanaxContext context = opsTracer.getAstyanaxContext();
if(co... | java | @Override
public <R> OperationResult<R> executeWithFailover(Operation<CL, R> op, RetryPolicy retry)
throws ConnectionException {
//Tracing operation
OperationTracer opsTracer = config.getOperationTracer();
final AstyanaxContext context = opsTracer.getAstyanaxContext();
if(co... | [
"@",
"Override",
"public",
"<",
"R",
">",
"OperationResult",
"<",
"R",
">",
"executeWithFailover",
"(",
"Operation",
"<",
"CL",
",",
"R",
">",
"op",
",",
"RetryPolicy",
"retry",
")",
"throws",
"ConnectionException",
"{",
"//Tracing operation",
"OperationTracer",... | Executes the operation using failover and retry strategy
@param op
@param retry
@return {@link OperationResult} | [
"Executes",
"the",
"operation",
"using",
"failover",
"and",
"retry",
"strategy"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractHostPartitionConnectionPool.java#L337-L381 |
55,289 | Netflix/astyanax | astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/QueryGenCache.java | QueryGenCache.getBoundStatement | public BoundStatement getBoundStatement(Q query, boolean useCaching) {
PreparedStatement pStatement = getPreparedStatement(query, useCaching);
return bindValues(pStatement, query);
} | java | public BoundStatement getBoundStatement(Q query, boolean useCaching) {
PreparedStatement pStatement = getPreparedStatement(query, useCaching);
return bindValues(pStatement, query);
} | [
"public",
"BoundStatement",
"getBoundStatement",
"(",
"Q",
"query",
",",
"boolean",
"useCaching",
")",
"{",
"PreparedStatement",
"pStatement",
"=",
"getPreparedStatement",
"(",
"query",
",",
"useCaching",
")",
";",
"return",
"bindValues",
"(",
"pStatement",
",",
"... | Get the bound statement from the prepared statement
@param query
@param useCaching
@return BoundStatement | [
"Get",
"the",
"bound",
"statement",
"from",
"the",
"prepared",
"statement"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/QueryGenCache.java#L62-L66 |
55,290 | Netflix/astyanax | astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/CFRowRangeQueryGen.java | CFRowRangeQueryGen.addWhereClauseForRowRange | private Where addWhereClauseForRowRange(String keyAlias, Select select, RowRange<?> rowRange) {
Where where = null;
boolean keyIsPresent = false;
boolean tokenIsPresent = false;
if (rowRange.getStartKey() != null || rowRange.getEndKey() != null) {
keyIsPresent = true;
}
if (rowRange.getStartToken() !... | java | private Where addWhereClauseForRowRange(String keyAlias, Select select, RowRange<?> rowRange) {
Where where = null;
boolean keyIsPresent = false;
boolean tokenIsPresent = false;
if (rowRange.getStartKey() != null || rowRange.getEndKey() != null) {
keyIsPresent = true;
}
if (rowRange.getStartToken() !... | [
"private",
"Where",
"addWhereClauseForRowRange",
"(",
"String",
"keyAlias",
",",
"Select",
"select",
",",
"RowRange",
"<",
"?",
">",
"rowRange",
")",
"{",
"Where",
"where",
"=",
"null",
";",
"boolean",
"keyIsPresent",
"=",
"false",
";",
"boolean",
"tokenIsPres... | Private helper for constructing the where clause for row ranges
@param keyAlias
@param select
@param rowRange
@return | [
"Private",
"helper",
"for",
"constructing",
"the",
"where",
"clause",
"for",
"row",
"ranges"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/CFRowRangeQueryGen.java#L110-L164 |
55,291 | Netflix/astyanax | astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/CFRowRangeQueryGen.java | CFRowRangeQueryGen.bindWhereClauseForRowRange | private void bindWhereClauseForRowRange(List<Object> values, RowRange<?> rowRange) {
boolean keyIsPresent = false;
boolean tokenIsPresent = false;
if (rowRange.getStartKey() != null || rowRange.getEndKey() != null) {
keyIsPresent = true;
}
if (rowRange.getStartToken() != null || rowRange.getEndToken() !... | java | private void bindWhereClauseForRowRange(List<Object> values, RowRange<?> rowRange) {
boolean keyIsPresent = false;
boolean tokenIsPresent = false;
if (rowRange.getStartKey() != null || rowRange.getEndKey() != null) {
keyIsPresent = true;
}
if (rowRange.getStartToken() != null || rowRange.getEndToken() !... | [
"private",
"void",
"bindWhereClauseForRowRange",
"(",
"List",
"<",
"Object",
">",
"values",
",",
"RowRange",
"<",
"?",
">",
"rowRange",
")",
"{",
"boolean",
"keyIsPresent",
"=",
"false",
";",
"boolean",
"tokenIsPresent",
"=",
"false",
";",
"if",
"(",
"rowRan... | Private helper for constructing the bind values for the given row range. Note that the assumption here is that
we have a previously constructed prepared statement that we can bind these values with.
@param keyAlias
@param select
@param rowRange
@return | [
"Private",
"helper",
"for",
"constructing",
"the",
"bind",
"values",
"for",
"the",
"given",
"row",
"range",
".",
"Note",
"that",
"the",
"assumption",
"here",
"is",
"that",
"we",
"have",
"a",
"previously",
"constructed",
"prepared",
"statement",
"that",
"we",
... | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cql/src/main/java/com/netflix/astyanax/cql/reads/CFRowRangeQueryGen.java#L175-L222 |
55,292 | Netflix/astyanax | astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractExecuteWithFailoverImpl.java | AbstractExecuteWithFailoverImpl.tryOperation | @Override
public OperationResult<R> tryOperation(Operation<CL, R> operation) throws ConnectionException {
Operation<CL, R> filteredOperation = config.getOperationFilterFactory().attachFilter(operation);
while (true) {
attemptCounter++;
try {
conne... | java | @Override
public OperationResult<R> tryOperation(Operation<CL, R> operation) throws ConnectionException {
Operation<CL, R> filteredOperation = config.getOperationFilterFactory().attachFilter(operation);
while (true) {
attemptCounter++;
try {
conne... | [
"@",
"Override",
"public",
"OperationResult",
"<",
"R",
">",
"tryOperation",
"(",
"Operation",
"<",
"CL",
",",
"R",
">",
"operation",
")",
"throws",
"ConnectionException",
"{",
"Operation",
"<",
"CL",
",",
"R",
">",
"filteredOperation",
"=",
"config",
".",
... | Basic impl that repeatedly borrows a conn and tries to execute the operation while maintaining metrics for
success, conn attempts, failures and latencies for operation executions
@param operation
@return {@link OperationResult} | [
"Basic",
"impl",
"that",
"repeatedly",
"borrows",
"a",
"conn",
"and",
"tries",
"to",
"execute",
"the",
"operation",
"while",
"maintaining",
"metrics",
"for",
"success",
"conn",
"attempts",
"failures",
"and",
"latencies",
"for",
"operation",
"executions"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-core/src/main/java/com/netflix/astyanax/connectionpool/impl/AbstractExecuteWithFailoverImpl.java#L109-L140 |
55,293 | Netflix/astyanax | astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftClusterImpl.java | ThriftClusterImpl.getVersion | @Override
public String getVersion() throws ConnectionException {
return connectionPool.executeWithFailover(
new AbstractOperationImpl<String>(tracerFactory.newTracer(CassandraOperationType.GET_VERSION)) {
@Override
public String internalExecute(Client... | java | @Override
public String getVersion() throws ConnectionException {
return connectionPool.executeWithFailover(
new AbstractOperationImpl<String>(tracerFactory.newTracer(CassandraOperationType.GET_VERSION)) {
@Override
public String internalExecute(Client... | [
"@",
"Override",
"public",
"String",
"getVersion",
"(",
")",
"throws",
"ConnectionException",
"{",
"return",
"connectionPool",
".",
"executeWithFailover",
"(",
"new",
"AbstractOperationImpl",
"<",
"String",
">",
"(",
"tracerFactory",
".",
"newTracer",
"(",
"Cassandr... | Get the version from the cluster
@return
@throws OperationException | [
"Get",
"the",
"version",
"from",
"the",
"cluster"
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftClusterImpl.java#L130-L139 |
55,294 | Netflix/astyanax | astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/reader/AllRowsReader.java | AllRowsReader.call | @Override
public Boolean call() throws Exception {
error.set(null);
List<Callable<Boolean>> subtasks = Lists.newArrayList();
// We are iterating the entire ring using an arbitrary number of threads
if (this.concurrencyLevel != null || startToken != null|| endToken !... | java | @Override
public Boolean call() throws Exception {
error.set(null);
List<Callable<Boolean>> subtasks = Lists.newArrayList();
// We are iterating the entire ring using an arbitrary number of threads
if (this.concurrencyLevel != null || startToken != null|| endToken !... | [
"@",
"Override",
"public",
"Boolean",
"call",
"(",
")",
"throws",
"Exception",
"{",
"error",
".",
"set",
"(",
"null",
")",
";",
"List",
"<",
"Callable",
"<",
"Boolean",
">",
">",
"subtasks",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"// We are ... | Main execution block for the all rows query. | [
"Main",
"execution",
"block",
"for",
"the",
"all",
"rows",
"query",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-recipes/src/main/java/com/netflix/astyanax/recipes/reader/AllRowsReader.java#L535-L593 |
55,295 | Netflix/astyanax | astyanax-cassandra/src/main/java/com/netflix/astyanax/serializers/JaxbSerializer.java | JaxbSerializer.createStreamReader | protected XMLStreamReader createStreamReader(InputStream input) throws XMLStreamException {
if (inputFactory == null) {
inputFactory = XMLInputFactory.newInstance();
}
return inputFactory.createXMLStreamReader(input);
} | java | protected XMLStreamReader createStreamReader(InputStream input) throws XMLStreamException {
if (inputFactory == null) {
inputFactory = XMLInputFactory.newInstance();
}
return inputFactory.createXMLStreamReader(input);
} | [
"protected",
"XMLStreamReader",
"createStreamReader",
"(",
"InputStream",
"input",
")",
"throws",
"XMLStreamException",
"{",
"if",
"(",
"inputFactory",
"==",
"null",
")",
"{",
"inputFactory",
"=",
"XMLInputFactory",
".",
"newInstance",
"(",
")",
";",
"}",
"return"... | Get a new XML stream reader.
@param input
the underlying InputStream to read from.
@return a new {@link XmlStreamReader} which reads from the specified
InputStream. The reader can read anything written by
{@link #createStreamWriter(OutputStream)}.
@throws XMLStreamException | [
"Get",
"a",
"new",
"XML",
"stream",
"reader",
"."
] | bcc3fd26e2dda05a923751aa32b139f6209fecdf | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-cassandra/src/main/java/com/netflix/astyanax/serializers/JaxbSerializer.java#L171-L176 |
55,296 | facebookarchive/swift | swift-codec/src/main/java/com/facebook/swift/codec/metadata/ThriftCatalog.java | ThriftCatalog.getThriftType | public ThriftType getThriftType(Type javaType)
throws IllegalArgumentException
{
ThriftType thriftType = getThriftTypeFromCache(javaType);
if (thriftType == null) {
thriftType = buildThriftType(javaType);
}
return thriftType;
} | java | public ThriftType getThriftType(Type javaType)
throws IllegalArgumentException
{
ThriftType thriftType = getThriftTypeFromCache(javaType);
if (thriftType == null) {
thriftType = buildThriftType(javaType);
}
return thriftType;
} | [
"public",
"ThriftType",
"getThriftType",
"(",
"Type",
"javaType",
")",
"throws",
"IllegalArgumentException",
"{",
"ThriftType",
"thriftType",
"=",
"getThriftTypeFromCache",
"(",
"javaType",
")",
";",
"if",
"(",
"thriftType",
"==",
"null",
")",
"{",
"thriftType",
"... | Gets the ThriftType for the specified Java type. The native Thrift type for the Java type will
be inferred from the Java type, and if necessary type coercions will be applied.
@return the ThriftType for the specified java type; never null
@throws IllegalArgumentException if the Java Type can not be coerced to a Thrif... | [
"Gets",
"the",
"ThriftType",
"for",
"the",
"specified",
"Java",
"type",
".",
"The",
"native",
"Thrift",
"type",
"for",
"the",
"Java",
"type",
"will",
"be",
"inferred",
"from",
"the",
"Java",
"type",
"and",
"if",
"necessary",
"type",
"coercions",
"will",
"b... | 3f1f098a50d6106f50cd6fe1c361dd373ede0197 | https://github.com/facebookarchive/swift/blob/3f1f098a50d6106f50cd6fe1c361dd373ede0197/swift-codec/src/main/java/com/facebook/swift/codec/metadata/ThriftCatalog.java#L229-L237 |
55,297 | facebookarchive/swift | swift-codec/src/main/java/com/facebook/swift/codec/metadata/ThriftCatalog.java | ThriftCatalog.getThriftEnumMetadata | public <T extends Enum<T>> ThriftEnumMetadata<?> getThriftEnumMetadata(Class<?> enumClass)
{
ThriftEnumMetadata<?> enumMetadata = enums.get(enumClass);
if (enumMetadata == null) {
enumMetadata = new ThriftEnumMetadataBuilder<>((Class<T>) enumClass).build();
ThriftEnumMetadat... | java | public <T extends Enum<T>> ThriftEnumMetadata<?> getThriftEnumMetadata(Class<?> enumClass)
{
ThriftEnumMetadata<?> enumMetadata = enums.get(enumClass);
if (enumMetadata == null) {
enumMetadata = new ThriftEnumMetadataBuilder<>((Class<T>) enumClass).build();
ThriftEnumMetadat... | [
"public",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"ThriftEnumMetadata",
"<",
"?",
">",
"getThriftEnumMetadata",
"(",
"Class",
"<",
"?",
">",
"enumClass",
")",
"{",
"ThriftEnumMetadata",
"<",
"?",
">",
"enumMetadata",
"=",
"enums",
".",
"get",
"(... | Gets the ThriftEnumMetadata for the specified enum class. If the enum class contains a method
annotated with @ThriftEnumValue, the value of this method will be used for the encoded thrift
value; otherwise the Enum.ordinal() method will be used. | [
"Gets",
"the",
"ThriftEnumMetadata",
"for",
"the",
"specified",
"enum",
"class",
".",
"If",
"the",
"enum",
"class",
"contains",
"a",
"method",
"annotated",
"with"
] | 3f1f098a50d6106f50cd6fe1c361dd373ede0197 | https://github.com/facebookarchive/swift/blob/3f1f098a50d6106f50cd6fe1c361dd373ede0197/swift-codec/src/main/java/com/facebook/swift/codec/metadata/ThriftCatalog.java#L539-L551 |
55,298 | facebookarchive/swift | swift-codec/src/main/java/com/facebook/swift/codec/metadata/ThriftCatalog.java | ThriftCatalog.getThriftStructMetadata | public <T> ThriftStructMetadata getThriftStructMetadata(Type structType)
{
ThriftStructMetadata structMetadata = structs.get(structType);
Class<?> structClass = TypeToken.of(structType).getRawType();
if (structMetadata == null) {
if (structClass.isAnnotationPresent(ThriftStruct.c... | java | public <T> ThriftStructMetadata getThriftStructMetadata(Type structType)
{
ThriftStructMetadata structMetadata = structs.get(structType);
Class<?> structClass = TypeToken.of(structType).getRawType();
if (structMetadata == null) {
if (structClass.isAnnotationPresent(ThriftStruct.c... | [
"public",
"<",
"T",
">",
"ThriftStructMetadata",
"getThriftStructMetadata",
"(",
"Type",
"structType",
")",
"{",
"ThriftStructMetadata",
"structMetadata",
"=",
"structs",
".",
"get",
"(",
"structType",
")",
";",
"Class",
"<",
"?",
">",
"structClass",
"=",
"TypeT... | Gets the ThriftStructMetadata for the specified struct class. The struct class must be
annotated with @ThriftStruct or @ThriftUnion. | [
"Gets",
"the",
"ThriftStructMetadata",
"for",
"the",
"specified",
"struct",
"class",
".",
"The",
"struct",
"class",
"must",
"be",
"annotated",
"with"
] | 3f1f098a50d6106f50cd6fe1c361dd373ede0197 | https://github.com/facebookarchive/swift/blob/3f1f098a50d6106f50cd6fe1c361dd373ede0197/swift-codec/src/main/java/com/facebook/swift/codec/metadata/ThriftCatalog.java#L557-L578 |
55,299 | facebookarchive/swift | swift-codec/src/main/java/com/facebook/swift/codec/internal/compiler/ThriftCodecByteCodeGenerator.java | ThriftCodecByteCodeGenerator.declareTypeField | private FieldDefinition declareTypeField()
{
FieldDefinition typeField = new FieldDefinition(a(PRIVATE, FINAL), "type", type(ThriftType.class));
classDefinition.addField(typeField);
// add constructor parameter to initialize this field
parameters.add(typeField, ThriftType.struct(met... | java | private FieldDefinition declareTypeField()
{
FieldDefinition typeField = new FieldDefinition(a(PRIVATE, FINAL), "type", type(ThriftType.class));
classDefinition.addField(typeField);
// add constructor parameter to initialize this field
parameters.add(typeField, ThriftType.struct(met... | [
"private",
"FieldDefinition",
"declareTypeField",
"(",
")",
"{",
"FieldDefinition",
"typeField",
"=",
"new",
"FieldDefinition",
"(",
"a",
"(",
"PRIVATE",
",",
"FINAL",
")",
",",
"\"type\"",
",",
"type",
"(",
"ThriftType",
".",
"class",
")",
")",
";",
"classD... | Declares the private ThriftType field type. | [
"Declares",
"the",
"private",
"ThriftType",
"field",
"type",
"."
] | 3f1f098a50d6106f50cd6fe1c361dd373ede0197 | https://github.com/facebookarchive/swift/blob/3f1f098a50d6106f50cd6fe1c361dd373ede0197/swift-codec/src/main/java/com/facebook/swift/codec/internal/compiler/ThriftCodecByteCodeGenerator.java#L200-L209 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.