由于elasticsearch的modules子项目和plugins子项目中的类都是Plugin的子类,我想知道elasticsearch插件和elasticsearch模块之间的区别。
例如lang-painless模块
void merge(int a[], int left, int right)
{
if(left < right)
{
int mid = (left + right) / 2;
merge(a, left, mid);
merge(a, mid + 1, right);
int b[mid - left + 1], c[right - mid];
//two half arrays of the original array 'a'
int i, j, k;
for(i = left, j = 0; i <= mid; i++, j++)
b[j] = a[i];
for(j = mid + 1, i = 0; j <= right; j++, i++)
c[i] = a[j];
i = 0;
j = 0;
k =- 1;
while(k < (right - left + 1))
{
k++;
if(i == (mid - left + 1))
a[k] = c[j++];
else if(j == (right - mid))
a[k] = b[i++];
else if(b[i] < c[j])
a[k] = b[i++];
else
a[k] = c[j++];
}
}
}
lang-python插件
public final class PainlessPlugin extends Plugin implements ScriptPlugin
也许他们的实施没有区别,弹性公司的人把模块子项目中的必要类和插件子产品中不必要的类放在一起。我希望弹性搜索的开发者之一可以解释它。
答案 0 :(得分:3)
我从类InstallPluginCommand的源代码中得到了答案:
/** The builtin modules, which are plugins, but cannot be installed or removed. */
static final Set<String> MODULES;