id stringlengths 7 14 | test_class dict | test_case dict | focal_class dict | focal_method dict | repository dict |
|---|---|---|---|---|---|
184471389_89 | {
"fields": [
{
"declarator": "attribute",
"modifier": "@Mock",
"original_string": "@Mock\n Attribute attribute;",
"type": "Attribute",
"var_name": "attribute"
},
{
"declarator": "inputField",
"modifier": "@Mock(answer = Answers.RETURNS_DEEP_STUBS)",
"ori... | {
"body": "@Test\n public void testConvertsForInputAlone() {\n\n final String CODE = \"cool_attribute\";\n final String TYPE_NAME = \"OK\";\n\n when(inputField.getName()).thenReturn(CODE);\n when(inputField.getType().getName()).thenReturn(TYPE_NAME);\n\n converterUnderTest = new ... | {
"fields": [
{
"declarator": "allAttributeMetadata",
"modifier": "private",
"original_string": "private List<Attribute> allAttributeMetadata;",
"type": "List<Attribute>",
"var_name": "allAttributeMetadata"
}
],
"file": "bundles/core/src/main/java/com/adobe/cq/commerce/core/s... | {
"body": "@Override\n public FilterAttributeMetadata apply(final __InputValue inputField) {\n FilterAttributeMetadataImpl metadata = new FilterAttributeMetadataImpl();\n\n metadata.setAttributeCode(inputField.getName());\n metadata.setFilterInputType(inputField.getType().getName());\n\n ... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_66 | {
"fields": [
{
"declarator": "context = new AemContext()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public AemContext context = new AemContext();",
"type": "AemContext",
"var_name": "context"
},
{
"declarator": "button",
"modifier": "privat... | {
"body": "@Test\n public void testDefaultLink() {\n\n final String expResult = \"#\";\n context.currentResource(\"/content/defaultUrl\");\n button = context.request().adaptTo(Button.class);\n\n String result = button.getLink();\n assertEquals(expResult, result);\n\n }",
"cl... | {
"fields": [
{
"declarator": "RESOURCE_TYPE = \"core/cif/components/content/button/v1/button\"",
"modifier": "protected static final",
"original_string": "protected static final String RESOURCE_TYPE = \"core/cif/components/content/button/v1/button\";",
"type": "String",
"var_name": ... | {
"body": "@Override\n public String getLink() {\n return StringUtils.isNotBlank(url) ? url : DEFAULT_LINK;\n }",
"class_method_signature": "ButtonImpl.getLink()",
"constructor": false,
"full_signature": "@Override public String getLink()",
"identifier": "getLink",
"invocations": [
"isNotBl... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_70 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-content.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-content.json\");",
"type": "AemContext",
"var_name": "context"
... | {
"body": "@Test\n public void testNoMagentoGraphqlClient() {\n searchResultsModel = context.request().adaptTo(SearchResultsImpl.class);\n\n Mockito.when(pageResource.adaptTo(GraphqlClient.class)).thenReturn(null);\n searchResultsModel = context.request().adaptTo(SearchResultsImpl.class);\n\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SearchResultsImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SearchResultsImpl.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "@Nonnull\n @Override\n public Collection<ProductListItem> getProducts() {\n return getSearchResultsSet().getProductListItems();\n }",
"class_method_signature": "SearchResultsImpl.getProducts()",
"constructor": false,
"full_signature": "@Nonnull @Override public Collection<ProductListI... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_27 | {
"fields": [
{
"declarator": "context = new AemContext(ResourceResolverType.JCR_MOCK)",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public AemContext context = new AemContext(ResourceResolverType.JCR_MOCK);",
"type": "AemContext",
"var_name": "context"
},
... | {
"body": "@Test\n public void testPreviewCategory() throws IOException {\n // mock referer\n when(request.getHeader(HttpHeaders.REFERER)).thenReturn(\"/editor.html/path/to/valid/category/page.html\");\n\n // mock selectors\n when(requestPathInfo.getSelectors()).thenReturn(new String[] ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(PreviewServlet.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(PreviewServlet.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException {\n\n if (WCMMode.DISABLED == WCMMode.fromRequest(request)) {\n response.sendError(HttpServletResponse.SC_FORBIDDEN, \"The request not permitted\");\n return;\n }\... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_50 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-content.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-content.json\");",
"type": "AemContext",
"var_name": "context"
... | {
"body": "@Test\n public void testGetVariantAttributes() {\n productModel = context.request().adaptTo(ProductImpl.class);\n List<VariantAttribute> attributes = productModel.getVariantAttributes();\n Assert.assertNotNull(attributes);\n\n ConfigurableProduct cp = (ConfigurableProduct) pr... | {
"fields": [
{
"declarator": "RESOURCE_TYPE = \"core/cif/components/commerce/product/v1/product\"",
"modifier": "protected static final",
"original_string": "protected static final String RESOURCE_TYPE = \"core/cif/components/commerce/product/v1/product\";",
"type": "String",
"var_n... | {
"body": "@Override\n public List<VariantAttribute> getVariantAttributes() {\n // Don't return any variant selection properties if the current product is not of type ConfigurableProduct.\n if (!isConfigurable()) {\n return Collections.emptyList();\n }\n\n ConfigurableProduct... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_2 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-page-filter.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-page-filter.json\");",
"type": "AemContext",
"var_name": "c... | {
"body": "@Test\n public void testProductUrlWithCustomPage() {\n Map<String, String> params = new ParamsBuilder()\n .urlKey(\"beaumont-summit-kit\")\n .page(\"/content/custom-page\")\n .map();\n\n String url = urlProvider.toProductUrl(request, null, params);\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(UrlProviderImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(UrlProviderImpl.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n public String toProductUrl(SlingHttpServletRequest request, Page page, Map<String, String> params) {\n return toUrl(request, page, params, productUrlTemplate, UrlProvider.URL_KEY_PARAM);\n }",
"class_method_signature": "UrlProviderImpl.toProductUrl(SlingHttpServletRequest request... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_11 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-page-filter.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-page-filter.json\");",
"type": "AemContext",
"var_name": "c... | {
"body": "@Test\n public void testNotPage() {\n request.getResource().getValueMap().put(\"pageType\", \"product\");\n request.setQueryString(\"item=/content/product-page/ignored\");\n request.setPathInfo(\"/mnt/overlay/wcm/core/content/sites/properties.html\");\n\n servlet.doGet(reques... | {
"fields": [
{
"declarator": "RESOURCE_TYPE = \"core/cif/components/renderconditions/pagetype\"",
"modifier": "public final static",
"original_string": "public final static String RESOURCE_TYPE = \"core/cif/components/renderconditions/pagetype\";",
"type": "String",
"var_name": "RES... | {
"body": "@Override\n protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) {\n String pageType = request.getResource().getValueMap().get(PAGE_TYPE_PROPERTY, \"\");\n request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_46 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-content-breadcrumb.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-content-breadcrumb.json\");",
"type": "AemContext",
... | {
"body": "@Test\n public void testCategoryInterfaceComparator() {\n CategoryTree c1 = new CategoryTree();\n c1.setUrlPath(\"men\");\n c1.setId(1);\n\n CategoryTree c2 = new CategoryTree();\n c2.setUrlPath(\"men/tops\");\n c2.setId(2);\n\n CategoryTree c3 = new Cate... | {
"fields": [
{
"declarator": "RESOURCE_TYPE = \"core/cif/components/structure/breadcrumb/v1/breadcrumb\"",
"modifier": "protected static final",
"original_string": "protected static final String RESOURCE_TYPE = \"core/cif/components/structure/breadcrumb/v1/breadcrumb\";",
"type": "String"... | {
"body": "@Override\n public Comparator<CategoryInterface> getCategoryInterfaceComparator() {\n return Comparator\n .comparing(structureDepthKey)\n .thenComparing(depthKey)\n .reversed()\n .thenComparing(idKey);\n }",
"class_method_signature": "BreadcrumbImp... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_85 | {
"fields": [
{
"declarator": "BLACK_COUNT = 10",
"modifier": "private final static",
"original_string": "private final static Integer BLACK_COUNT = 10;",
"type": "Integer",
"var_name": "BLACK_COUNT"
},
{
"declarator": "BLACK_ATTRIBUTE = \"color\"",
"modifier": "p... | {
"body": "@Test\n public void testShouldSetDisplayLabel() {\n\n FilterAttributeMetadataImpl filterAttributeMetadata = new FilterAttributeMetadataImpl();\n filterAttributeMetadata.setAttributeInputType(FilterAttributeMetadataImpl.INPUT_TYPE_SELECT);\n filterAttributeMetadata.setAttributeCode(B... | {
"fields": [
{
"declarator": "filterAttributeMetadata",
"modifier": "private final",
"original_string": "private final FilterAttributeMetadata filterAttributeMetadata;",
"type": "FilterAttributeMetadata",
"var_name": "filterAttributeMetadata"
},
{
"declarator": "attrib... | {
"body": "@Override\n public SearchAggregationOption apply(final AggregationOption aggregationOption) {\n SearchAggregationOptionImpl searchAggregationOption = new SearchAggregationOptionImpl();\n\n // Special case handling for boolean values to return a friendlier \"yes/no\" response\n if (f... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_93 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-content.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-content.json\");",
"type": "AemContext",
"var_name": "context"
... | {
"body": "@Test\n public void testFilterQueriesReturnNull() {\n // We want to make sure that components will not fail if the __type and/or customAttributeMetadata fields are null\n // For example, 3rd-party integrations might not support this immediately\n\n GraphqlClient graphqlClient = Mock... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SearchFilterServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SearchFilterServiceImpl.class);",
"type": "Logger",
"var_name": "LOGGE... | {
"body": "@Override\n public List<FilterAttributeMetadata> retrieveCurrentlyAvailableCommerceFilters(final Page page) {\n\n // This is used to configure the cache in the GraphqlClient with a cache name of\n // --> com.adobe.cq.commerce.core.search.services.SearchFilterService\n Resource resou... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_92 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-content.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-content.json\");",
"type": "AemContext",
"var_name": "context"
... | {
"body": "@Test\n public void testRetrieveMetadata() {\n context.registerAdapter(Resource.class, GraphqlClient.class, (Function<Resource, GraphqlClient>) input -> input.getValueMap().get(\n \"cq:graphqlClient\") != null ? graphqlClient : null);\n\n final List<FilterAttributeMetadata> filt... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SearchFilterServiceImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SearchFilterServiceImpl.class);",
"type": "Logger",
"var_name": "LOGGE... | {
"body": "@Override\n public List<FilterAttributeMetadata> retrieveCurrentlyAvailableCommerceFilters(final Page page) {\n\n // This is used to configure the cache in the GraphqlClient with a cache name of\n // --> com.adobe.cq.commerce.core.search.services.SearchFilterService\n Resource resou... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_84 | {
"fields": [
{
"declarator": "BLACK_COUNT = 10",
"modifier": "private final static",
"original_string": "private final static Integer BLACK_COUNT = 10;",
"type": "Integer",
"var_name": "BLACK_COUNT"
},
{
"declarator": "BLACK_ATTRIBUTE = \"color\"",
"modifier": "p... | {
"body": "@Test\n public void testShouldSetCount() {\n\n FilterAttributeMetadataImpl filterAttributeMetadata = new FilterAttributeMetadataImpl();\n filterAttributeMetadata.setAttributeInputType(FilterAttributeMetadataImpl.INPUT_TYPE_SELECT);\n filterAttributeMetadata.setAttributeCode(BLACK_AT... | {
"fields": [
{
"declarator": "filterAttributeMetadata",
"modifier": "private final",
"original_string": "private final FilterAttributeMetadata filterAttributeMetadata;",
"type": "FilterAttributeMetadata",
"var_name": "filterAttributeMetadata"
},
{
"declarator": "attrib... | {
"body": "@Override\n public SearchAggregationOption apply(final AggregationOption aggregationOption) {\n SearchAggregationOptionImpl searchAggregationOption = new SearchAggregationOptionImpl();\n\n // Special case handling for boolean values to return a friendlier \"yes/no\" response\n if (f... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_47 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-content.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-content.json\");",
"type": "AemContext",
"var_name": "context"
... | {
"body": "@Test\n public void testCreateFilterMap() {\n productCollectionModel = context.request().adaptTo(ProductCollectionImpl.class);\n\n Map<String, String[]> queryParameters = new HashMap<>();\n queryParameters.put(\"color\", new String[] {});\n Map<String, String> filterMap = pro... | {
"fields": [
{
"declarator": "RESOURCE_TYPE = \"core/cif/components/commerce/productcollection/v1/productcollection\"",
"modifier": "protected static final",
"original_string": "protected static final String RESOURCE_TYPE = \"core/cif/components/commerce/productcollection/v1/productcollection\"... | {
"body": "protected Map<String, String> createFilterMap(final Map<String, String[]> parameterMap) {\n Map<String, String> filters = new HashMap<>();\n parameterMap.forEach((code, value) -> {\n // we'll make sure there is a value defined for the key\n if (value.length != 1) {\n ... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_10 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-page-filter.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-page-filter.json\");",
"type": "AemContext",
"var_name": "c... | {
"body": "@Test\n public void testNotCategoryPage() {\n request.getResource().getValueMap().put(\"pageType\", \"category\");\n request.setQueryString(\"item=/content/product-page/sub-page\");\n request.setPathInfo(\"/mnt/overlay/wcm/core/content/sites/properties.html\");\n\n servlet.do... | {
"fields": [
{
"declarator": "RESOURCE_TYPE = \"core/cif/components/renderconditions/pagetype\"",
"modifier": "public final static",
"original_string": "public final static String RESOURCE_TYPE = \"core/cif/components/renderconditions/pagetype\";",
"type": "String",
"var_name": "RES... | {
"body": "@Override\n protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) {\n String pageType = request.getResource().getValueMap().get(PAGE_TYPE_PROPERTY, \"\");\n request.setAttribute(RenderCondition.class.getName(), new SimpleRenderCondition(... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_3 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-page-filter.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-page-filter.json\");",
"type": "AemContext",
"var_name": "c... | {
"body": "@Test\n public void testProductUrlWithSubpageAndAnchor() {\n Page page = context.currentPage(\"/content/product-page\");\n request.setAttribute(WCMMode.class.getName(), WCMMode.EDIT);\n\n Map<String, String> params = new ParamsBuilder()\n .urlKey(\"productId1\")\n ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(UrlProviderImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(UrlProviderImpl.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "@Override\n public String toProductUrl(SlingHttpServletRequest request, Page page, Map<String, String> params) {\n return toUrl(request, page, params, productUrlTemplate, UrlProvider.URL_KEY_PARAM);\n }",
"class_method_signature": "UrlProviderImpl.toProductUrl(SlingHttpServletRequest request... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_51 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-content.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-content.json\");",
"type": "AemContext",
"var_name": "context"
... | {
"body": "@Test\n public void testSafeDescription() {\n productModel = context.request().adaptTo(ProductImpl.class);\n String sampleString = \"<strong>abc</strong>\";\n SimpleProduct product = mock(SimpleProduct.class, RETURNS_DEEP_STUBS);\n ComplexTextValue value = mock(ComplexTextVal... | {
"fields": [
{
"declarator": "RESOURCE_TYPE = \"core/cif/components/commerce/product/v1/product\"",
"modifier": "protected static final",
"original_string": "protected static final String RESOURCE_TYPE = \"core/cif/components/commerce/product/v1/product\";",
"type": "String",
"var_n... | {
"body": "private String safeDescription(ProductInterface product) {\n ComplexTextValue description = product.getDescription();\n if (description == null) {\n return null;\n }\n\n // Filter HTML\n return xssApi.filterHTML(description.getHtml());\n }",
"class_method_... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_26 | {
"fields": [
{
"declarator": "context = new AemContext(ResourceResolverType.JCR_MOCK)",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public AemContext context = new AemContext(ResourceResolverType.JCR_MOCK);",
"type": "AemContext",
"var_name": "context"
},
... | {
"body": "@Test\n public void testPreviewProduct() throws IOException {\n // mock referer\n when(request.getHeader(HttpHeaders.REFERER)).thenReturn(\"/editor.html/path/to/valid/product/page.html\");\n\n // mock selectors\n when(requestPathInfo.getSelectors()).thenReturn(new String[] { ... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(PreviewServlet.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(PreviewServlet.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "protected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException {\n\n if (WCMMode.DISABLED == WCMMode.fromRequest(request)) {\n response.sendError(HttpServletResponse.SC_FORBIDDEN, \"The request not permitted\");\n return;\n }\... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_71 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-content.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-content.json\");",
"type": "AemContext",
"var_name": "context"
... | {
"body": "@Test\n public void testCreateFilterMap() {\n searchResultsModel = context.request().adaptTo(SearchResultsImpl.class);\n\n Map<String, String[]> queryParameters = new HashMap<>();\n queryParameters.put(\"search_query\", new String[] { \"ok\" });\n Map<String, String> filterMa... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(SearchResultsImpl.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(SearchResultsImpl.class);",
"type": "Logger",
"var_name": "LOGGER"
},
... | {
"body": "protected Map<String, String> createFilterMap(final Map<String, String[]> parameterMap) {\n Map<String, String> filters = super.createFilterMap(parameterMap);\n filters.remove(SearchOptionsImpl.SEARCH_QUERY_PARAMETER_ID);\n return filters;\n }",
"class_method_signature": "SearchRe... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_88 | {
"fields": [
{
"declarator": "productPage",
"modifier": "@Mock\n private",
"original_string": "@Mock\n private Page productPage;",
"type": "Page",
"var_name": "productPage"
},
{
"declarator": "request",
"modifier": "@Mock\n private",
"original_stri... | {
"body": "@Test\n public void testProductInterfaceConverted() {\n final ProductListItem result = converterUnderTest.apply(productInterface);\n\n verify(productPage).getLanguage(false);\n\n assertThat(result).isNotNull();\n assertThat(result).isInstanceOf(ProductListItem.class);\n }"... | {
"fields": [
{
"declarator": "LOGGER = LoggerFactory.getLogger(ProductToProductListItemConverter.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = LoggerFactory.getLogger(ProductToProductListItemConverter.class);",
"type": "Logger",
... | {
"body": "@Override\n public ProductListItem apply(final ProductInterface product) {\n try {\n boolean isStartPrice = product instanceof GroupedProduct;\n Price price = new PriceImpl(product.getPriceRange(), locale, isStartPrice);\n final ProductImage smallImage = product.g... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_67 | {
"fields": [
{
"declarator": "MOCK_CONFIGURATION = new ValueMapDecorator(ImmutableMap.of(\"cq:graphqlClient\", \"default\", \"magentoStore\",\n \"my-store\"))",
"modifier": "private static final",
"original_string": "private static final ValueMap MOCK_CONFIGURATION = new ValueMapDecorato... | {
"body": "@Test\n public void verifyAssetOverride() throws Exception {\n setupTest(COMPONENT_PATH);\n\n categories = featuredCategoryList.getCategories();\n Assert.assertNotNull(categories);\n Assert.assertEquals(categories.get(1).getImage(), TEST_RENDITION_PATH);\n }",
"class_met... | {
"fields": [
{
"declarator": "RESOURCE_TYPE = \"core/cif/components/commerce/featuredcategorylist/v1/featuredcategorylist\"",
"modifier": "protected static final",
"original_string": "protected static final String RESOURCE_TYPE = \"core/cif/components/commerce/featuredcategorylist/v1/featuredca... | {
"body": "@Override\n public List<CategoryTree> getCategories() {\n if (categoriesRetriever == null) {\n return Collections.emptyList();\n }\n List<CategoryTree> categories = categoriesRetriever.fetchCategories();\n for (CategoryTree category : categories) {\n Map... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_30 | {
"fields": [
{
"declarator": "context = createContext(\"/context/jcr-content.json\")",
"modifier": "@Rule\n public final",
"original_string": "@Rule\n public final AemContext context = createContext(\"/context/jcr-content.json\");",
"type": "AemContext",
"var_name": "context"
... | {
"body": "@Test\n public void testUpsellProducts() throws Exception {\n setUp(RelationType.UPSELL_PRODUCTS, \"graphql/magento-graphql-upsellproducts-result.json\", true);\n assertProducts();\n Assert.assertEquals(\"h3\", relatedProducts.getTitleType()); // titleType is coming from currentStyl... | {
"fields": [
{
"declarator": "RESOURCE_TYPE = \"core/cif/components/commerce/relatedproducts/v1/relatedproducts\"",
"modifier": "protected static final",
"original_string": "protected static final String RESOURCE_TYPE = \"core/cif/components/commerce/relatedproducts/v1/relatedproducts\";",
... | {
"body": "@Override\n public String getTitleType() {\n return TitleTypeProvider.getTitleType(currentStyle, properties);\n }",
"class_method_signature": "RelatedProductsImpl.getTitleType()",
"constructor": false,
"full_signature": "@Override public String getTitleType()",
"identifier": "getTitleT... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
184471389_100 | {
"fields": [
{
"declarator": "PARAMETER_KEY = \"param-key\"",
"modifier": "private static final",
"original_string": "private static final String PARAMETER_KEY = \"param-key\";",
"type": "String",
"var_name": "PARAMETER_KEY"
},
{
"declarator": "PARAMETER_VALUE = \"para... | {
"body": "@Test\n public void testAlwaysReturnPageResultsWithCorrectSize() {\n PagerImpl pager = new PagerImpl(Collections.singletonMap(PARAMETER_KEY, PARAMETER_VALUE), TOTAL_PAGES, 1);\n assertThat(pager.getPages()).hasSize(PagerImpl.PAGINATION_RANGE_SIZE + 1);\n\n pager = new PagerImpl(Coll... | {
"fields": [
{
"declarator": "MAXIMUM_PAGE_DISPLAY_COUNT = 7",
"modifier": "public static final",
"original_string": "public static final int MAXIMUM_PAGE_DISPLAY_COUNT = 7;",
"type": "int",
"var_name": "MAXIMUM_PAGE_DISPLAY_COUNT"
},
{
"declarator": "PAGINATION_RANGE_... | {
"body": "@Nonnull\n @Override\n public List<PagerPage> getPages() {\n\n List<PagerPage> pages = new ArrayList<>();\n\n for (int currentIndex = 1; currentIndex <= totalPages; currentIndex++) {\n Map<String, String> pageParameters = new HashMap<>(existingQueryParameters);\n p... | {
"created": "5/1/2019 7:40:37 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 184471389,
"size": null,
"stargazer_count": null,
"stars": 31,
"updates": "2020-01-23T15:44:10+00:00",
"url": "https://github.com/adobe/aem-core-ci... |
9602474_0 | {
"fields": [
{
"declarator": "clusteringController",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private ClusteringController clusteringController;",
"type": "ClusteringController",
"var_name": "clusteringController"
}
],
"file": "modeshape-clusterin... | {
"body": "@Test\n public void shouldReturnValidRepositoryName() throws Exception {\n assertEquals(\"sample\", clusteringController.getRepositoryName());\n }",
"class_method_signature": "ClusteringControllerTest.shouldReturnValidRepositoryName()",
"constructor": false,
"full_signature": "@Test publ... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(ClusteringController.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(ClusteringController.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
... | {
"body": "public String getRepositoryName() throws RepositoryException{\n Session repositorySession = newSession();\n try {\n return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME);\n } finally {\n repositorySession.logout()... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9602474,
"size": 282,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/ModeShape/quickstart"
} |
9602474_1 | {
"fields": [
{
"declarator": "federationController",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private FederationController federationController;",
"type": "FederationController",
"var_name": "federationController"
}
],
"file": "modeshape-federatio... | {
"body": "@Test\n public void shouldReturnValidRepositoryName() throws Exception {\n assertEquals(\"federated-repository\", federationController.getRepositoryName());\n }",
"class_method_signature": "FederationControllerTest.shouldReturnValidRepositoryName()",
"constructor": false,
"full_signature... | {
"fields": [
{
"declarator": "FS_SOURCE_PROJECTION = \"JBossDataDir\"",
"modifier": "static final",
"original_string": "static final String FS_SOURCE_PROJECTION = \"JBossDataDir\";",
"type": "String",
"var_name": "FS_SOURCE_PROJECTION"
},
{
"declarator": "DB_METADATA_S... | {
"body": "public String getRepositoryName() throws RepositoryException{\n Session repositorySession = newSession();\n try {\n return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME);\n } finally {\n repositorySession.logout()... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9602474,
"size": 282,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/ModeShape/quickstart"
} |
9602474_2 | {
"fields": [
{
"declarator": "sessionProducer",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private SessionProducer sessionProducer;",
"type": "SessionProducer",
"var_name": "sessionProducer"
}
],
"file": "modeshape-cdi/src/test/java/org/modeshape/qu... | {
"body": "@Test\n public void shouldProduceValidSession() throws Exception {\n assertNotNull(sessionProducer);\n assertNotNull(sessionProducer.getSession());\n }",
"class_method_signature": "SessionProducerTest.shouldProduceValidSession()",
"constructor": false,
"full_signature": "@Test pub... | {
"fields": [
{
"declarator": "LOGGER = Logger.getLogger(SessionProducer.class)",
"modifier": "private static final",
"original_string": "private static final Logger LOGGER = Logger.getLogger(SessionProducer.class);",
"type": "Logger",
"var_name": "LOGGER"
},
{
"declara... | {
"body": "@RequestScoped\n @Produces\n public Session getSession() throws RepositoryException {\n LOGGER.info(\"Creating new session...\");\n return sampleRepository.login();\n }",
"class_method_signature": "SessionProducer.getSession()",
"constructor": false,
"full_signature": "@Request... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9602474,
"size": 282,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/ModeShape/quickstart"
} |
9602474_3 | {
"fields": [
{
"declarator": "cdiController",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private CDIController cdiController;",
"type": "CDIController",
"var_name": "cdiController"
}
],
"file": "modeshape-cdi/src/test/java/org/modeshape/quickstart/c... | {
"body": "@Test\n public void shouldReturnValidRepositoryName() throws Exception {\n assertEquals(\"sample\", cdiController.getRepositoryName());\n }",
"class_method_signature": "CDIControllerTest.shouldReturnValidRepositoryName()",
"constructor": false,
"full_signature": "@Test public void should... | {
"fields": [
{
"declarator": "repositorySession",
"modifier": "@Inject\n private",
"original_string": "@Inject\n private Session repositorySession;",
"type": "Session",
"var_name": "repositorySession"
},
{
"declarator": "parentPath = \"/\"",
"modifier": "pr... | {
"body": "public String getRepositoryName() {\n return repositorySession.getRepository().getDescriptor(org.modeshape.jcr.api.Repository.REPOSITORY_NAME);\n }",
"class_method_signature": "CDIController.getRepositoryName()",
"constructor": false,
"full_signature": "public String getRepositoryName()",
... | {
"created": null,
"fork": null,
"fork_count": 7,
"is_fork": false,
"language": "Java",
"license": "licensed",
"repo_id": 9602474,
"size": 282,
"stargazer_count": 5,
"stars": null,
"updates": null,
"url": "https://github.com/ModeShape/quickstart"
} |
36960637_209 | {
"fields": [
{
"declarator": "BLOCKING_TIME_LIMIT_MILLIS = 10L",
"modifier": "private static final",
"original_string": "private static final long BLOCKING_TIME_LIMIT_MILLIS = 10L;",
"type": "long",
"var_name": "BLOCKING_TIME_LIMIT_MILLIS"
},
{
"declarator": "TEST_CURR... | {
"body": "@Test\n public void delegatesInterruptibleOperations() throws InterruptedException {\n acceptingService.lock(CLIENT, LOCK_REQUEST);\n verify(delegate, times(1)).lock(CLIENT, LOCK_REQUEST);\n }",
"class_method_signature": "BlockingTimeLimitedLockServiceTest.delegatesInterruptibleOperat... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(BlockingTimeLimitedLockService.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(BlockingTimeLimitedLockService.class);",
"type": "Logger",
"var_name"... | {
"body": "@Nullable\n @Override\n public LockRefreshToken lock(@PathParam(\"client\") String client, LockRequest request) throws InterruptedException {\n return callWithTimeLimit(\n () -> delegate.lock(client, request),\n ImmutableLockRequestSpecification.of(\"lock\", clien... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_659 | {
"fields": [
{
"declarator": "SWEEP_PRIORITY = TableReference.create(\n SweepSchema.INSTANCE.getNamespace(), SweepPriorityTable.getRawTableName())",
"modifier": "private static final",
"original_string": "private static final TableReference SWEEP_PRIORITY = TableReference.create(\n ... | {
"body": "@Test\n public void unmigratableTablesAreNotValidated() {\n kvs.createTable(OTHER_PRIORITY, AtlasDbConstants.EMPTY_TABLE_METADATA);\n assertThat(KeyValueServiceValidators.getValidatableTableNames(kvs, ImmutableSet.of(OTHER_PRIORITY))).isEmpty();\n }",
"class_method_signature": "KeyVal... | {
"fields": [],
"file": "atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/schema/KeyValueServiceValidators.java",
"identifier": "KeyValueServiceValidators",
"interfaces": "",
"methods": [
{
"class_method_signature": "KeyValueServiceValidators.KeyValueServiceValidators()",
"constructor": ... | {
"body": "public static Set<TableReference> getValidatableTableNames(\n KeyValueService kvs,\n Set<TableReference> unmigratableTables) {\n Set<TableReference> tableNames = KeyValueServiceMigratorUtils\n .getMigratableTableNames(kvs, unmigratableTables, null);\n retu... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_966 | {
"fields": [
{
"declarator": "adapter = new FreshTimestampSupplierAdapter()",
"modifier": "private final",
"original_string": "private final FreshTimestampSupplierAdapter adapter = new FreshTimestampSupplierAdapter();",
"type": "FreshTimestampSupplierAdapter",
"var_name": "adapter"
... | {
"body": "@Test\n public void throwsNullPointerExceptionIfSettingTimestampServiceToNull() {\n assertThatThrownBy(() -> adapter.setTimestampService(null)).isInstanceOf(NullPointerException.class);\n }",
"class_method_signature": "FreshTimestampSupplierAdapterTest.throwsNullPointerExceptionIfSettingTime... | {
"fields": [
{
"declarator": "timestampService",
"modifier": "private volatile",
"original_string": "private volatile TimestampService timestampService;",
"type": "TimestampService",
"var_name": "timestampService"
}
],
"file": "atlasdb-config/src/main/java/com/palantir/atlas... | {
"body": "public void setTimestampService(TimestampService timestampService) {\n Preconditions.checkNotNull(timestampService, \"Should not re-set timestamp service in a\"\n + \" FreshTimestampSupplierAdapter to null\");\n this.timestampService = timestampService;\n }",
"class_method... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_435 | {
"fields": [
{
"declarator": "INITIAL_TIMESTAMP = SweepQueueUtils.INITIAL_TIMESTAMP",
"modifier": "private static final",
"original_string": "private static final long INITIAL_TIMESTAMP = SweepQueueUtils.INITIAL_TIMESTAMP;",
"type": "long",
"var_name": "INITIAL_TIMESTAMP"
},
... | {
"body": "@Test\n public void repeatedlyFailingCasThrows() {\n KeyValueService mockKvs = mock(KeyValueService.class);\n when(mockKvs.get(any(), anyMap()))\n .thenReturn(ImmutableMap.of())\n .thenReturn(ImmutableMap.of(DUMMY, createValue(5L)))\n .thenRetur... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(ShardProgress.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(ShardProgress.class);",
"type": "Logger",
"var_name": "log"
},
{
"declar... | {
"body": "public long updateLastSweptTimestamp(ShardAndStrategy shardAndStrategy, long timestamp) {\n return increaseValueFromToAtLeast(shardAndStrategy, getLastSweptTimestamp(shardAndStrategy), timestamp);\n }",
"class_method_signature": "ShardProgress.updateLastSweptTimestamp(ShardAndStrategy shardAndS... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_15 | {
"fields": [
{
"declarator": "ALL_ZERO = new byte[] { 0, 0, 0, 0 }",
"modifier": "private static final",
"original_string": "private static final byte[] ALL_ZERO = new byte[] { 0, 0, 0, 0 };",
"type": "byte[]",
"var_name": "ALL_ZERO"
},
{
"declarator": "EIGHT_ONES = (b... | {
"body": "@Test\n public void testIllegalShardSize() {\n ImmutableTargetedSweepMetadata.Builder builder = ImmutableTargetedSweepMetadata.builder().from(\n ALL_ZERO_METADATA);\n assertThatThrownBy(() -> builder.shard(300).build()).isInstanceOf(IllegalArgumentException.class);\n }",
... | {
"fields": [
{
"declarator": "MAX_SHARDS = 256",
"modifier": "public static final",
"original_string": "public static final int MAX_SHARDS = 256;",
"type": "int",
"var_name": "MAX_SHARDS"
},
{
"declarator": "MAX_DEDICATED_ROWS = 64",
"modifier": "public static fi... | {
"body": "public abstract int shard();",
"class_method_signature": "TargetedSweepMetadata.shard()",
"constructor": false,
"full_signature": "public abstract int shard()",
"identifier": "shard",
"invocations": [],
"modifiers": "public abstract",
"parameters": "()",
"return": "int",
"signature": "int... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_570 | {
"fields": [
{
"declarator": "DEFAULT_INITIAL_MAPPING\n = TimestampPartitioningMap.of(ImmutableRangeMap.of(Range.atLeast(1L), 1))",
"modifier": "private static final",
"original_string": "private static final TimestampPartitioningMap<Integer> DEFAULT_INITIAL_MAPPING\n = Ti... | {
"body": "@Test\n public void throwsIfInitialMapDoesNotCoverFullRange() {\n assertThatThrownBy(() -> TimestampPartitioningMap.of(ImmutableRangeMap.of(Range.atLeast(42L), 1)))\n .isInstanceOf(IllegalArgumentException.class)\n .hasMessageContaining(\"its span does not cover prec... | {
"fields": [
{
"declarator": "ALL_TIMESTAMPS = Range.atLeast(1L)",
"modifier": "private static final",
"original_string": "private static final Range<Long> ALL_TIMESTAMPS = Range.atLeast(1L);",
"type": "Range<Long>",
"var_name": "ALL_TIMESTAMPS"
}
],
"file": "atlasdb-impl-sh... | {
"body": "public static <T> TimestampPartitioningMap<T> of(RangeMap<Long, T> initialState) {\n return ImmutableTimestampPartitioningMap.of(\n initialState.asMapOfRanges()\n .entrySet()\n .stream()\n .map(entry -> RangeAndValue... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_120 | {
"fields": [],
"file": "commons-db/src/test/java/com/palantir/nexus/db/sql/SQLStringTest.java",
"identifier": "SQLStringTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void testCanonicalizeStringAndRemoveWhitespaceEntirely() {\n List<String> testBatch = ImmutableList.of(\n \"/* UnregisteredSQLString */ insert foo into bar; /* UnregisteredSQLString */insert foo into bar;\",\n \"insert foo into bar; /* UnregisteredSQLS... | {
"fields": [
{
"declarator": "ALL_WORD_CHARS_REGEX = Pattern.compile(\"^[a-zA-Z_0-9\\\\.\\\\-]*$\")",
"modifier": "private static final",
"original_string": "private static final Pattern ALL_WORD_CHARS_REGEX = Pattern.compile(\"^[a-zA-Z_0-9\\\\.\\\\-]*$\");",
"type": "Pattern",
"var... | {
"body": "@VisibleForTesting\n static String canonicalizeStringAndRemoveWhitespaceEntirely(String sql) {\n return canonicalizeString(sql, true);\n }",
"class_method_signature": "SQLString.canonicalizeStringAndRemoveWhitespaceEntirely(String sql)",
"constructor": false,
"full_signature": "@VisibleF... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_989 | {
"fields": [
{
"declarator": "CLIENT = \"client\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT = \"client\";",
"type": "String",
"var_name": "CLIENT"
},
{
"declarator": "SERVERS_LIST_1 = ImmutableServerListConfig.builder(... | {
"body": "@Test\n public void namespacingCanDealWithTrailingSlash() {\n ServerListConfig namespacedServersList = ServerListConfigs.namespaceUris(SERVERS_LIST_3, CLIENT);\n assertThat(namespacedServersList.servers()).containsExactlyInAnyOrder(\"three/client\");\n }",
"class_method_signature": "S... | {
"fields": [],
"file": "atlasdb-config/src/main/java/com/palantir/atlasdb/config/ServerListConfigs.java",
"identifier": "ServerListConfigs",
"interfaces": "",
"methods": [
{
"class_method_signature": "ServerListConfigs.ServerListConfigs()",
"constructor": true,
"full_signature": "privat... | {
"body": "public static ServerListConfig namespaceUris(ServerListConfig config, String namespace) {\n Set<String> serversWithNamespaces = config\n .servers()\n .stream()\n .map(serverAddress -> serverAddress.replaceAll(\"/$\", \"\") + \"/\" + namespace)\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_823 | {
"fields": [
{
"declarator": "KEYSPACE = \"ks\"",
"modifier": "private static final",
"original_string": "private static final String KEYSPACE = \"ks\";",
"type": "String",
"var_name": "KEYSPACE"
},
{
"declarator": "KEYSPACE_2 = \"ks2\"",
"modifier": "private sta... | {
"body": "@Test\n public void resolvesConfigIfKeyspaceAndNamespaceProvidedAndMatch() {\n CassandraKeyValueServiceConfig newConfig =\n CassandraAtlasDbFactory.preprocessKvsConfig(CONFIG_WITH_KEYSPACE, Optional::empty,\n Optional.of(KEYSPACE));\n assertThat(newCon... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraAtlasDbFactory.class)",
"modifier": "private static",
"original_string": "private static Logger log = LoggerFactory.getLogger(CassandraAtlasDbFactory.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@VisibleForTesting\n static CassandraKeyValueServiceConfig preprocessKvsConfig(\n KeyValueServiceConfig config,\n Supplier<Optional<KeyValueServiceRuntimeConfig>> runtimeConfig,\n Optional<String> namespace) {\n Preconditions.checkArgument(config instanceof Cassan... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_198 | {
"fields": [
{
"declarator": "LOG_ID = UUID.randomUUID()",
"modifier": "private static final",
"original_string": "private static final UUID LOG_ID = UUID.randomUUID();",
"type": "UUID",
"var_name": "LOG_ID"
},
{
"declarator": "TABLE = TableReference.createFromFullyQua... | {
"body": "@Test\n public void registeringWatchWithWiderScopeLogsAlreadyWatchedLocksAgain() {\n LockDescriptor secondRow = AtlasRowLockDescriptor.of(TABLE.getQualifiedName(),\n PtBytes.toBytes(\"other_row\"));\n when(heldLocks.getLocks()).thenReturn(ImmutableList.of(LOCK, new Exclusive... | {
"fields": [
{
"declarator": "lockEventLog",
"modifier": "private final",
"original_string": "private final LockEventLog lockEventLog;",
"type": "LockEventLog",
"var_name": "lockEventLog"
},
{
"declarator": "watches = new AtomicReference<>(LockWatches.create())",
... | {
"body": "@Override\n public void startWatching(LockWatchRequest locksToWatch) {\n Optional<LockWatches> changes = addToWatches(locksToWatch);\n changes.ifPresent(this::logLockWatchEvent);\n }",
"class_method_signature": "LockWatchingServiceImpl.startWatching(LockWatchRequest locksToWatch)",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_462 | {
"fields": [
{
"declarator": "SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUtils.SWEEP_BATCH_SIZE)",
"modifier": "private static final",
"original_string": "private static final SweepIterationResult SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUti... | {
"body": "@Test\n public void whenUnableToAcquireShardReduceTasksIgnoringCoolDown() throws Exception {\n when(sweepIteration.call()).thenReturn(\n SUCCESS_SMALL,\n SUCCESS_MEDIUM,\n SUCCESS_LARGE,\n SweepIterationResults.unableToAcquireShard());\n... | {
"fields": [
{
"declarator": "COOL_DOWN = Duration.ofMinutes(5L)",
"modifier": "private static final",
"original_string": "private static final Duration COOL_DOWN = Duration.ofMinutes(5L);",
"type": "Duration",
"var_name": "COOL_DOWN"
},
{
"declarator": "BATCH_CELLS_LO... | {
"body": "void start(int initialThreads) {\n for (int i = 0; i < initialThreads; i++) {\n increaseNumberOfTasks(INITIAL_DELAY);\n }\n }",
"class_method_signature": "ScalingSweepTaskScheduler.start(int initialThreads)",
"constructor": false,
"full_signature": " void start(int initial... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_931 | {
"fields": [
{
"declarator": "SERVICE_NAME = \"service\"",
"modifier": "private static final",
"original_string": "private static final String SERVICE_NAME = \"service\";",
"type": "String",
"var_name": "SERVICE_NAME"
},
{
"declarator": "USER_AGENT = UserAgent.of(UserA... | {
"body": "@Test\n public void serviceConfigBlockGeneration() {\n ServicesConfigBlock servicesConfigBlock = DialogueClientOptions.toServicesConfigBlock(\n ImmutableMap.of(SERVICE_NAME, REMOTE_SERVICE_CONFIGURATION_EXTENDED_TIMEOUT));\n\n assertThat(servicesConfigBlock.services()).conta... | {
"fields": [],
"file": "atlasdb-conjure/src/main/java/com/palantir/atlasdb/http/v2/DialogueClientOptions.java",
"identifier": "DialogueClientOptions",
"interfaces": "",
"methods": [
{
"class_method_signature": "DialogueClientOptions.DialogueClientOptions()",
"constructor": true,
"full_s... | {
"body": "public static ServicesConfigBlock toServicesConfigBlock(\n Map<String, RemoteServiceConfiguration> serviceNameToRemoteConfiguration) {\n Map<String, PartialServiceConfiguration> configMap = KeyedStream.stream(serviceNameToRemoteConfiguration)\n .map(remoteServiceConfigurati... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_874 | {
"fields": [
{
"declarator": "tempFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "tempFolder"
},
{
"declarator": "CLIEN... | {
"body": "@Test\n public void canFetchAndCombineHistoriesAcrossNamespaceAndUseCasePairs() {\n Map<NamespaceAndUseCase, Set<PaxosValue>> expected = writeLogsForRangeOfNamespaceUseCasePairs();\n Set<NamespaceAndUseCase> allNamespaceAndUseCases = expected.keySet();\n\n List<HistoryQuery> history... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PaxosLogHistoryProvider.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PaxosLogHistoryProvider.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public List<CompletePaxosHistoryForNamespaceAndUseCase> getHistory() {\n Map<NamespaceAndUseCase, Long> lastVerifiedSequences = getNamespaceAndUseCaseToLastVerifiedSeqMap();\n\n PaxosHistoryOnSingleNode localPaxosHistory = localHistoryLoader.getLocalPaxosHistory(lastVerifiedSequences);\n\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_177 | {
"fields": [
{
"declarator": "NUM_NODES = 5",
"modifier": "private static final",
"original_string": "private static final int NUM_NODES = 5;",
"type": "int",
"var_name": "NUM_NODES"
},
{
"declarator": "QUORUM_SIZE = NUM_NODES / 2 + 1",
"modifier": "private stati... | {
"body": "@Test\n public void canSafelyGetAgreedStateFromPrehistory() {\n assertThat(store.getAgreedState(Long.MIN_VALUE).getBound()).isEqualTo(0);\n }",
"class_method_signature": "PaxosTimestampBoundStoreTest.canSafelyGetAgreedStateFromPrehistory()",
"constructor": false,
"full_signature": "@Test... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PaxosTimestampBoundStore.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PaxosTimestampBoundStore.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@VisibleForTesting\n SequenceAndBound getAgreedState(long seq) {\n final Optional<SequenceAndBound> state = getLearnedState(seq);\n if (state.isPresent()) {\n return state.get();\n }\n\n // In the common case seq - 1 will be agreed upon before seq is prepared.\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_42 | {
"fields": [
{
"declarator": "TEST_TABLE = TableReference.createFromFullyQualifiedName(\"ns.test_table\")",
"modifier": "private static final",
"original_string": "private static final TableReference TEST_TABLE = TableReference.createFromFullyQualifiedName(\"ns.test_table\");",
"type": "T... | {
"body": "@Test\n public void testGetTableSizeForSameTableHitsCache() throws Exception {\n assertThat(valueStyleCache.getTableType(\n connectionSupplier, TEST_TABLE, AtlasDbConstants.DEFAULT_METADATA_TABLE),\n is(TableValueStyle.OVERFLOW));\n assertThat(valueStyleCache.... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TableValueStyleCache.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TableValueStyleCache.class);",
"type": "Logger",
"var_name": "log"
},
{... | {
"body": "public TableValueStyle getTableType(\n final ConnectionSupplier connectionSupplier,\n final TableReference tableRef,\n TableReference metadataTable) {\n try {\n return valueStyleByTableRef.get(tableRef, () -> {\n SqlConnection conn = connect... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_527 | {
"fields": [
{
"declarator": "FIRST_LOCK_ID = PersistentLockId.fromString(\"2-4-6-0-1\")",
"modifier": "private static final",
"original_string": "private static final PersistentLockId FIRST_LOCK_ID = PersistentLockId.fromString(\"2-4-6-0-1\");",
"type": "PersistentLockId",
"var_nam... | {
"body": "@Test\n @GuardedBy(\"manager\")\n public void canAcquireLock() {\n manager.acquirePersistentLockWithRetry();\n\n assertThat(manager.lockId, is(mockLockId));\n verify(mockPls, times(1)).acquireBackupLock(\"Sweep\");\n }",
"class_method_signature": "PersistentLockManagerTest.c... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PersistentLockManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PersistentLockManager.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "public void acquirePersistentLockWithRetry() {\n while (!tryAcquirePersistentLock()) {\n waitForRetry();\n }\n }",
"class_method_signature": "PersistentLockManager.acquirePersistentLockWithRetry()",
"constructor": false,
"full_signature": "public void acquirePersistentLock... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_248 | {
"fields": [
{
"declarator": "SIMPLE_NAME_METADATA_DESCRIPTION = NameMetadataDescription.safe(\n \"string\", ValueType.STRING)",
"modifier": "private static final",
"original_string": "private static final NameMetadataDescription SIMPLE_NAME_METADATA_DESCRIPTION = NameMetadataDescrip... | {
"body": "@Test\n public void throwsIfNoRelevantFieldsProvided() {\n String missingFields = \"{\\\"type\\\": \\\"string\\\"}\";\n\n assertThatThrownBy(() -> SIMPLE_NAME_METADATA_DESCRIPTION.parseFromJson(missingFields, false))\n .isInstanceOf(IllegalArgumentException.class)\n ... | {
"fields": [
{
"declarator": "HASH_ROW_COMPONENT_NAME = \"hashOfRowComponents\"",
"modifier": "public static final",
"original_string": "public static final String HASH_ROW_COMPONENT_NAME = \"hashOfRowComponents\";",
"type": "String",
"var_name": "HASH_ROW_COMPONENT_NAME"
},
... | {
"body": "public byte[] parseFromJson(String json, boolean allowPrefix) {\n try {\n JsonNode jsonNode = OBJECT_MAPPER.readTree(json);\n Preconditions.checkState(jsonNode.isObject(),\n \"Only JSON objects can be deserialized into parsed byte arrays. Passed json was: %s... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_618 | {
"fields": [
{
"declarator": "SETUP_TASK_METRIC_NAME =\n SnapshotTransactionManager.class.getCanonicalName() + \".setupTask\"",
"modifier": "private static final",
"original_string": "private static final String SETUP_TASK_METRIC_NAME =\n SnapshotTransactionManager.class.g... | {
"body": "@Test\n public void closesCloseableLockServiceOnClosingTransactionManager() throws IOException {\n snapshotTransactionManager.close();\n verify(closeableLockService, times(1)).close();\n }",
"class_method_signature": "SnapshotTransactionManagerTest.closesCloseableLockServiceOnClosingT... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SnapshotTransactionManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SnapshotTransactionManager.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public void close() {\n log.info(\"Calling close on snapshot transaction manager\");\n if (!isClosed.compareAndSet(false, true)) {\n log.info(\"Snapshot transaction manager has already been closed, performing no action\");\n return;\n }\n\n t... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_927 | {
"fields": [
{
"declarator": "binaryOperator = mock(BinaryOperator.class)",
"modifier": "private final",
"original_string": "private final BinaryOperator<Integer> binaryOperator = mock(BinaryOperator.class);",
"type": "BinaryOperator<Integer>",
"var_name": "binaryOperator"
},
... | {
"body": "@Test\n public void retryableExceptionWithRetryOtherAsDirectCauseIsCausedByRetryOther() {\n RetryableException retryableException = createRetryableException(QosException.retryOther(createUrl()));\n assertThat(FastFailoverProxy.isCausedByRetryOther(retryableException)).isTrue();\n }",
... | {
"fields": [
{
"declarator": "TIME_LIMIT = Duration.ofSeconds(10)",
"modifier": "private static final",
"original_string": "private static final Duration TIME_LIMIT = Duration.ofSeconds(10);",
"type": "Duration",
"var_name": "TIME_LIMIT"
},
{
"declarator": "delegate",
... | {
"body": "@VisibleForTesting\n static boolean isCausedByRetryOther(Throwable throwable) {\n Throwable cause = throwable;\n while (cause != null) {\n if (cause instanceof QosException.RetryOther) {\n return true;\n }\n if (cause instanceof UnknownRemote... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_474 | {
"fields": [
{
"declarator": "LOW_TS = 10L",
"modifier": "private static final",
"original_string": "private static final long LOW_TS = 10L;",
"type": "long",
"var_name": "LOW_TS"
},
{
"declarator": "LOW_TS2 = 2 * LOW_TS",
"modifier": "private static final",
... | {
"body": "@Test\n public void sweepWithNoCandidatesBeforeSweepTimestampReportsNothingToSweep() {\n enqueueWriteCommitted(TABLE_CONS, getSweepTsCons());\n sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD));\n\n assertThat(metricsManager).hasTargetedOutcomeEqualTo(CONSERVATIVE, SweepOutc... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_531 | {
"fields": [
{
"declarator": "FIRST_LOCK_ID = PersistentLockId.fromString(\"2-4-6-0-1\")",
"modifier": "private static final",
"original_string": "private static final PersistentLockId FIRST_LOCK_ID = PersistentLockId.fromString(\"2-4-6-0-1\");",
"type": "PersistentLockId",
"var_nam... | {
"body": "@Test\n public void shutdownWithoutAcquireIsNoOp() {\n manager.shutdown();\n\n verifyZeroInteractions(mockPls);\n }",
"class_method_signature": "PersistentLockManagerTest.shutdownWithoutAcquireIsNoOp()",
"constructor": false,
"full_signature": "@Test public void shutdownWithoutAcq... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PersistentLockManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PersistentLockManager.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "public synchronized void shutdown() {\n log.info(\"Shutting down...\");\n\n try {\n isShutDown = true;\n while (lockId != null) {\n releasePersistentLock();\n }\n log.info(\"Shutdown completed!\");\n } catch (Exception e) {\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_54 | {
"fields": [
{
"declarator": "exception = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException exception = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "exception"
},
{
"declarator":... | {
"body": "@Test\n public void shouldNotAllocateTimestampsIfAllocationFailuresDisallowsIt() {\n doThrow(RuntimeException.class).when(allocationFailures).verifyWeShouldIssueMoreTimestamps();\n\n try {\n store.storeUpperLimit(1_000);\n } catch (Exception e) {\n // ignore ex... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final TimestampBoundStore delegate;",
"type": "TimestampBoundStore",
"var_name": "delegate"
},
{
"declarator": "failures",
"modifier": "private final",
"origin... | {
"body": "@Override\n public synchronized void storeUpperLimit(long limit) {\n failures.verifyWeShouldIssueMoreTimestamps();\n throwIfInterrupted();\n\n try {\n delegate.storeUpperLimit(limit);\n } catch (Throwable t) {\n throw failures.responseTo(t);\n }\n... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_161 | {
"fields": [
{
"declarator": "generator",
"modifier": "private",
"original_string": "private DistributingModulusGenerator generator;",
"type": "DistributingModulusGenerator",
"var_name": "generator"
}
],
"file": "timelock-impl/src/test/java/com/palantir/atlasdb/timelock/tran... | {
"body": "@Test\n public void repeatedlyReassignsUnmarkedResidues() {\n setupGeneratorWithModulus(3);\n\n requestResiduesAndAssertEachUsedOnce(3);\n requestResiduesAndAssertEachUsedOnce(3);\n requestResiduesAndAssertEachUsedOnce(3);\n\n unmarkResidue(2);\n unmarkResidue(2... | {
"fields": [
{
"declarator": "referenceCounts",
"modifier": "private final",
"original_string": "private final SortedSet<ReferenceCountedResidue> referenceCounts;",
"type": "SortedSet<ReferenceCountedResidue>",
"var_name": "referenceCounts"
}
],
"file": "timelock-impl/src/ma... | {
"body": "public synchronized void unmarkResidue(int residue) {\n // There are usually only 16 elements, so this O(n) algo probably will do, but we can pair this with a HashMap\n // and/or make ReferenceCountedResidue modifiable if we decide to use higher moduli in the future.\n for (ReferenceCo... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_862 | {
"fields": [
{
"declarator": "MAX_ATTEMPTS = 3",
"modifier": "private static final",
"original_string": "private static final int MAX_ATTEMPTS = 3;",
"type": "int",
"var_name": "MAX_ATTEMPTS"
},
{
"declarator": "RETRY_PERIOD = Duration.ofSeconds(1)",
"modifier": ... | {
"body": "@Test\n public void returnsImmediatelyIfPredicatePasses() throws ExecutionException {\n ListenableFuture<Integer> result = retrier.execute(function);\n future.set(0);\n scheduler.runUntilIdle();\n assertThat(Futures.getDone(result)).isZero();\n }",
"class_method_signatur... | {
"fields": [
{
"declarator": "maxAttempts",
"modifier": "private final",
"original_string": "private final int maxAttempts;",
"type": "int",
"var_name": "maxAttempts"
},
{
"declarator": "delayBetweenAttempts",
"modifier": "private final",
"original_string":... | {
"body": "public ListenableFuture<T> execute(Supplier<ListenableFuture<T>> supplier) {\n return execute(supplier, maxAttempts);\n }",
"class_method_signature": "AsyncRetrier.execute(Supplier<ListenableFuture<T>> supplier)",
"constructor": false,
"full_signature": "public ListenableFuture<T> execute(S... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_589 | {
"fields": [
{
"declarator": "EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L)",
"modifier": "private static final",
"original_string": "private static final Function<Long, Long> EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L);",
"type": "Function<Long, Long>",
"var_name": "EXT... | {
"body": "@Test\n public void getThrowsIfFunctionReturnsUnmappedValue() {\n assertThatThrownBy(() -> delegatingTransactionService.get(7L))\n .isInstanceOf(IllegalStateException.class)\n .hasMessageContaining(\"Could not find a transaction service for timestamp {}\");\n }",
... | {
"fields": [
{
"declarator": "timestampToServiceKey",
"modifier": "private final",
"original_string": "private final Function<Long, T> timestampToServiceKey;",
"type": "Function<Long, T>",
"var_name": "timestampToServiceKey"
},
{
"declarator": "keyedServices",
"m... | {
"body": "@CheckForNull\n @Override\n public Long get(long startTimestamp) {\n return AtlasFutures.getUnchecked(getInternal(keyedSyncServices, startTimestamp));\n }",
"class_method_signature": "SplitKeyDelegatingTransactionService.get(long startTimestamp)",
"constructor": false,
"full_signature... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_423 | {
"fields": [
{
"declarator": "LOW_START_TS = 6L",
"modifier": "private static final",
"original_string": "private static final long LOW_START_TS = 6L;",
"type": "long",
"var_name": "LOW_START_TS"
},
{
"declarator": "LOW_COMMIT_TS = 7L",
"modifier": "private stati... | {
"body": "@Test\n public void conservative_getTimestampsToSweep_oneEntryBelowTimestamp_oneAbove_returnsNone() {\n long sweepTimestampLowerThanCommitTimestamp = HIGH_COMMIT_TS - 1;\n List<CandidateCellForSweeping> candidates = twoCommittedTimestampsForSingleCell();\n SweepableCellFilter filter... | {
"fields": [
{
"declarator": "commitTsCache",
"modifier": "private final",
"original_string": "private final CommitTsCache commitTsCache;",
"type": "CommitTsCache",
"var_name": "commitTsCache"
},
{
"declarator": "sweeper",
"modifier": "private final",
"orig... | {
"body": "public BatchOfCellsToSweep getCellsToSweep(List<CandidateCellForSweeping> candidates) {\n Map<Long, Long> startToCommitTs = commitTsCache.loadBatch(getAllValidTimestamps(candidates));\n ImmutableBatchOfCellsToSweep.Builder builder = ImmutableBatchOfCellsToSweep.builder();\n long numCel... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_970 | {
"fields": [
{
"declarator": "NAMESPACE = \"namespace\"",
"modifier": "private static final",
"original_string": "private static final String NAMESPACE = \"namespace\";",
"type": "String",
"var_name": "NAMESPACE"
},
{
"declarator": "LOCK_CLIENT_STRING = \"client\"",
... | {
"body": "@Test\n public void lockWithFullLockResponseHasLongTimeout() throws InterruptedException {\n sensitiveClient.lockWithFullLockResponse(NAMESPACE, LOCK_CLIENT, LOCK_REQUEST);\n\n verify(longTimeout).lockWithFullLockResponse(NAMESPACE, LOCK_CLIENT, LOCK_REQUEST);\n verify(shortTimeout,... | {
"fields": [
{
"declarator": "longTimeoutProxy",
"modifier": "private final",
"original_string": "private final LockRpcClient longTimeoutProxy;",
"type": "LockRpcClient",
"var_name": "longTimeoutProxy"
},
{
"declarator": "shortTimeoutProxy",
"modifier": "private ... | {
"body": "@Override\n public Optional<LockResponse> lockWithFullLockResponse(String namespace, LockClient client, LockRequest request)\n throws InterruptedException {\n return longTimeoutProxy.lockWithFullLockResponse(namespace, client, request);\n }",
"class_method_signature": "TimeoutSens... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_835 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/cassandra/CassandraCellLoadingConfigTest.java",
"identifier": "CassandraCellLoadingConfigTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void canCreateConfigWhereCrossColumnBatchLimitEqualsSingleQueryLimit() {\n assertThatCode(() -> CassandraCellLoadingConfig.of(777, 777)).doesNotThrowAnyException();\n }",
"class_method_signature": "CassandraCellLoadingConfigTest.canCreateConfigWhereCrossColumnBatchLimitEqualsS... | {
"fields": [],
"file": "atlasdb-cassandra/src/main/java/com/palantir/atlasdb/cassandra/CassandraCellLoadingConfig.java",
"identifier": "CassandraCellLoadingConfig",
"interfaces": "",
"methods": [
{
"class_method_signature": "CassandraCellLoadingConfig.crossColumnLoadBatchLimit()",
"constructo... | {
"body": "static CassandraCellLoadingConfig of(int crossColumnLoadBatchLimit, int singleQueryLoadBatchLimit) {\n return ImmutableCassandraCellLoadingConfig.builder()\n .crossColumnLoadBatchLimit(crossColumnLoadBatchLimit)\n .singleQueryLoadBatchLimit(singleQueryLoadBatchLimit)\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_136 | {
"fields": [
{
"declarator": "FUTURE_TIMESTAMP = 3141592653589L",
"modifier": "private static final",
"original_string": "private static final long FUTURE_TIMESTAMP = 3141592653589L;",
"type": "long",
"var_name": "FUTURE_TIMESTAMP"
},
{
"declarator": "TEST_TABLE = Tabl... | {
"body": "@Test\n public void atomicTablesDelegatedToSourceAreNotDropped() {\n KeyValueService toTableSplittingKvs = TableSplittingKeyValueService.create(\n ImmutableList.of(new InMemoryKeyValueService(false), fromKvs),\n Maps.toMap(AtlasDbConstants.HIDDEN_TABLES, ignore -> fr... | {
"fields": [
{
"declarator": "printer\n = new OutputPrinter(LoggerFactory.getLogger(KeyValueServiceMigrator.class))",
"modifier": "private static final",
"original_string": "private static final OutputPrinter printer\n = new OutputPrinter(LoggerFactory.getLogger(KeyValueSe... | {
"body": "public static KeyValueServiceMigrator setupMigrator(MigratorSpec migratorSpec) {\n AtlasDbServices fromServices = migratorSpec.fromServices();\n AtlasDbServices toServices = migratorSpec.toServices();\n TimestampManagementService toTimestampManagementService = toServices.getManagedTime... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_566 | {
"fields": [
{
"declarator": "TIMESTAMP_1 = 12345",
"modifier": "private static final",
"original_string": "private static final long TIMESTAMP_1 = 12345;",
"type": "long",
"var_name": "TIMESTAMP_1"
},
{
"declarator": "TIMESTAMP_2 = 34567L",
"modifier": "private ... | {
"body": "@Test\n public void getsRangeAtBoundThresholdThrowsIfNoValueActuallyPresent() {\n assertThatThrownBy(() -> manager.getRangeAtBoundThreshold(ValueAndBound.of(Optional.empty(), TIMESTAMP_1)))\n .isInstanceOf(SafeIllegalStateException.class)\n .hasMessageContaining(\"Un... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TransactionSchemaManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TransactionSchemaManager.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@VisibleForTesting\n Map.Entry<Range<Long>, Integer> getRangeAtBoundThreshold(ValueAndBound<InternalSchemaMetadata> valueAndBound) {\n return valueAndBound.value()\n .orElseThrow(() -> new SafeIllegalStateException(\"Unexpectedly found no value in store\"))\n .timest... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_771 | {
"fields": [
{
"declarator": "KEY_1 = {120}",
"modifier": "private static final",
"original_string": "private static final byte[] KEY_1 = {120};",
"type": "byte[]",
"var_name": "KEY_1"
},
{
"declarator": "COLUMN_NAME_1 = \"foo\"",
"modifier": "private static fina... | {
"body": "@Test\n public void emptyByteArrayIsNotValidTimestampData() {\n assertThat(CassandraTimestampUtils.isValidTimestampData(EMPTY_BYTE_ARRAY)).isFalse();\n }",
"class_method_signature": "CassandraTimestampUtilsTest.emptyByteArrayIsNotValidTimestampData()",
"constructor": false,
"full_signatu... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraTimestampUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraTimestampUtils.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static boolean isValidTimestampData(byte[] data) {\n return data != null && data.length == Long.BYTES;\n }",
"class_method_signature": "CassandraTimestampUtils.isValidTimestampData(byte[] data)",
"constructor": false,
"full_signature": "public static boolean isValidTimestampData(byte... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_321 | {
"fields": [
{
"declarator": "ARG_NAME = \"argName\"",
"modifier": "private static final",
"original_string": "private static final String ARG_NAME = \"argName\";",
"type": "String",
"var_name": "ARG_NAME"
},
{
"declarator": "SAFE_TABLE_REFERENCE = TableReference.creat... | {
"body": "@Test\n public void returnsSafeTableWhenTableIsSafe() {\n assertThat(LoggingArgs.safeTableOrPlaceholder(SAFE_TABLE_REFERENCE)).isEqualTo(SAFE_TABLE_REFERENCE);\n }",
"class_method_signature": "LoggingArgsTest.returnsSafeTableWhenTableIsSafe()",
"constructor": false,
"full_signature": "@T... | {
"fields": [
{
"declarator": "PLACEHOLDER_TABLE_NAME = \"{table}\"",
"modifier": "private static final",
"original_string": "private static final String PLACEHOLDER_TABLE_NAME = \"{table}\";",
"type": "String",
"var_name": "PLACEHOLDER_TABLE_NAME"
},
{
"declarator": "P... | {
"body": "public static TableReference safeTableOrPlaceholder(TableReference tableReference) {\n if (logArbitrator.isTableReferenceSafe(tableReference)) {\n return tableReference;\n } else {\n return PLACEHOLDER_TABLE_REFERENCE;\n }\n }",
"class_method_signature": "Log... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_634 | {
"fields": [
{
"declarator": "EXCEPTION = new IllegalStateException(\"bad\")",
"modifier": "private static final",
"original_string": "private static final RuntimeException EXCEPTION = new IllegalStateException(\"bad\");",
"type": "RuntimeException",
"var_name": "EXCEPTION"
},
... | {
"body": "@Test\n public void returnsTerminalIfBoundIsAboveFreshTimestamp() {\n TimestampCorroborationConsistencyCheck check = createForTimestamps(111, 42);\n assertThat(check.apply(mock(TransactionManager.class))).satisfies(\n result -> {\n assertThat(result.consis... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TimestampCorroborationConsistencyCheck.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TimestampCorroborationConsistencyCheck.class);",
"type": "Logger",
... | {
"body": "@Override\n public TransactionManagerConsistencyResult apply(TransactionManager transactionManager) {\n // The ordering is important, because if we get a timestamp first, we may have a false positive if we have\n // a long GC between grabbing the fresh timestamp and the lower bound (e.g. i... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_264 | {
"fields": [
{
"declarator": "TABLE_REF = TableReference.createWithEmptyNamespace(\"TestTable\")",
"modifier": "private static",
"original_string": "private static TableReference TABLE_REF = TableReference.createWithEmptyNamespace(\"TestTable\");",
"type": "TableReference",
"var_nam... | {
"body": "@Test\n public void testCanRenderGuavaOptionals() {\n TableRenderer renderer = new TableRenderer(\"package\", Namespace.DEFAULT_NAMESPACE, OptionalType.GUAVA);\n assertThat(renderer.render(\"table\", getSimpleTableDefinition(TABLE_REF), NO_INDICES))\n .contains(\"import com.... | {
"fields": [
{
"declarator": "packageName",
"modifier": "private final",
"original_string": "private final String packageName;",
"type": "String",
"var_name": "packageName"
},
{
"declarator": "namespace",
"modifier": "private final",
"original_string": "pri... | {
"body": "public String render(String rawTableName, TableDefinition table, SortedSet<IndexMetadata> indices) {\n return new ClassRenderer(rawTableName, table, indices).render();\n }",
"class_method_signature": "TableRenderer.render(String rawTableName, TableDefinition table, SortedSet<IndexMetadata> indi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_78 | {
"fields": [
{
"declarator": "NON_K8S_INSTANCE = new KubernetesHostnames(() -> \"fake-url\")",
"modifier": "private static final",
"original_string": "private static final KubernetesHostnames NON_K8S_INSTANCE = new KubernetesHostnames(() -> \"fake-url\");",
"type": "KubernetesHostnames",
... | {
"body": "@Test\n public void getCurrentHostname_k8s() throws Exception {\n assertThat(K8S_INSTANCE.getCurrentHostname()).isEqualTo(\"svc-47775-2.svc-47775.namespace\");\n }",
"class_method_signature": "KubernetesHostnamesTest.getCurrentHostname_k8s()",
"constructor": false,
"full_signature": "@Te... | {
"fields": [
{
"declarator": "INSTANCE = new KubernetesHostnames(() -> {\n try {\n return InetAddress.getLocalHost().getCanonicalHostName();\n } catch (UnknownHostException e) {\n throw new RuntimeException(e);\n }\n })",
"modifier": "public static final"... | {
"body": "public String getCurrentHostname() {\n Matcher matcher = getHostnameComponents();\n return String.format(\n POD_HOSTNAME_TEMPLATE,\n matcher.group(\"service\"),\n Integer.valueOf(matcher.group(\"podId\")),\n matcher.group(\"service\"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_97 | {
"fields": [
{
"declarator": "CLIENT1 = Client.of(\"client-1\")",
"modifier": "private static final",
"original_string": "private static final Client CLIENT1 = Client.of(\"client-1\");",
"type": "Client",
"var_name": "CLIENT1"
},
{
"declarator": "CLIENT2 = Client.of(\"... | {
"body": "@Test\n public void shouldBeHealthyIfQuorumNodesUpAndOnePingedSuccessfully() {\n HealthCheckPinger leader1 = getMockOfPingableLeaderWherePingReturns(ALL_CLIENTS);\n HealthCheckPinger leader2 = getMockOfPingableLeaderWherePingReturns(ImmutableSet.of());\n HealthCheckPinger leader3 = ... | {
"fields": [
{
"declarator": "HEALTH_CHECK_TIME_LIMIT = Duration.ofSeconds(7)",
"modifier": "private static final",
"original_string": "private static final Duration HEALTH_CHECK_TIME_LIMIT = Duration.ofSeconds(7);",
"type": "Duration",
"var_name": "HEALTH_CHECK_TIME_LIMIT"
},
... | {
"body": "public HealthCheckDigest getStatus() {\n Set<Client> namespacesToCheck = namespaceTracker.trackedNamespaces();\n\n PaxosResponses<PaxosContainer<Map<Client, HealthCheckResponse>>> responses =\n PaxosQuorumChecker.collectAsManyResponsesAsPossible(\n Immuta... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_458 | {
"fields": [
{
"declarator": "SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUtils.SWEEP_BATCH_SIZE)",
"modifier": "private static final",
"original_string": "private static final SweepIterationResult SUCCESS_HUGE = SweepIterationResults\n .success(SweepQueueUti... | {
"body": "@Test\n public void increaseCanPreventReduction() throws Exception {\n when(sweepIteration.call()).thenReturn(\n SUCCESS_LARGE, SUCCESS_LARGE,\n SUCCESS_SMALL);\n\n scheduler.start(2);\n tickClock();\n runSweepIterations(1 + 4);\n\n tickCl... | {
"fields": [
{
"declarator": "COOL_DOWN = Duration.ofMinutes(5L)",
"modifier": "private static final",
"original_string": "private static final Duration COOL_DOWN = Duration.ofMinutes(5L);",
"type": "Duration",
"var_name": "COOL_DOWN"
},
{
"declarator": "BATCH_CELLS_LO... | {
"body": "void start(int initialThreads) {\n for (int i = 0; i < initialThreads; i++) {\n increaseNumberOfTasks(INITIAL_DELAY);\n }\n }",
"class_method_signature": "ScalingSweepTaskScheduler.start(int initialThreads)",
"constructor": false,
"full_signature": " void start(int initial... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_376 | {
"fields": [
{
"declarator": "IMAGE = new byte[] {0, 1, 2, 3}",
"modifier": "private static final",
"original_string": "private static final byte[] IMAGE = new byte[] {0, 1, 2, 3};",
"type": "byte[]",
"var_name": "IMAGE"
},
{
"declarator": "USER = UserProfile.newBuilde... | {
"body": "@Test\n public void testBirthdayIndex() {\n final UUID userId = storeUser();\n runWithRetry(store -> {\n Set<UUID> usersWithBirthday = store.getUsersWithBirthday(USER.getBirthEpochDay());\n Assert.assertEquals(ImmutableSet.of(userId), usersWithBirthday);\n ... | {
"fields": [
{
"declarator": "txnMgr",
"modifier": "final",
"original_string": "final TransactionManager txnMgr;",
"type": "TransactionManager",
"var_name": "txnMgr"
},
{
"declarator": "tx",
"modifier": "final",
"original_string": "final Transaction tx;",
... | {
"body": "public Set<UUID> getUsersWithBirthday(long birthEpochDays) {\n UserProfileTable table = tables.getUserProfileTable(tx);\n UserBirthdaysIdxTable idx = UserBirthdaysIdxTable.of(table);\n List<UserBirthdaysIdxColumnValue> columns = idx.getRowColumns(UserBirthdaysIdxRow.of(birthEpochDays))... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_726 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/HiddenTablesTest.java",
"identifier": "HiddenTablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldSayMetadataIsHidden() {\n assertThat(HiddenTables.isHidden(AtlasDbConstants.DEFAULT_METADATA_TABLE), is(true));\n }",
"class_method_signature": "HiddenTablesTest.shouldSayMetadataIsHidden()",
"constructor": false,
"full_signature": "@Test public void shouldSayMe... | {
"fields": [
{
"declarator": "CASSANDRA_TABLES = ImmutableSet.of(\n AtlasDbConstants.TIMESTAMP_TABLE,\n AtlasDbConstants.DEFAULT_METADATA_TABLE,\n AtlasDbConstants.PERSISTED_LOCKS_TABLE)",
"modifier": "private static final",
"original_string": "private static fi... | {
"body": "public static boolean isHidden(TableReference tableReference) {\n return CASSANDRA_TABLES.contains(tableReference)\n || AtlasDbConstants.DEPRECATED_SWEEP_TABLES_WITH_NO_METADATA.contains(tableReference)\n || tableReference.getTablename().startsWith(AtlasDbConstants.LOCK... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_233 | {
"fields": [
{
"declarator": "TAG_KEY_1 = \"tag1\"",
"modifier": "private static final",
"original_string": "private static final String TAG_KEY_1 = \"tag1\";",
"type": "String",
"var_name": "TAG_KEY_1"
},
{
"declarator": "TAG_VALUE_1 = \"tagVal1\"",
"modifier": ... | {
"body": "@Test\n public void shouldThrowIfFirstMetricTagKeyContainsSemiColon() throws Exception {\n assertThatThrownBy(() -> MetricNameUtils.getMetricName(METRIC_NAME,\n ImmutableMap.of(\"tag;1\", TAG_VALUE_1, TAG_KEY_2, TAG_VALUE_2)))\n .isInstanceOf(IllegalArgumentException... | {
"fields": [
{
"declarator": "MAX_ALLOWED_TAGS = 10",
"modifier": "private static final",
"original_string": "private static final int MAX_ALLOWED_TAGS = 10;",
"type": "int",
"var_name": "MAX_ALLOWED_TAGS"
},
{
"declarator": "DELIMITER = \";\"",
"modifier": "priv... | {
"body": "public static String getMetricName(String metricName, Map<String, String> tags) {\n Preconditions.checkArgument(tags.size() <= MAX_ALLOWED_TAGS, \"Too many tags set on the metric %s. \"\n + \"Maximum allowed number of tags is %s, found %s.\", metricName, MAX_ALLOWED_TAGS, tags.size())... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_399 | {
"fields": [
{
"declarator": "RECOMPUTE_MILLIS = 10",
"modifier": "private static final",
"original_string": "private static final long RECOMPUTE_MILLIS = 10;",
"type": "long",
"var_name": "RECOMPUTE_MILLIS"
},
{
"declarator": "METRICS_CONFIGURATION\n = Targ... | {
"body": "@Test\n public void entriesReadAccumulatesOverShards() {\n metrics.updateEntriesRead(CONS_ZERO, 1);\n metrics.updateEntriesRead(CONS_ONE, 4);\n metrics.updateEntriesRead(CONS_ZERO, 1);\n\n assertThat(metricsManager).hasEntriesReadConservativeEqualTo(6);\n }",
"class_meth... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweepMetrics.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweepMetrics.class);",
"type": "Logger",
"var_name": "log"
},
{... | {
"body": "public void updateEntriesRead(ShardAndStrategy shardStrategy, long reads) {\n updateMetricsIfPresent(shardStrategy, metrics -> metrics.updateEntriesRead(reads));\n }",
"class_method_signature": "TargetedSweepMetrics.updateEntriesRead(ShardAndStrategy shardStrategy, long reads)",
"constructor"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_663 | {
"fields": [
{
"declarator": "EXCEPTION = new RuntimeException(\"test\")",
"modifier": "private static final",
"original_string": "private static final RuntimeException EXCEPTION = new RuntimeException(\"test\");",
"type": "RuntimeException",
"var_name": "EXCEPTION"
},
{
... | {
"body": "@Test\n public void otherTasksStillRunInPresenceOfSlowTasksThatTimeOut() {\n SafeShutdownRunner runner = new SafeShutdownRunner(Duration.ofMillis(50));\n\n runner.shutdownSafely(blockingUninterruptibleRunnable);\n runner.shutdownSafely(blockingUninterruptibleRunnable);\n runn... | {
"fields": [
{
"declarator": "executor = PTExecutors.newCachedThreadPool(\"safe-shutdown-runner\")",
"modifier": "private final",
"original_string": "private final ExecutorService executor = PTExecutors.newCachedThreadPool(\"safe-shutdown-runner\");",
"type": "ExecutorService",
"var... | {
"body": "public void shutdownSafely(Runnable shutdownCallback) {\n Future<?> future = executor.submit(shutdownCallback);\n try {\n future.get(timeoutDuration.toMillis(), TimeUnit.MILLISECONDS);\n } catch (InterruptedException e) {\n Thread.currentThread().interrupt();\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_819 | {
"fields": [
{
"declarator": "KEYSPACE = \"ks\"",
"modifier": "private static final",
"original_string": "private static final String KEYSPACE = \"ks\";",
"type": "String",
"var_name": "KEYSPACE"
},
{
"declarator": "KEYSPACE_2 = \"ks2\"",
"modifier": "private sta... | {
"body": "@Test\n public void throwsWhenPreprocessingConfigWithKeyspaceAndDifferentNamespace() {\n assertThatThrownBy(\n () -> CassandraAtlasDbFactory.preprocessKvsConfig(CONFIG_WITH_KEYSPACE, Optional::empty,\n Optional.of(KEYSPACE_2)))\n .isInstanceOf(... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraAtlasDbFactory.class)",
"modifier": "private static",
"original_string": "private static Logger log = LoggerFactory.getLogger(CassandraAtlasDbFactory.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@VisibleForTesting\n static CassandraKeyValueServiceConfig preprocessKvsConfig(\n KeyValueServiceConfig config,\n Supplier<Optional<KeyValueServiceRuntimeConfig>> runtimeConfig,\n Optional<String> namespace) {\n Preconditions.checkArgument(config instanceof Cassan... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_730 | {
"fields": [],
"file": "atlasdb-cassandra/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/HiddenTablesTest.java",
"identifier": "HiddenTablesTest",
"interfaces": "",
"superclass": ""
} | {
"body": "@Test\n public void shouldSayANonNamespacedVisibleTableIsNotHidden() {\n assertThat(HiddenTables.isHidden(TableReference.createWithEmptyNamespace(\"table\")), is(false));\n }",
"class_method_signature": "HiddenTablesTest.shouldSayANonNamespacedVisibleTableIsNotHidden()",
"constructor": fal... | {
"fields": [
{
"declarator": "CASSANDRA_TABLES = ImmutableSet.of(\n AtlasDbConstants.TIMESTAMP_TABLE,\n AtlasDbConstants.DEFAULT_METADATA_TABLE,\n AtlasDbConstants.PERSISTED_LOCKS_TABLE)",
"modifier": "private static final",
"original_string": "private static fi... | {
"body": "public static boolean isHidden(TableReference tableReference) {\n return CASSANDRA_TABLES.contains(tableReference)\n || AtlasDbConstants.DEPRECATED_SWEEP_TABLES_WITH_NO_METADATA.contains(tableReference)\n || tableReference.getTablename().startsWith(AtlasDbConstants.LOCK... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_360 | {
"fields": [
{
"declarator": "backoffMechanism\n = mock(StandardPeriodicBackoffStrategy.BackoffMechanism.class)",
"modifier": "private final",
"original_string": "private final StandardPeriodicBackoffStrategy.BackoffMechanism backoffMechanism\n = mock(StandardPeriodicBacko... | {
"body": "@Test\n public void invokesBackoffIfCalledWithNonZeroTime() throws InterruptedException {\n StreamStoreBackoffStrategy backoffStrategy = createStaticBackoffStrategy(1, 100);\n backoffStrategy.accept(1);\n verify(backoffMechanism).backoff(100L);\n }",
"class_method_signature": "... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(StandardPeriodicBackoffStrategy.class)",
"modifier": "private final",
"original_string": "private final Logger log = LoggerFactory.getLogger(StandardPeriodicBackoffStrategy.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public void accept(long blockNumber) {\n if (persistenceConfiguration.get().writePauseDurationMillis() == 0) {\n return;\n }\n\n if (shouldBackoffBeforeWritingBlockNumber(blockNumber)) {\n try {\n long writePauseDurationMillis = persi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_675 | {
"fields": [
{
"declarator": "STRING_SUPPLIER = mock(Supplier.class)",
"modifier": "private final",
"original_string": "private final Supplier<String> STRING_SUPPLIER = mock(Supplier.class);",
"type": "Supplier<String>",
"var_name": "STRING_SUPPLIER"
},
{
"declarator":... | {
"body": "@Test\n public void throwsIfMappingFunctionThrows() {\n when(STRING_SUPPLIER.get()).thenReturn(\"42!)*()\");\n assertThatThrownBy(TRANSFORMING_SUPPLIER::get).isInstanceOf(NumberFormatException.class);\n }",
"class_method_signature": "CachedTransformingSupplierTest.throwsIfMappingFunct... | {
"fields": [
{
"declarator": "inputSupplier",
"modifier": "private final",
"original_string": "private final Supplier<T> inputSupplier;",
"type": "Supplier<T>",
"var_name": "inputSupplier"
},
{
"declarator": "outputFunction",
"modifier": "private final",
"o... | {
"body": "@Override\n public synchronized U get() {\n T currentInput = inputSupplier.get();\n\n if (Objects.equals(cachedInput, currentInput)) {\n return cachedOutput;\n }\n\n cachedInput = currentInput;\n cachedOutput = outputFunction.apply(cachedInput);\n ret... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_225 | {
"fields": [
{
"declarator": "CUSTOM_METRIC_NAME = \"foo\"",
"modifier": "private static final",
"original_string": "private static final String CUSTOM_METRIC_NAME = \"foo\";",
"type": "String",
"var_name": "CUSTOM_METRIC_NAME"
},
{
"declarator": "PING_METHOD = \"ping\... | {
"body": "@Test\n public void instrumentWithCustomNameTimed() {\n TestService service = AtlasDbMetrics.instrumentTimed(\n metrics, TestService.class, testService, CUSTOM_METRIC_NAME);\n\n assertMethodInstrumented(\n MetricRegistry.name(CUSTOM_METRIC_NAME, PING_METHOD), ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(AtlasDbMetrics.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(AtlasDbMetrics.class);",
"type": "Logger",
"var_name": "log"
}
],
"file": "at... | {
"body": "public static <T, U extends T> T instrumentTimed(\n MetricRegistry metricRegistry, Class<T> serviceInterface, U service) {\n return instrument(metricRegistry, serviceInterface, service, serviceInterface.getName(), instrumentTimedOnly());\n }",
"class_method_signature": "AtlasDbMetric... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_39 | {
"fields": [
{
"declarator": "thrown = ExpectedException.none()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();",
"type": "ExpectedException",
"var_name": "thrown"
}
],
"file": "atlasdb-dbkvs/src/t... | {
"body": "@Test\n @SuppressWarnings(\"Slf4jConstantLogMessage\")\n public void shouldBeFineOn_9_6_12() {\n Logger log = mock(Logger.class);\n PostgresVersionCheck.checkDatabaseVersion(\"9.6.12\", log);\n verifyNoMoreInteractions(log);\n }",
"class_method_signature": "PostgresVersionCh... | {
"fields": [
{
"declarator": "MIN_POSTGRES_VERSION = \"9.6\"",
"modifier": "static final",
"original_string": "static final String MIN_POSTGRES_VERSION = \"9.6\";",
"type": "String",
"var_name": "MIN_POSTGRES_VERSION"
}
],
"file": "atlasdb-dbkvs/src/main/java/com/palantir/at... | {
"body": "public static void checkDatabaseVersion(String version, Logger log) {\n boolean checkPasses = version.matches(\"^[\\\\.0-9]+$\")\n && VersionStrings.compareVersions(version, MIN_POSTGRES_VERSION) >= 0;\n if (VersionStrings.compareVersions(version, \"9.5\") >= 0\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_419 | {
"fields": [
{
"declarator": "metricsManager",
"modifier": "private",
"original_string": "private MetricsManager metricsManager;",
"type": "MetricsManager",
"var_name": "metricsManager"
},
{
"declarator": "legacyMetrics",
"modifier": "private",
"original_st... | {
"body": "@Test\n public void targetedSweepDoesNotRegisterExcludedOutcomes() {\n targetedSweepMetrics.registerOccurrenceOf(CONSERVATIVE, SweepOutcome.SUCCESS);\n targetedSweepMetrics.registerOccurrenceOf(THOROUGH, SweepOutcome.SUCCESS);\n Arrays.stream(SweepOutcome.values())\n ... | {
"fields": [
{
"declarator": "LEGACY_OUTCOMES = Arrays.asList(SweepOutcome.values())",
"modifier": "public static final",
"original_string": "public static final List<SweepOutcome> LEGACY_OUTCOMES = Arrays.asList(SweepOutcome.values());",
"type": "List<SweepOutcome>",
"var_name": "L... | {
"body": "public void registerOccurrenceOf(SweepOutcome outcome) {\n if (outcome == SweepOutcome.FATAL) {\n metrics.get().fatal().set(true);\n return;\n }\n\n metrics.get().reservoir().update(outcome.ordinal());\n }",
"class_method_signature": "SweepOutcomeMetrics.regi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_337 | {
"fields": [
{
"declarator": "TABLE_REFERENCE_1 = TableReference.createFromFullyQualifiedName(\"atlas.db\")",
"modifier": "private static final",
"original_string": "private static final TableReference TABLE_REFERENCE_1 = TableReference.createFromFullyQualifiedName(\"atlas.db\");",
"type"... | {
"body": "@Test\n public void columnNamesInUnknownTablesAreNotSafe() {\n SafeLoggableData safeLoggableData = ImmutableSafeLoggableData.builder().build();\n assertThat(safeLoggableData.isRowComponentNameSafe(TABLE_REFERENCE_3, ROW_COMPONENT_1)).isFalse();\n }",
"class_method_signature": "SafeLog... | {
"fields": [],
"file": "atlasdb-client/src/main/java/com/palantir/atlasdb/logging/SafeLoggableData.java",
"identifier": "SafeLoggableData",
"interfaces": "implements KeyValueServiceLogArbitrator",
"methods": [
{
"class_method_signature": "SafeLoggableData.permittedTableReferences()",
"constru... | {
"body": "@Override\n public boolean isRowComponentNameSafe(TableReference tableReference, String rowComponentName) {\n return permittedRowComponents().containsKey(tableReference)\n && permittedRowComponents().get(tableReference).contains(rowComponentName);\n }",
"class_method_signature... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_767 | {
"fields": [
{
"declarator": "KEY_1 = {120}",
"modifier": "private static final",
"original_string": "private static final byte[] KEY_1 = {120};",
"type": "byte[]",
"var_name": "KEY_1"
},
{
"declarator": "COLUMN_NAME_1 = \"foo\"",
"modifier": "private static fina... | {
"body": "@Test\n public void canGetValuesFromSelectionResult() {\n List<Column> columnList1 = buildKeyValueColumnList(KEY_1, COLUMN_BYTES_1, VALUE_1);\n List<Column> columnList2 = buildKeyValueColumnList(KEY_2, COLUMN_BYTES_2, VALUE_2);\n\n CqlResult mockResult = createMockCqlResult(\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraTimestampUtils.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraTimestampUtils.class);",
"type": "Logger",
"var_name": "log"
},... | {
"body": "public static Map<String, byte[]> getValuesFromSelectionResult(CqlResult result) {\n return result.getRows().stream()\n .map(CqlRow::getColumns)\n .collect(Collectors.toMap(\n cols -> PtBytes.toString(getNamedColumnValue(cols, COLUMN_NAME_COLUMN))... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_788 | {
"fields": [
{
"declarator": "DEFAULT_PORT = 5000",
"modifier": "private static final",
"original_string": "private static final int DEFAULT_PORT = 5000;",
"type": "int",
"var_name": "DEFAULT_PORT"
},
{
"declarator": "OTHER_PORT = 6000",
"modifier": "private stat... | {
"body": "@Test\n public void shouldReturnAddressForSingleHostInPool() throws UnknownHostException {\n CassandraService cassandra = clientPoolWithServers(ImmutableSet.of(HOST_1));\n\n InetSocketAddress resolvedHost = cassandra.getAddressForHost(HOSTNAME_1);\n\n assertThat(resolvedHost).isEqua... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraClientPool.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraClientPool.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "@VisibleForTesting\n InetSocketAddress getAddressForHost(String host) throws UnknownHostException {\n if (config.addressTranslation().containsKey(host)) {\n return config.addressTranslation().get(host);\n }\n\n InetAddress resolvedHost = InetAddress.getByName(host);\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_272 | {
"fields": [
{
"declarator": "testFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder testFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "testFolder"
},
{
"declarator": "CLASS... | {
"body": "@Test\n public void testLongTableNameLengthFailsBoth() {\n Schema schema = new Schema(\"Table\", TEST_PACKAGE, Namespace.EMPTY_NAMESPACE);\n String longTableName = String.join(\"\", Collections.nCopies(1000, \"x\"));\n TableReference tableRef = TableReference.createWithEmptyNamespac... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(Schema.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(Schema.class);",
"type": "Logger",
"var_name": "log"
},
{
"declarator": "name",... | {
"body": "public void addTableDefinition(String tableName, TableDefinition definition) {\n Preconditions.checkArgument(\n !tableDefinitions.containsKey(tableName) && !indexDefinitions.containsKey(tableName),\n \"Table already defined: %s\", tableName);\n Preconditions.chec... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_622 | {
"fields": [
{
"declarator": "SETUP_TASK_METRIC_NAME =\n SnapshotTransactionManager.class.getCanonicalName() + \".setupTask\"",
"modifier": "private static final",
"original_string": "private static final String SETUP_TASK_METRIC_NAME =\n SnapshotTransactionManager.class.g... | {
"body": "@Test\n public void runsCloseOnce() {\n snapshotTransactionManager.close();\n verify(cleaner).close();\n snapshotTransactionManager.close();\n verifyNoMoreInteractions(cleaner);\n }",
"class_method_signature": "SnapshotTransactionManagerTest.runsCloseOnce()",
"construc... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(SnapshotTransactionManager.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(SnapshotTransactionManager.class);",
"type": "Logger",
"var_name": "log"
... | {
"body": "@Override\n public void close() {\n log.info(\"Calling close on snapshot transaction manager\");\n if (!isClosed.compareAndSet(false, true)) {\n log.info(\"Snapshot transaction manager has already been closed, performing no action\");\n return;\n }\n\n t... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_858 | {
"fields": [
{
"declarator": "tempFolder = new TemporaryFolder()",
"modifier": "@Rule\n public",
"original_string": "@Rule\n public TemporaryFolder tempFolder = new TemporaryFolder();",
"type": "TemporaryFolder",
"var_name": "tempFolder"
},
{
"declarator": "sourc... | {
"body": "@Test\n public void retryWritesFiveTimes() {\n long lowerBound = 10;\n long upperBound = 25;\n insertValuesWithinBounds(lowerBound, upperBound, source);\n\n PaxosStateLog<PaxosValue> targetMock = mock(PaxosStateLog.class);\n AtomicInteger failureCount = new AtomicInteg... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(PaxosStateLogMigrator.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(PaxosStateLogMigrator.class);",
"type": "Logger",
"var_name": "log"
},
... | {
"body": "public static <V extends Persistable & Versionable> long migrateAndReturnCutoff(MigrationContext<V> context) {\n PaxosStateLogMigrator<V> migrator = new PaxosStateLogMigrator<>(context.sourceLog(), context.destinationLog());\n if (!context.migrationState().isInMigratedState()) {\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_81 | {
"fields": [
{
"declarator": "NON_K8S_INSTANCE = new KubernetesHostnames(() -> \"fake-url\")",
"modifier": "private static final",
"original_string": "private static final KubernetesHostnames NON_K8S_INSTANCE = new KubernetesHostnames(() -> \"fake-url\");",
"type": "KubernetesHostnames",
... | {
"body": "@Test\n public void getClusterMembers_k8s_incorrectCount() throws Exception {\n expectedException.expect(RuntimeException.class);\n expectedException.expectMessage(\"Current Pod ID 2 indicates a cluster size greater than the expected 2.\");\n K8S_INSTANCE.getClusterMembers(2);\n ... | {
"fields": [
{
"declarator": "INSTANCE = new KubernetesHostnames(() -> {\n try {\n return InetAddress.getLocalHost().getCanonicalHostName();\n } catch (UnknownHostException e) {\n throw new RuntimeException(e);\n }\n })",
"modifier": "public static final"... | {
"body": "public List<String> getClusterMembers(int expectedClusterSize) {\n Matcher podTemplateMatcher = getHostnameComponents();\n\n int ourPodId = Integer.parseInt(podTemplateMatcher.group(\"podId\"));\n Preconditions.checkArgument(ourPodId < expectedClusterSize,\n \"Current Po... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_593 | {
"fields": [
{
"declarator": "EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L)",
"modifier": "private static final",
"original_string": "private static final Function<Long, Long> EXTRACT_LAST_DIGIT = num -> LongMath.mod(num, 10L);",
"type": "Function<Long, Long>",
"var_name": "EXT... | {
"body": "@Test\n public void getMultipleDelegatesRequestsToGetMultipleOnDelegates() {\n when(delegate1.get(any())).thenReturn(ImmutableMap.of(1L, 2L));\n assertThat(delegatingTransactionService.get(ImmutableList.of(1L)))\n .isEqualTo(ImmutableMap.of(1L, 2L));\n verifyDelegateH... | {
"fields": [
{
"declarator": "timestampToServiceKey",
"modifier": "private final",
"original_string": "private final Function<Long, T> timestampToServiceKey;",
"type": "Function<Long, T>",
"var_name": "timestampToServiceKey"
},
{
"declarator": "keyedServices",
"m... | {
"body": "@CheckForNull\n @Override\n public Long get(long startTimestamp) {\n return AtlasFutures.getUnchecked(getInternal(keyedSyncServices, startTimestamp));\n }",
"class_method_signature": "SplitKeyDelegatingTransactionService.get(long startTimestamp)",
"constructor": false,
"full_signature... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_439 | {
"fields": [
{
"declarator": "NOTHING = getTableRef(\"nothing\")",
"modifier": "private static final",
"original_string": "private static final TableReference NOTHING = getTableRef(\"nothing\");",
"type": "TableReference",
"var_name": "NOTHING"
},
{
"declarator": "CONS... | {
"body": "@Test\n public void getStrategyThrowsOnUncheckedException() {\n RuntimeException cause = new RuntimeException(\"cause\");\n when(mockKvs.getMetadataForTable(any())).thenThrow(cause);\n assertThatThrownBy(() -> partitioner.getStrategy(getWriteInfoWithFixedCellHash(getTableRef(\"a\"),... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(WriteInfoPartitioner.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(WriteInfoPartitioner.class);",
"type": "Logger",
"var_name": "log"
},
{... | {
"body": "@VisibleForTesting\n Optional<SweeperStrategy> getStrategy(WriteInfo writeInfo) {\n return cache.getUnchecked(writeInfo.tableRef());\n }",
"class_method_signature": "WriteInfoPartitioner.getStrategy(WriteInfo writeInfo)",
"constructor": false,
"full_signature": "@VisibleForTesting Option... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_985 | {
"fields": [
{
"declarator": "CLIENT = \"testClient\"",
"modifier": "private static final",
"original_string": "private static final String CLIENT = \"testClient\";",
"type": "String",
"var_name": "CLIENT"
},
{
"declarator": "SERVER_1 = \"http://localhost:8080\"",
... | {
"body": "@Test\n public void canCreateWithoutClientSpecified() {\n ImmutableTimeLockClientConfig.builder()\n .serversList(SERVERS_LIST)\n .build();\n }",
"class_method_signature": "TimeLockClientConfigTest.canCreateWithoutClientSpecified()",
"constructor": false,
"fu... | {
"fields": [],
"file": "atlasdb-config/src/main/java/com/palantir/atlasdb/config/TimeLockClientConfig.java",
"identifier": "TimeLockClientConfig",
"interfaces": "",
"methods": [
{
"class_method_signature": "TimeLockClientConfig.client()",
"constructor": false,
"full_signature": "@Deprec... | {
"body": "@Deprecated\n @Value.Default\n public ServerListConfig serversList() {\n return ImmutableServerListConfig.builder().build();\n }",
"class_method_signature": "TimeLockClientConfig.serversList()",
"constructor": false,
"full_signature": "@Deprecated @Value.Default public ServerListConfi... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_19 | {
"fields": [
{
"declarator": "RUNTIME = new RuntimeException()",
"modifier": "private static final",
"original_string": "private static final Exception RUNTIME = new RuntimeException();",
"type": "Exception",
"var_name": "RUNTIME"
},
{
"declarator": "ATLAS_DEPENDENCY =... | {
"body": "@Test\n public void noMatches() {\n RetryLimitReachedException exception = new RetryLimitReachedException(\n ImmutableList.of(RUNTIME, ATLAS_DEPENDENCY, GENERIC));\n Assertions.assertThat(exception.suppressed(IllegalStateException.class)).isFalse();\n }",
"class_method_... | {
"fields": [
{
"declarator": "MESSAGE = \"Request was retried and failed each time for the request.\"",
"modifier": "private static final",
"original_string": "private static final String MESSAGE = \"Request was retried and failed each time for the request.\";",
"type": "String",
"v... | {
"body": "public <E extends Exception> boolean suppressed(Class<E> type) {\n return Arrays.stream(getSuppressed()).anyMatch(type::isInstance);\n }",
"class_method_signature": "RetryLimitReachedException.suppressed(Class<E> type)",
"constructor": false,
"full_signature": "public boolean suppressed(Cla... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_655 | {
"fields": [
{
"declarator": "SWEEP_PRIORITY = TableReference.create(\n SweepSchema.INSTANCE.getNamespace(), SweepPriorityTable.getRawTableName())",
"modifier": "private static final",
"original_string": "private static final TableReference SWEEP_PRIORITY = TableReference.create(\n ... | {
"body": "@Test\n public void otherPriorityTableIsNotASweepTable() {\n assertThat(KeyValueServiceValidators.isSweepTableReference(OTHER_PRIORITY)).isFalse();\n }",
"class_method_signature": "KeyValueServiceValidatorsTest.otherPriorityTableIsNotASweepTable()",
"constructor": false,
"full_signature"... | {
"fields": [],
"file": "atlasdb-impl-shared/src/main/java/com/palantir/atlasdb/schema/KeyValueServiceValidators.java",
"identifier": "KeyValueServiceValidators",
"interfaces": "",
"methods": [
{
"class_method_signature": "KeyValueServiceValidators.KeyValueServiceValidators()",
"constructor": ... | {
"body": "@VisibleForTesting\n static boolean isSweepTableReference(TableReference tableReference) {\n return tableReference.getNamespace().equals(SweepSchema.INSTANCE.getNamespace());\n }",
"class_method_signature": "KeyValueServiceValidators.isSweepTableReference(TableReference tableReference)",
"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_205 | {
"fields": [
{
"declarator": "lockWatches = new AtomicReference<>(LockWatches.create())",
"modifier": "private final",
"original_string": "private final AtomicReference<LockWatches> lockWatches = new AtomicReference<>(LockWatches.create());",
"type": "AtomicReference<LockWatches>",
... | {
"body": "@Test\n public void emptyLogTest() {\n LockWatchStateUpdate update = log.getLogDiff(NEGATIVE_VERSION_CURRENT_LOG_ID);\n LockWatchStateUpdate.Success success = UpdateVisitors.assertSuccess(update);\n assertThat(success.lastKnownVersion()).isEqualTo(-1L);\n assertThat(success.e... | {
"fields": [
{
"declarator": "logId",
"modifier": "private final",
"original_string": "private final UUID logId;",
"type": "UUID",
"var_name": "logId"
},
{
"declarator": "slidingWindow = new ArrayLockEventSlidingWindow(1000)",
"modifier": "private final",
"... | {
"body": "@Override\n public synchronized LockWatchStateUpdate getLogDiff(Optional<LockWatchVersion> fromVersion) {\n return tryGetNextEvents(fromVersion).orElseGet(this::calculateSnapshot);\n }",
"class_method_signature": "LockEventLogImpl.getLogDiff(Optional<LockWatchVersion> fromVersion)",
"const... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_710 | {
"fields": [
{
"declarator": "DEFAULT_VALUE = 123",
"modifier": "private static final",
"original_string": "private static final int DEFAULT_VALUE = 123;",
"type": "int",
"var_name": "DEFAULT_VALUE"
},
{
"declarator": "delegate = mock(Supplier.class)",
"modifier"... | {
"body": "@Test\n public void exceptionsArePropagatedForCoalescedCalls() {\n RuntimeException expected = new RuntimeException(\"foo\");\n when(delegate.get()).thenThrow(expected);\n\n freezableDelegate.freeze();\n AsyncTasks tasks = getConcurrently(5);\n freezableDelegate.unfree... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final Supplier<T> delegate;",
"type": "Supplier<T>",
"var_name": "delegate"
},
{
"declarator": "executor =\n MoreExecutors.listeningDecorator(PTExecutors.newCac... | {
"body": "@Override\n public T get() {\n Round present = round;\n if (present.isFirstToArrive()) {\n present.execute();\n return present.getResult();\n }\n Round next = present.awaitDone();\n if (next.isFirstToArrive()) {\n next.execute();\n ... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_340 | {
"fields": [
{
"declarator": "TABLE_REFERENCE_1 = TableReference.createFromFullyQualifiedName(\"atlas.db\")",
"modifier": "private static final",
"original_string": "private static final TableReference TABLE_REFERENCE_1 = TableReference.createFromFullyQualifiedName(\"atlas.db\");",
"type"... | {
"body": "@Test\n public void columnNamesDoNotInheritSafetyFromTableReferences() {\n SafeLoggableData safeLoggableData = ImmutableSafeLoggableData.builder()\n .addPermittedTableReferences(TABLE_REFERENCE_1)\n .build();\n\n assertThat(safeLoggableData.isColumnNameSafe(TA... | {
"fields": [],
"file": "atlasdb-client/src/main/java/com/palantir/atlasdb/logging/SafeLoggableData.java",
"identifier": "SafeLoggableData",
"interfaces": "implements KeyValueServiceLogArbitrator",
"methods": [
{
"class_method_signature": "SafeLoggableData.permittedTableReferences()",
"constru... | {
"body": "@Override\n public boolean isColumnNameSafe(TableReference tableReference, String columnName) {\n return permittedColumnNames().containsKey(tableReference)\n && permittedColumnNames().get(tableReference).contains(columnName);\n }",
"class_method_signature": "SafeLoggableData.i... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_897 | {
"fields": [
{
"declarator": "TOKEN_1 = LockToken.of(UUID.randomUUID())",
"modifier": "private static final",
"original_string": "private static final LockToken TOKEN_1 = LockToken.of(UUID.randomUUID());",
"type": "LockToken",
"var_name": "TOKEN_1"
},
{
"declarator": "... | {
"body": "@Test\n public void getTimestampDelegates() {\n long timestamp = 123L;\n when(timestampService.getFreshTimestamp()).thenReturn(timestamp);\n\n assertThat(timelock.getFreshTimestamp()).isEqualTo(timestamp);\n }",
"class_method_signature": "TimeLockClientTest.getTimestampDelegate... | {
"fields": [
{
"declarator": "refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\")",
"modifier": "private static final",
"original_string": "private static final ScheduledExecutorService refreshExecutor = createSingleThreadScheduledExecutor(\"refresh\");",
"type": "Scheduled... | {
"body": "@Override\n public long getFreshTimestamp() {\n return timestampService.getFreshTimestamp();\n }",
"class_method_signature": "TimeLockClient.getFreshTimestamp()",
"constructor": false,
"full_signature": "@Override public long getFreshTimestamp()",
"identifier": "getFreshTimestamp",
"... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_194 | {
"fields": [
{
"declarator": "REQUEST_1 = UUID.randomUUID()",
"modifier": "private static final",
"original_string": "private static final UUID REQUEST_1 = UUID.randomUUID();",
"type": "UUID",
"var_name": "REQUEST_1"
},
{
"declarator": "REQUEST_2 = UUID.randomUUID()",
... | {
"body": "@Test\n public void removesRequestIfCompleteSynchronously() {\n AsyncResult<Void> result = AsyncResult.completedResult();\n awaitedLocks.getExistingOrAwait(REQUEST_1, () -> result);\n\n assertRequestsWereRemoved(REQUEST_1);\n }",
"class_method_signature": "AwaitedLocksCollectio... | {
"fields": [
{
"declarator": "requestsById = Maps.newConcurrentMap()",
"modifier": "@VisibleForTesting\n final",
"original_string": "@VisibleForTesting\n final ConcurrentMap<UUID, AsyncResult<Void>> requestsById = Maps.newConcurrentMap();",
"type": "ConcurrentMap<UUID, AsyncResult<V... | {
"body": "public AsyncResult<Void> getExistingOrAwait(\n UUID requestId,\n Supplier<AsyncResult<Void>> lockAwaiter) {\n AsyncResult<Void> result = requestsById.computeIfAbsent(\n requestId,\n ignored -> lockAwaiter.get());\n\n registerCompletionHandle... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_481 | {
"fields": [
{
"declarator": "LOW_TS = 10L",
"modifier": "private static final",
"original_string": "private static final long LOW_TS = 10L;",
"type": "long",
"var_name": "LOW_TS"
},
{
"declarator": "LOW_TS2 = 2 * LOW_TS",
"modifier": "private static final",
... | {
"body": "@Test\n public void conservativeSweepDeletesAllButLatestWithSingleDeleteAllTimestamps() {\n long lastWriteTs = 5000;\n for (long i = 1; i <= lastWriteTs; i++) {\n enqueueWriteCommitted(TABLE_CONS, i);\n }\n sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD));... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_878 | {
"fields": [
{
"declarator": "LOCK_TOKEN = LockToken.of(UUID.randomUUID())",
"modifier": "private static final",
"original_string": "private static final LockToken LOCK_TOKEN = LockToken.of(UUID.randomUUID());",
"type": "LockToken",
"var_name": "LOCK_TOKEN"
}
],
"file": "loc... | {
"body": "@Test\n public void sharingSharedLockTokenThrows() {\n LockTokenShare lockTokenShare = getSharedLockTokens(LOCK_TOKEN, 2).get(0);\n assertThatThrownBy(() -> LockTokenShare.share(lockTokenShare, 2))\n .hasMessage(\"Can not share a shared lock token\");\n }",
"class_metho... | {
"fields": [
{
"declarator": "requestId",
"modifier": "private final",
"original_string": "private final UUID requestId;",
"type": "UUID",
"var_name": "requestId"
},
{
"declarator": "sharedLockToken",
"modifier": "private final",
"original_string": "private... | {
"body": "static Stream<LockToken> share(LockToken token, int referenceCount) {\n Preconditions.checkArgument(referenceCount > 0, \"Reference count should be more than zero\");\n Preconditions.checkArgument(!(token instanceof LockTokenShare), \"Can not share a shared lock token\");\n ReferenceCo... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_252 | {
"fields": [
{
"declarator": "SIMPLE_NAME_METADATA_DESCRIPTION = NameMetadataDescription.safe(\n \"string\", ValueType.STRING)",
"modifier": "private static final",
"original_string": "private static final NameMetadataDescription SIMPLE_NAME_METADATA_DESCRIPTION = NameMetadataDescrip... | {
"body": "@Test\n public void differentOrderingOfFieldsInSerializedFormIsAcceptable() {\n String beginWithEnd = \"{\\\"omega\\\": \\\"O(n)\\\", \\\"alpha\\\": 42, \\\"beta\\\": \\\"AAAAAAA==\\\", \\\"gamma\\\": \\\"boo\\\"}\";\n assertThat(MULTIPART_NAME_METADATA_DESCRIPTION.parseFromJson(beginWithE... | {
"fields": [
{
"declarator": "HASH_ROW_COMPONENT_NAME = \"hashOfRowComponents\"",
"modifier": "public static final",
"original_string": "public static final String HASH_ROW_COMPONENT_NAME = \"hashOfRowComponents\";",
"type": "String",
"var_name": "HASH_ROW_COMPONENT_NAME"
},
... | {
"body": "public byte[] parseFromJson(String json, boolean allowPrefix) {\n try {\n JsonNode jsonNode = OBJECT_MAPPER.readTree(json);\n Preconditions.checkState(jsonNode.isObject(),\n \"Only JSON objects can be deserialized into parsed byte arrays. Passed json was: %s... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_602 | {
"fields": [
{
"declarator": "delegate = mock(TransactionService.class)",
"modifier": "private final",
"original_string": "private final TransactionService delegate = mock(TransactionService.class);",
"type": "TransactionService",
"var_name": "delegate"
},
{
"declarato... | {
"body": "@Test\n public void returnsTimestampBeforeStartingTimestampWhenGettingInvalidTimestamps() {\n assertThat(preStartHandlingService.get(ZERO_TIMESTAMP)).isEqualTo(BEFORE_TIME_TIMESTAMP);\n assertThat(preStartHandlingService.get(NEGATIVE_TIMESTAMP)).isEqualTo(BEFORE_TIME_TIMESTAMP);\n }",
... | {
"fields": [
{
"declarator": "delegate",
"modifier": "private final",
"original_string": "private final TransactionService delegate;",
"type": "TransactionService",
"var_name": "delegate"
},
{
"declarator": "synchronousAsyncTransactionService",
"modifier": "priva... | {
"body": "@CheckForNull\n @Override\n public Long get(long startTimestamp) {\n return AtlasFutures.getUnchecked(getInternal(startTimestamp, synchronousAsyncTransactionService));\n }",
"class_method_signature": "PreStartHandlingTransactionService.get(long startTimestamp)",
"constructor": false,
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_317 | {
"fields": [
{
"declarator": "ARG_NAME = \"argName\"",
"modifier": "private static final",
"original_string": "private static final String ARG_NAME = \"argName\";",
"type": "String",
"var_name": "ARG_NAME"
},
{
"declarator": "SAFE_TABLE_REFERENCE = TableReference.creat... | {
"body": "@Test\n public void returnsUnsafeRangeWhenAllColumnsUnsafe() {\n assertThat(LoggingArgs.range(SAFE_TABLE_REFERENCE, UNSAFE_RANGE_REQUEST))\n .isInstanceOf(UnsafeArg.class);\n }",
"class_method_signature": "LoggingArgsTest.returnsUnsafeRangeWhenAllColumnsUnsafe()",
"construct... | {
"fields": [
{
"declarator": "PLACEHOLDER_TABLE_NAME = \"{table}\"",
"modifier": "private static final",
"original_string": "private static final String PLACEHOLDER_TABLE_NAME = \"{table}\";",
"type": "String",
"var_name": "PLACEHOLDER_TABLE_NAME"
},
{
"declarator": "P... | {
"body": "public static Arg<RangeRequest> range(TableReference tableReference, RangeRequest range) {\n return getArg(\"range\",\n range,\n range.getColumnNames().stream().allMatch(\n (columnName) -> logArbitrator.isColumnNameSafe(tableReference, PtBytes.toS... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_747 | {
"fields": [
{
"declarator": "DC_1 = \"dc1\"",
"modifier": "private static final",
"original_string": "private static final String DC_1 = \"dc1\";",
"type": "String",
"var_name": "DC_1"
},
{
"declarator": "DC_2 = \"dc2\"",
"modifier": "private static final",
... | {
"body": "@Test\n public void oneDcFewerRacksThanRfAndMoreHostsThanRfThrows() throws TException {\n setTopology(defaultDcDetails(RACK_1, HOST_1),\n defaultDcDetails(RACK_2, HOST_2),\n defaultDcDetails(RACK_1, HOST_3),\n defaultDcDetails(RACK_2, HOST_4));\n ... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(CassandraVerifier.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(CassandraVerifier.class);",
"type": "Logger",
"var_name": "log"
},
{
... | {
"body": "static Set<String> sanityCheckDatacenters(CassandraClient client, CassandraKeyValueServiceConfig config)\n throws TException {\n createSimpleRfTestKeyspaceIfNotExists(client);\n\n Multimap<String, String> datacenterToRack = HashMultimap.create();\n Set<String> hosts = Sets.n... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_182 | {
"fields": [
{
"declarator": "CLIENT = Client.of(\"alice\")",
"modifier": "private static final",
"original_string": "private static final Client CLIENT = Client.of(\"alice\");",
"type": "Client",
"var_name": "CLIENT"
},
{
"declarator": "PAXOS_ROUND_ONE = 1",
"mo... | {
"body": "@Test\n public void addsClientsInSubdirectory() {\n paxosComponents.learner(CLIENT);\n File expectedAcceptorLogDir = legacyDirectory.resolve(\n Paths.get(CLIENT.value(), PaxosTimeLockConstants.ACCEPTOR_SUBDIRECTORY_PATH)).toFile();\n assertThat(expectedAcceptorLogDir.... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(LocalPaxosComponents.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(LocalPaxosComponents.class);",
"type": "Logger",
"var_name": "log"
},
{... | {
"body": "public PaxosLearner learner(Client client) {\n return getOrCreateComponents(client).learner();\n }",
"class_method_signature": "LocalPaxosComponents.learner(Client client)",
"constructor": false,
"full_signature": "public PaxosLearner learner(Client client)",
"identifier": "learner",
"i... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
36960637_478 | {
"fields": [
{
"declarator": "LOW_TS = 10L",
"modifier": "private static final",
"original_string": "private static final long LOW_TS = 10L;",
"type": "long",
"var_name": "LOW_TS"
},
{
"declarator": "LOW_TS2 = 2 * LOW_TS",
"modifier": "private static final",
... | {
"body": "@Test\n public void thoroughSweepDeletesLowerValue() {\n enqueueWriteCommitted(TABLE_THOR, LOW_TS);\n enqueueWriteCommitted(TABLE_THOR, LOW_TS2);\n assertTestValueEnqueuedAtGivenTimestampStillPresent(TABLE_THOR, LOW_TS);\n assertTestValueEnqueuedAtGivenTimestampStillPresent(T... | {
"fields": [
{
"declarator": "log = LoggerFactory.getLogger(TargetedSweeper.class)",
"modifier": "private static final",
"original_string": "private static final Logger log = LoggerFactory.getLogger(TargetedSweeper.class);",
"type": "Logger",
"var_name": "log"
},
{
"de... | {
"body": "@SuppressWarnings(\"checkstyle:RegexpMultiline\") // Suppress VisibleForTesting warning\n @VisibleForTesting\n public long sweepNextBatch(ShardAndStrategy shardStrategy, long maxTsExclusive) {\n assertInitialized();\n return queue.sweepNextBatch(shardStrategy, maxTsExclusive);\n }",
... | {
"created": "6/5/2015 11:42:44 PM +00:00",
"fork": "False",
"fork_count": null,
"is_fork": null,
"language": null,
"license": "licensed",
"repo_id": 36960637,
"size": null,
"stargazer_count": null,
"stars": 711,
"updates": "2020-01-27T16:43:57+00:00",
"url": "https://github.com/palantir/atlasdb... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.