Skip to content

Commit 126e8cc

Browse files
authored
Add NotMultiProjectCapable annotation (elastic#129934)
Some features are unavailable in serverless and are thus not worth the investment to make fully project-aware. This new annotation can be used to clearly mark blocks of code that are intentionally not made properly project-aware, in case we need to revisit them in the future.
1 parent e977fcc commit 126e8cc

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3+
* or more contributor license agreements. Licensed under the "Elastic License
4+
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side
5+
* Public License v 1"; you may not use this file except in compliance with, at
6+
* your election, the "Elastic License 2.0", the "GNU Affero General Public
7+
* License v3.0 only", or the "Server Side Public License, v 1".
8+
*/
9+
10+
package org.elasticsearch.core;
11+
12+
import java.lang.annotation.ElementType;
13+
import java.lang.annotation.Retention;
14+
import java.lang.annotation.RetentionPolicy;
15+
import java.lang.annotation.Target;
16+
17+
/**
18+
* Annotation to identify a block of code (a whole class, a method, a field, or a local variable) that is intentionally not fully
19+
* project-aware because it's not intended to be used in a serverless environment. Some features are unavailable in serverless and are
20+
* thus not worth the investment to make fully project-aware. This annotation makes it easier to identify blocks of code that require
21+
* attention in case those features are revisited from a multi-project POV.
22+
*/
23+
@Retention(RetentionPolicy.SOURCE)
24+
@Target(
25+
{ ElementType.LOCAL_VARIABLE, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.TYPE, ElementType.MODULE }
26+
)
27+
public @interface NotMultiProjectCapable {
28+
29+
/**
30+
* Some explanation on why the block of code would not work in a multi-project context and/or what would need to be done to make it
31+
* properly project-aware.
32+
*/
33+
String description() default "";
34+
}

0 commit comments

Comments
 (0)