conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
import android.content.ComponentName;
=======
import android.bluetooth.BluetoothAdapter;
>>>>>>>
import android.content.ComponentName;
import android.bluetooth.BluetoothAdapter;
<<<<<<<
import org.fdroid.fdroid.localrepo.SwapService;
import org.fdroid.fdroid.localrepo.peers.Peer;
=======
import org.fdroid.fdroid.localrepo.SwapManager;
import org.fdroid.fdroid.net.bluetooth.BluetoothServer;
>>>>>>>
import org.fdroid.fdroid.localrepo.SwapService;
import org.fdroid.fdroid.localrepo.peers.Peer;
import org.fdroid.fdroid.net.bluetooth.BluetoothServer;
<<<<<<<
private static final String TAG = "SwapWorkflowActivity";
=======
private static final String TAG = "SwapWorkflowActivity";
>>>>>>>
private static final String TAG = "SwapWorkflowActivity";
<<<<<<<
private void showJoinWifi() {
inflateInnerView(R.layout.swap_join_wifi);
=======
private void showBluetoothDeviceList() {
inflateInnerView(R.layout.swap_bluetooth_devices);
}
public void onJoinWifiComplete() {
ensureLocalRepoRunning();
if (!attemptToShowNfc()) {
showWifiQr();
}
>>>>>>>
private void showJoinWifi() {
inflateInnerView(R.layout.swap_join_wifi);
}
private void showBluetoothDeviceList() {
inflateInnerView(R.layout.swap_bluetooth_devices);
<<<<<<<
class PrepareInitialSwapRepo extends PrepareSwapRepo {
public PrepareInitialSwapRepo() {
super(new HashSet<>(Arrays.asList(new String[] { "org.fdroid.fdroid" })));
}
=======
class UpdateAsyncTask extends AsyncTask<Void, String, Void> {
>>>>>>>
class PrepareInitialSwapRepo extends PrepareSwapRepo {
public PrepareInitialSwapRepo() {
super(new HashSet<>(Arrays.asList(new String[] { "org.fdroid.fdroid" })));
} |
<<<<<<<
=======
private static final int REQUEST_INSTALL = 0;
private static final int REQUEST_UNINSTALL = 1;
public static final int REQUEST_ENABLE_BLUETOOTH = 2;
public static final String EXTRA_APPID = "appid";
public static final String EXTRA_FROM = "from";
private FDroidApp fdroidApp;
private ApkListAdapter adapter;
>>>>>>>
private static final int REQUEST_INSTALL = 0;
private static final int REQUEST_UNINSTALL = 1;
public static final int REQUEST_ENABLE_BLUETOOTH = 2;
public static final String EXTRA_APPID = "appid";
public static final String EXTRA_FROM = "from";
private FDroidApp fdroidApp;
private ApkListAdapter adapter;
<<<<<<<
installManager.handleOnActivityResult(requestCode, resultCode, data);
=======
switch (requestCode) {
case REQUEST_INSTALL:
if (downloadHandler != null) {
downloadHandler = null;
}
PackageManagerCompat.setInstaller(mPm, app.id);
resetRequired = true;
break;
case REQUEST_UNINSTALL:
resetRequired = true;
break;
case REQUEST_ENABLE_BLUETOOTH:
fdroidApp.sendViaBluetooth(this, resultCode, app.id);
}
>>>>>>>
switch (requestCode) {
case REQUEST_ENABLE_BLUETOOTH:
fdroidApp.sendViaBluetooth(this, resultCode, app.id);
break;
default:
installManager.handleOnActivityResult(requestCode, resultCode, data);
} |
<<<<<<<
saveMessageToCache(new PrivateChatMessageCache(chatMessage.getBody(), user.getId(), privateChatId,
Consts.EMPTY_STRING));
=======
saveMessageToCache(new PrivateChatMessageCache(chatMessage.getBody(), user.getId(), privateChatId, Consts.EMPTY_STRING, opponentName));
>>>>>>>
saveMessageToCache(new PrivateChatMessageCache(chatMessage.getBody(), user.getId(), privateChatId, Consts.EMPTY_STRING, opponentName));
<<<<<<<
saveMessageToCache(new PrivateChatMessageCache(Consts.EMPTY_STRING, user.getId(), privateChatId,
qbFile.getPublicUrl()));
=======
saveMessageToCache(new PrivateChatMessageCache(Consts.EMPTY_STRING, user.getId(), privateChatId, qbFile.getPublicUrl(), opponentName));
}
private void saveGroupMessageToCache(QBChatMessage chatMessage, int senderId, String groupId, String membersIds){
Log.i("GroupMessage: ", " Saving to cache " + groupChatName);
DatabaseManager.saveGroupChatMessage(context, chatMessage, senderId, groupId, membersIds);
>>>>>>>
saveMessageToCache(new PrivateChatMessageCache(Consts.EMPTY_STRING, user.getId(), privateChatId, qbFile.getPublicUrl(), opponentName));
}
private void saveGroupMessageToCache(QBChatMessage chatMessage, int senderId, String groupId, String membersIds){
Log.i("GroupMessage: ", " Saving to cache " + groupChatName);
DatabaseManager.saveGroupChatMessage(context, chatMessage, senderId, groupId, membersIds);
<<<<<<<
intent.putExtra(QBServiceConsts.EXTRA_CHAT_MESSAGE, TextUtils.isEmpty(messageBody) ? context
.getResources().getString(R.string.file_was_attached) : messageBody);
intent.putExtra(QBServiceConsts.EXTRA_SENDER_CHAT_MESSAGE, DatabaseManager.getFriend(context,
chatMessage.getSenderId()).getFullname());
=======
String extraChatMessage = "";
if(TextUtils.isEmpty(messageBody)){
extraChatMessage = context.getResources().getString(R.string.file_was_attached);
} else {
extraChatMessage = messageBody;
}
intent.putExtra(QBServiceConsts.EXTRA_CHAT_MESSAGE, extraChatMessage);
intent.putExtra(QBServiceConsts.EXTRA_SENDER_CHAT_MESSAGE, DatabaseManager.getFriendFromCursor(
DatabaseManager.getCursorFriendById(context, chatMessage.getSenderId())).getFullname());
>>>>>>>
String extraChatMessage = "";
if(TextUtils.isEmpty(messageBody)){
extraChatMessage = context.getResources().getString(R.string.file_was_attached);
} else {
extraChatMessage = messageBody;
}
intent.putExtra(QBServiceConsts.EXTRA_CHAT_MESSAGE, extraChatMessage);
intent.putExtra(QBServiceConsts.EXTRA_SENDER_CHAT_MESSAGE, DatabaseManager.getFriend(context,
chatMessage.getSenderId()).getFullname());
<<<<<<<
saveMessageToCache(new PrivateChatMessageCache(messageBody, chatMessage.getSenderId(),
chatMessage.getSenderId(), TextUtils.isEmpty(messageBody) ? getAttachUrlFromQBChatMessage(
chatMessage) : Consts.EMPTY_STRING
));
=======
String attachURL = "";
if(TextUtils.isEmpty(messageBody)){
attachURL = getAttachUrlFromQBChatMessage(chatMessage);
} else {
attachURL = Consts.EMPTY_STRING;
}
saveMessageToCache(new PrivateChatMessageCache(messageBody, chatMessage.getSenderId(), chatMessage.getSenderId(),
attachURL, opponentName));
>>>>>>>
String attachURL = "";
if(TextUtils.isEmpty(messageBody)){
attachURL = getAttachUrlFromQBChatMessage(chatMessage);
} else {
attachURL = Consts.EMPTY_STRING;
}
saveMessageToCache(new PrivateChatMessageCache(messageBody, chatMessage.getSenderId(), chatMessage.getSenderId(),
attachURL, opponentName));
<<<<<<<
public void initPrivateChat(int opponentId) {
=======
public void initPrivateChat(int opponentId, String opponentName) {
user = App.getInstance().getUser();
>>>>>>>
public void initPrivateChat(int opponentId, String opponentName) {
user = App.getInstance().getUser();
<<<<<<<
public void initRoomChat(String roomName, Integer[] friendIds) {
=======
public void initRoomChat(Context context, String roomName, List<Friend> friendList) {
this.context = context;
>>>>>>>
public void initRoomChat(Context context, String roomName, List<Friend> friendList) {
this.context = context;
<<<<<<<
for (Integer friendId : friendIds) {
roomChat.addRoomUser(friendId);
=======
for (Friend friend : friendList) {
roomChat.addRoomUser(Integer.valueOf(friend.getId()));
if(friend != null){
membersIDs = membersIDs + friend.getId() + ",";
}
>>>>>>>
for (Friend friend : friendList) {
roomChat.addRoomUser(Integer.valueOf(friend.getId()));
if(friend != null){
membersIDs = membersIDs + friend.getId() + ",";
} |
<<<<<<<
private Preference mPrefNotifyType;
=======
private CheckBoxPreference mPrefNotifyCmt,
mPrefNotifyAt,
mPrefNotifyDm;
private CheckBoxPreference mPrefShowBigtext;
>>>>>>>
private Preference mPrefNotifyType;
private CheckBoxPreference mPrefShowBigtext;
<<<<<<<
=======
mPrefShowBigtext = (CheckBoxPreference) findPreference(Settings.SHOW_BIGTEXT);
mPrefNotifyCmt = (CheckBoxPreference) findPreference(Settings.NOTIFY_CMT);
mPrefNotifyAt = (CheckBoxPreference) findPreference(Settings.NOTIFY_AT);
mPrefNotifyDm = (CheckBoxPreference) findPreference(Settings.NOTIFY_DM);
>>>>>>>
<<<<<<<
=======
mPrefShowBigtext.setChecked(mSettings.getBoolean(Settings.SHOW_BIGTEXT, false));
mPrefNotifyCmt.setChecked(mSettings.getBoolean(Settings.NOTIFY_CMT, true));
mPrefNotifyAt.setChecked(mSettings.getBoolean(Settings.NOTIFY_AT, true));
mPrefNotifyDm.setChecked(mSettings.getBoolean(Settings.NOTIFY_DM, true));
>>>>>>>
mPrefShowBigtext.setChecked(mSettings.getBoolean(Settings.SHOW_BIGTEXT, false));
<<<<<<<
mPrefNotifyType.setOnPreferenceClickListener(this);
=======
mPrefShowBigtext.setOnPreferenceChangeListener(this);
mPrefNotifyCmt.setOnPreferenceChangeListener(this);
mPrefNotifyAt.setOnPreferenceChangeListener(this);
mPrefNotifyDm.setOnPreferenceChangeListener(this);
>>>>>>>
mPrefNotifyType.setOnPreferenceClickListener(this);
mPrefShowBigtext.setOnPreferenceChangeListener(this);
<<<<<<<
=======
} else if (preference == mPrefShowBigtext) {
mSettings.putBoolean(Settings.SHOW_BIGTEXT,
Boolean.parseBoolean(newValue.toString()));
// Reset notifications
mSettings.putString(Settings.NOTIFICATION_ONGOING, "");
return true;
} else if (preference == mPrefNotifyCmt) {
mSettings.putBoolean(Settings.NOTIFY_CMT,
Boolean.parseBoolean(newValue.toString()));
mSettings.putString(Settings.NOTIFICATION_ONGOING, "");
return true;
} else if (preference == mPrefNotifyAt) {
mSettings.putBoolean(Settings.NOTIFY_AT,
Boolean.parseBoolean(newValue.toString()));
mSettings.putString(Settings.NOTIFICATION_ONGOING, "");
return true;
} else if (preference == mPrefNotifyDm) {
mSettings.putBoolean(Settings.NOTIFY_DM,
Boolean.parseBoolean(newValue.toString()));
mSettings.putString(Settings.NOTIFICATION_ONGOING, "");
return true;
>>>>>>>
} else if (preference == mPrefShowBigtext) {
mSettings.putBoolean(Settings.SHOW_BIGTEXT,
Boolean.parseBoolean(newValue.toString()));
// Reset notifications
mSettings.putString(Settings.NOTIFICATION_ONGOING, "");
return true; |
<<<<<<<
import com.epam.jdi.uitests.web.selenium.elements.complex.ComboBox;
=======
import com.epam.jdi.uitests.web.selenium.elements.complex.CheckList;
import com.epam.jdi.uitests.web.selenium.elements.complex.DropList;
>>>>>>>
import com.epam.jdi.uitests.web.selenium.elements.complex.ComboBox;
import com.epam.jdi.uitests.web.selenium.elements.complex.CheckList;
import com.epam.jdi.uitests.web.selenium.elements.complex.DropList;
<<<<<<<
Menu::setUp,
ComboBox::setUp
=======
Menu::setUp,
Tabs::setUp,
DropList::setUp,
Elements::setUp,
RadioButtons::setUp,
Selector::setUp,
CheckList::setUp
>>>>>>>
Menu::setUp,
ComboBox::setUp,
Tabs::setUp,
DropList::setUp,
Elements::setUp,
RadioButtons::setUp,
Selector::setUp,
CheckList::setUp |
<<<<<<<
@Test
public void shouldTest(){
link().shouldHave(exactText("About"), attribute("title", "Tip title"), attribute("href"))
.shouldNotBe(hidden);
}
=======
@Test
public void imageIsDisplayedTest(){
Assert.assertTrue(link().isDisplayed());
}
>>>>>>>
@Test
public void shouldTest(){
link().shouldHave(exactText("About"), attribute("title", "Tip title"), attribute("href"))
.shouldNotBe(hidden);
}
@Test
public void imageIsDisplayedTest(){
Assert.assertTrue(link().isDisplayed());
} |
<<<<<<<
@Test
public void shouldTest(){
button.get().shouldHave(text("Calculate"), attribute("id", "calculate-button"), type("submit"))
.shouldBe(visible, enabled);
}
=======
@Test
public void imageIsDisplayedTest(){
Assert.assertTrue(button.get().isDisplayed());
}
>>>>>>>
@Test
public void shouldTest(){
button.get().shouldHave(text("Calculate"), attribute("id", "calculate-button"), type("submit"))
.shouldBe(visible, enabled);
}
@Test
public void imageIsDisplayedTest(){
Assert.assertTrue(button.get().isDisplayed());
} |
<<<<<<<
import com.epam.jdi.uitests.web.selenium.elements.complex.RadioButtons;
=======
import com.epam.jdi.uitests.web.selenium.elements.complex.Selector;
>>>>>>>
import com.epam.jdi.uitests.web.selenium.elements.complex.RadioButtons;
import com.epam.jdi.uitests.web.selenium.elements.complex.Selector;
<<<<<<<
Menu::setUp,
RadioButtons::setUp
=======
Menu::setUp,
Selector::setUp
>>>>>>>
Menu::setUp,
RadioButtons::setUp
Selector::setUp |
<<<<<<<
@Override
public void onNotificationPosted(StatusBarNotification sbn) {
if (sbn == null)
return;
checkAndSnoozeNotification(sbn);
}
class NotificationListenerBroadcastReceiver extends BroadcastReceiver {
private static final String TAG = "NL Broadcast Receiver";
=======
class NotificationListenerBroadcastReceiver extends BroadcastReceiver{
private static final String TAG = "NL Broadcast Receiver";
>>>>>>>
@Override
public void onNotificationPosted(StatusBarNotification sbn) {
if (sbn == null)
return;
checkAndSnoozeNotification(sbn);
}
class NotificationListenerBroadcastReceiver extends BroadcastReceiver{
private static final String TAG = "NL Broadcast Receiver";
<<<<<<<
}
}
=======
}
}
>>>>>>>
}
} |
<<<<<<<
public static int DEFAULT_INDEX_MEM_PAGE_SIZE = 32768;
public static int DEFAULT_INDEX_MEM_NUM_PAGES = 1000;
=======
public static int getFrameSize() {
int frameSize = GlobalConfig.DEFAULT_FRAME_SIZE;
String frameSizeStr = System.getProperty(GlobalConfig.FRAME_SIZE_PROPERTY);
if (frameSizeStr != null) {
int fz = -1;
try {
fz = Integer.parseInt(frameSizeStr);
} catch (NumberFormatException nfe) {
GlobalConfig.ASTERIX_LOGGER.warning("Wrong frame size size argument. Picking default value ("
+ GlobalConfig.DEFAULT_FRAME_SIZE + ") instead.\n");
}
if (fz >= 0) {
frameSize = fz;
}
}
return frameSize;
}
>>>>>>>
public static int DEFAULT_INDEX_MEM_PAGE_SIZE = 32768;
public static int DEFAULT_INDEX_MEM_NUM_PAGES = 1000;
public static int getFrameSize() {
int frameSize = GlobalConfig.DEFAULT_FRAME_SIZE;
String frameSizeStr = System.getProperty(GlobalConfig.FRAME_SIZE_PROPERTY);
if (frameSizeStr != null) {
int fz = -1;
try {
fz = Integer.parseInt(frameSizeStr);
} catch (NumberFormatException nfe) {
GlobalConfig.ASTERIX_LOGGER.warning("Wrong frame size size argument. Picking default value ("
+ GlobalConfig.DEFAULT_FRAME_SIZE + ") instead.\n");
}
if (fz >= 0) {
frameSize = fz;
}
}
return frameSize;
} |
<<<<<<<
import edu.uci.ics.asterix.common.context.AsterixRuntimeComponentsProvider;
import edu.uci.ics.asterix.common.context.AsterixVirtualBufferCacheProvider;
=======
>>>>>>>
import edu.uci.ics.asterix.common.context.AsterixVirtualBufferCacheProvider; |
<<<<<<<
@Override
public IJobSerializerDeserializerContainer getJobSerializerDeserializerContainer() {
// TODO Auto-generated method stub
return null;
}
@Override
public IMemoryManager getMemoryManager() {
return mm;
}
=======
@Override
public IJobSerializerDeserializerContainer getJobSerializerDeserializerContainer() {
// TODO Auto-generated method stub
return null;
}
@Override
public ThreadFactory getThreadFactory() {
// TODO Auto-generated method stub
return null;
}
@Override
public void setThreadFactory(ThreadFactory threadFactory) {
// TODO Auto-generated method stub
}
>>>>>>>
@Override
public IJobSerializerDeserializerContainer getJobSerializerDeserializerContainer() {
// TODO Auto-generated method stub
return null;
}
@Override
public IMemoryManager getMemoryManager() {
return mm;
}
@Override
public ThreadFactory getThreadFactory() {
// TODO Auto-generated method stub
return null;
}
@Override
public void setThreadFactory(ThreadFactory threadFactory) {
// TODO Auto-generated method stub
} |
<<<<<<<
registerRemoteMetadataNode(proxy);
}
MetadataManager.INSTANCE = new MetadataManager(proxy, metadataProperties);
MetadataManager.INSTANCE.init();
if (isMetadataNode) {
=======
>>>>>>>
<<<<<<<
=======
MetadataNode.INSTANCE.initialize(runtimeContext);
// This is a special case, we just give the metadataNode directly.
// This way we can delay the registration of the metadataNode until
// it is completely initialized.
MetadataManager.INSTANCE = new MetadataManager(proxy, MetadataNode.INSTANCE);
>>>>>>>
MetadataNode.INSTANCE.initialize(runtimeContext);
// This is a special case, we just give the metadataNode directly.
// This way we can delay the registration of the metadataNode until
// it is completely initialized.
MetadataManager.INSTANCE = new MetadataManager(proxy, MetadataNode.INSTANCE);
<<<<<<<
public void registerRemoteMetadataNode(IAsterixStateProxy proxy) throws RemoteException {
IMetadataNode stub = null;
MetadataNode.INSTANCE.initialize(runtimeContext);
stub = (IMetadataNode) UnicastRemoteObject.exportObject(MetadataNode.INSTANCE, 0);
proxy.setMetadataNode(stub);
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Metadata node bound");
}
}
private void updateOnNodeJoin() {
AsterixMetadataProperties metadataProperties = ((IAsterixPropertiesProvider) runtimeContext)
.getMetadataProperties();
if (!metadataProperties.getNodeNames().contains(nodeId)) {
metadataProperties.getNodeNames().add(nodeId);
Cluster cluster = AsterixClusterProperties.INSTANCE.getCluster();
String asterixInstanceName = cluster.getInstanceName();
AsterixTransactionProperties txnProperties = ((IAsterixPropertiesProvider) runtimeContext)
.getTransactionProperties();
Node self = null;
for (Node node : cluster.getSubstituteNodes().getNode()) {
String ncId = asterixInstanceName + "_" + node.getId();
if (ncId.equalsIgnoreCase(nodeId)) {
String storeDir = node.getStore() == null ? cluster.getStore() : node.getStore();
metadataProperties.getStores().put(nodeId, storeDir.split(","));
String coredumpPath = node.getLogDir() == null ? cluster.getLogDir() : node.getLogDir();
metadataProperties.getCoredumpPaths().put(nodeId, coredumpPath);
String txnLogDir = node.getTxnLogDir() == null ? cluster.getTxnLogDir() : node.getTxnLogDir();
txnProperties.getLogDirectories().put(nodeId, txnLogDir);
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Store set to : " + storeDir);
LOGGER.info("Coredump dir set to : " + coredumpPath);
LOGGER.info("Transaction log dir set to :" + txnLogDir);
}
self = node;
break;
}
}
if (self != null) {
cluster.getSubstituteNodes().getNode().remove(self);
cluster.getNode().add(self);
} else {
throw new IllegalStateException("Unknown node joining the cluster");
}
}
}
/**
* Shutdown hook that invokes {@link NCApplicationEntryPoint#stop() stop} method.
*/
private static class JVMShutdownHook extends Thread {
private final NCApplicationEntryPoint ncAppEntryPoint;
public JVMShutdownHook(NCApplicationEntryPoint ncAppEntryPoint) {
this.ncAppEntryPoint = ncAppEntryPoint;
}
public void run() {
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Shutdown hook in progress");
}
try {
ncAppEntryPoint.stop();
} catch (Exception e) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.warning("Exception in executing shutdown hook" + e);
}
}
}
}
=======
>>>>>>>
private void updateOnNodeJoin() {
AsterixMetadataProperties metadataProperties = ((IAsterixPropertiesProvider) runtimeContext)
.getMetadataProperties();
if (!metadataProperties.getNodeNames().contains(nodeId)) {
metadataProperties.getNodeNames().add(nodeId);
Cluster cluster = AsterixClusterProperties.INSTANCE.getCluster();
String asterixInstanceName = cluster.getInstanceName();
AsterixTransactionProperties txnProperties = ((IAsterixPropertiesProvider) runtimeContext)
.getTransactionProperties();
Node self = null;
for (Node node : cluster.getSubstituteNodes().getNode()) {
String ncId = asterixInstanceName + "_" + node.getId();
if (ncId.equalsIgnoreCase(nodeId)) {
String storeDir = node.getStore() == null ? cluster.getStore() : node.getStore();
metadataProperties.getStores().put(nodeId, storeDir.split(","));
String coredumpPath = node.getLogDir() == null ? cluster.getLogDir() : node.getLogDir();
metadataProperties.getCoredumpPaths().put(nodeId, coredumpPath);
String txnLogDir = node.getTxnLogDir() == null ? cluster.getTxnLogDir() : node.getTxnLogDir();
txnProperties.getLogDirectories().put(nodeId, txnLogDir);
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Store set to : " + storeDir);
LOGGER.info("Coredump dir set to : " + coredumpPath);
LOGGER.info("Transaction log dir set to :" + txnLogDir);
}
self = node;
break;
}
}
if (self != null) {
cluster.getSubstituteNodes().getNode().remove(self);
cluster.getNode().add(self);
} else {
throw new IllegalStateException("Unknown node joining the cluster");
}
}
} |
<<<<<<<
=======
import edu.uci.ics.hyracks.algebricks.core.algebra.properties.DefaultNodeGroupDomain;
>>>>>>>
import edu.uci.ics.hyracks.algebricks.core.algebra.properties.DefaultNodeGroupDomain; |
<<<<<<<
=======
private boolean isImportInitialized;
private boolean isStopFriendListLoader;
>>>>>>>
private boolean isImportInitialized;
private boolean isStopFriendListLoader;
<<<<<<<
if (state == State.FRIEND_SEARCH) {
startFriendListLoaderWithTimer();
=======
if (!isImportInitialized) {
getBaseActivity().addAction(QBServiceConsts.ADD_FRIENDS_SUCCESS_ACTION, new AddFriendsSuccessAction());
getBaseActivity().addAction(QBServiceConsts.ADD_FRIENDS_FAIL_ACTION, new AddFriendsFailAction());
getBaseActivity().updateBroadcastActionList();
} else {
if (state == State.FRIEND_LIST) {
startFriendListLoaderWithTimer();
}
>>>>>>>
if (!isImportInitialized) {
baseActivity.addAction(QBServiceConsts.ADD_FRIENDS_SUCCESS_ACTION, new AddFriendsSuccessAction());
baseActivity.addAction(QBServiceConsts.ADD_FRIENDS_FAIL_ACTION, new AddFriendsFailAction());
baseActivity.updateBroadcastActionList();
} else {
if (state == State.FRIEND_LIST) {
startFriendListLoaderWithTimer();
}
<<<<<<<
state = State.FRIEND_SEARCH;
baseActivity.getActionBar().setIcon(android.R.color.transparent);
listTitle.setVisibility(View.VISIBLE);
=======
getActivity().getActionBar().setIcon(android.R.color.transparent);
listView.addHeaderView(listTitleView);
>>>>>>>
baseActivity.getActionBar().setIcon(android.R.color.transparent);
listTitle.setVisibility(View.VISIBLE);
<<<<<<<
baseActivity.hideProgress();
Log.d(TAG, "AddFriendSuccessAction");
=======
getBaseActivity().hideProgress();
}
}
private class AddFriendsSuccessAction implements Command {
@Override
public void execute(Bundle bundle) {
importFriendsFinished();
}
}
private class AddFriendsFailAction implements Command {
@Override
public void execute(Bundle bundle) {
importFriendsFinished();
DialogUtils.show(getActivity(), getResources().getString(R.string.dlg_import_friends_filed));
>>>>>>>
baseActivity.hideProgress();
}
}
private class AddFriendsSuccessAction implements Command {
@Override
public void execute(Bundle bundle) {
importFriendsFinished();
}
}
private class AddFriendsFailAction implements Command {
@Override
public void execute(Bundle bundle) {
importFriendsFinished();
DialogUtils.show(getActivity(), getResources().getString(R.string.dlg_import_friends_filed)); |
<<<<<<<
=======
import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
import edu.uci.ics.hyracks.storage.am.common.api.IInMemoryFreePageManager;
>>>>>>>
import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
<<<<<<<
=======
private final int memPageSize;
private final int memNumPages;
private final FileSplit[] fileSplits;
>>>>>>>
private final FileSplit[] fileSplits;
<<<<<<<
RTreePolicyType rtreePolicyType, ILinearizeComparatorFactory linearizeCmpFactory, int datasetID) {
super(datasetID);
=======
RTreePolicyType rtreePolicyType, ILinearizeComparatorFactory linearizeCmpFactory, int memPageSize,
int memNumPages, FileSplit[] fileSplits) {
>>>>>>>
RTreePolicyType rtreePolicyType, ILinearizeComparatorFactory linearizeCmpFactory, FileSplit[] fileSplits, int datasetID) {
super(datasetID);
<<<<<<<
=======
this.memPageSize = memPageSize;
this.memNumPages = memNumPages;
this.fileSplits = fileSplits;
>>>>>>>
this.fileSplits = fileSplits; |
<<<<<<<
public static LSMBTreeTestContext create(IVirtualBufferCache virtualBufferCache, IOManager ioManager,
FileReference file, IBufferCache diskBufferCache, IFileMapProvider diskFileMapProvider,
ISerializerDeserializer[] fieldSerdes, int numKeyFields, double bloomFilterFalsePositiveRate,
ILSMMergePolicy mergePolicy, ILSMOperationTrackerFactory opTrackerFactory,
ILSMIOOperationScheduler ioScheduler, ILSMIOOperationCallbackProvider ioOpCallbackProvider)
throws Exception {
=======
public static LSMBTreeTestContext create(IInMemoryBufferCache memBufferCache,
IInMemoryFreePageManager memFreePageManager, IOManager ioManager, FileReference file,
IBufferCache diskBufferCache, IFileMapProvider diskFileMapProvider, ISerializerDeserializer[] fieldSerdes,
int numKeyFields, double bloomFilterFalsePositiveRate, ILSMMergePolicy mergePolicy,
ILSMOperationTrackerFactory opTrackerFactory, ILSMIOOperationScheduler ioScheduler,
ILSMIOOperationCallbackProvider ioOpCallbackProvider, int ioDeviceId) throws Exception {
>>>>>>>
public static LSMBTreeTestContext create(IVirtualBufferCache virtualBufferCache, IOManager ioManager,
FileReference file, IBufferCache diskBufferCache, IFileMapProvider diskFileMapProvider,
ISerializerDeserializer[] fieldSerdes, int numKeyFields, double bloomFilterFalsePositiveRate,
ILSMMergePolicy mergePolicy, ILSMOperationTrackerFactory opTrackerFactory,
ILSMIOOperationScheduler ioScheduler, ILSMIOOperationCallbackProvider ioOpCallbackProvider, int ioDeviceId)
throws Exception {
<<<<<<<
LSMBTree lsmTree = LSMBTreeUtils.createLSMTree(virtualBufferCache, ioManager, file, diskBufferCache,
diskFileMapProvider, typeTraits, cmpFactories, bloomFilterKeyFields, bloomFilterFalsePositiveRate,
mergePolicy, opTrackerFactory, ioScheduler, ioOpCallbackProvider);
=======
LSMBTree lsmTree = LSMBTreeUtils.createLSMTree(memBufferCache, memFreePageManager, ioManager, file,
diskBufferCache, diskFileMapProvider, typeTraits, cmpFactories, bloomFilterKeyFields,
bloomFilterFalsePositiveRate, mergePolicy, opTrackerFactory, ioScheduler, ioOpCallbackProvider,
ioDeviceId);
>>>>>>>
LSMBTree lsmTree = LSMBTreeUtils.createLSMTree(virtualBufferCache, ioManager, file, diskBufferCache,
diskFileMapProvider, typeTraits, cmpFactories, bloomFilterKeyFields, bloomFilterFalsePositiveRate,
mergePolicy, opTrackerFactory, ioScheduler, ioOpCallbackProvider, ioDeviceId); |
<<<<<<<
import org.apache.asterix.lang.common.struct.Identifier;
=======
import org.apache.asterix.lang.common.struct.QuantifiedPair;
>>>>>>>
import org.apache.asterix.lang.common.struct.Identifier;
import org.apache.asterix.lang.common.struct.QuantifiedPair;
<<<<<<<
public static Map<Expression, Identifier> createFieldVariableMap(List<Pair<Expression, Identifier>> fieldList) {
Map<Expression, Identifier> fieldVars = new HashMap<>();
for (Pair<Expression, Identifier> p : fieldList) {
fieldVars.put(p.first, p.second);
}
return fieldVars;
}
public static void addToFieldVariableList(VariableExpr varExpr, List<Pair<Expression, Identifier>> outFieldList) {
VarIdentifier var = varExpr.getVar();
VariableExpr newVarExpr = new VariableExpr(var);
newVarExpr.setSourceLocation(varExpr.getSourceLocation());
outFieldList.add(new Pair<>(newVarExpr, toUserDefinedVariableName(var)));
}
=======
public static List<VariableExpr> getBindingVariables(QuantifiedExpression qe) {
List<QuantifiedPair> quantifiedList = qe.getQuantifiedList();
List<VariableExpr> bindingVars = new ArrayList<>(quantifiedList.size());
for (QuantifiedPair qp : quantifiedList) {
bindingVars.add(qp.getVarExpr());
}
return bindingVars;
}
>>>>>>>
public static List<VariableExpr> getBindingVariables(QuantifiedExpression qe) {
List<QuantifiedPair> quantifiedList = qe.getQuantifiedList();
List<VariableExpr> bindingVars = new ArrayList<>(quantifiedList.size());
for (QuantifiedPair qp : quantifiedList) {
bindingVars.add(qp.getVarExpr());
}
return bindingVars;
}
public static Map<Expression, Identifier> createFieldVariableMap(List<Pair<Expression, Identifier>> fieldList) {
Map<Expression, Identifier> fieldVars = new HashMap<>();
for (Pair<Expression, Identifier> p : fieldList) {
fieldVars.put(p.first, p.second);
}
return fieldVars;
}
public static void addToFieldVariableList(VariableExpr varExpr, List<Pair<Expression, Identifier>> outFieldList) {
VarIdentifier var = varExpr.getVar();
VariableExpr newVarExpr = new VariableExpr(var);
newVarExpr.setSourceLocation(varExpr.getSourceLocation());
outFieldList.add(new Pair<>(newVarExpr, toUserDefinedVariableName(var)));
} |
<<<<<<<
private static final String EXTERNAL_FEEDSERVER_KEY = "feed.port";
private static int EXTERNAL_FEEDSERVER_DEFAULT = 19003;
private static final String EXTERNAL_CC_JAVA_OPTS_KEY = "cc.java.opts";
private static String EXTERNAL_CC_JAVA_OPTS_DEFAULT = "-Xmx1024m";
private static final String EXTERNAL_NC_JAVA_OPTS_KEY = "nc.java.opts";
private static String EXTERNAL_NC_JAVA_OPTS_DEFAULT = "-Xmx1024m";
=======
private static final String EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER = "max.wait.active.cluster";
private static int EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER_DEFAULT = 60;
>>>>>>>
private static final String EXTERNAL_FEEDSERVER_KEY = "feed.port";
private static int EXTERNAL_FEEDSERVER_DEFAULT = 19003;
private static final String EXTERNAL_CC_JAVA_OPTS_KEY = "cc.java.opts";
private static String EXTERNAL_CC_JAVA_OPTS_DEFAULT = "-Xmx1024m";
private static final String EXTERNAL_NC_JAVA_OPTS_KEY = "nc.java.opts";
private static String EXTERNAL_NC_JAVA_OPTS_DEFAULT = "-Xmx1024m";
private static final String EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER = "max.wait.active.cluster";
private static int EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER_DEFAULT = 60;
<<<<<<<
public String getNCJavaParams() {
return accessor.getProperty(EXTERNAL_NC_JAVA_OPTS_KEY, EXTERNAL_NC_JAVA_OPTS_DEFAULT,
PropertyInterpreters.getStringPropertyInterpreter());
}
public String getCCJavaParams() {
return accessor.getProperty(EXTERNAL_CC_JAVA_OPTS_KEY, EXTERNAL_CC_JAVA_OPTS_DEFAULT,
PropertyInterpreters.getStringPropertyInterpreter());
}
=======
public int getMaxWaitClusterActive() {
return accessor.getProperty(EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER, EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER_DEFAULT,
PropertyInterpreters.getIntegerPropertyInterpreter());
}
>>>>>>>
public String getNCJavaParams() {
return accessor.getProperty(EXTERNAL_NC_JAVA_OPTS_KEY, EXTERNAL_NC_JAVA_OPTS_DEFAULT,
PropertyInterpreters.getStringPropertyInterpreter());
}
public String getCCJavaParams() {
return accessor.getProperty(EXTERNAL_CC_JAVA_OPTS_KEY, EXTERNAL_CC_JAVA_OPTS_DEFAULT,
PropertyInterpreters.getStringPropertyInterpreter());
}
public int getMaxWaitClusterActive() {
return accessor.getProperty(EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER, EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER_DEFAULT,
PropertyInterpreters.getIntegerPropertyInterpreter());
} |
<<<<<<<
import edu.uci.ics.asterix.common.context.AsterixRuntimeComponentsProvider;
import edu.uci.ics.asterix.common.context.AsterixVirtualBufferCacheProvider;
=======
>>>>>>>
import edu.uci.ics.asterix.common.context.AsterixVirtualBufferCacheProvider; |
<<<<<<<
private static final int DEFAULT_JSON_API_SERVER_PORT = 19101;
public static final int DEFAULT_API_SERVER_PORT = 14600;
private static final int DEFAULT_API_NODEDATA_SERVER_PORT = 14601;
=======
>>>>>>>
private static final int DEFAULT_JSON_API_SERVER_PORT = 19101;
<<<<<<<
// Setup and start the web interface
setupJSONAPIServer();
jsonAPIServer.start();
// Setup and start the API server
setupAPIServer();
apiServer.start();
//Initialize AsterixAppContext
=======
>>>>>>>
// Setup and start the web interface
setupJSONAPIServer();
jsonAPIServer.start();
<<<<<<<
private void setupJSONAPIServer() throws Exception {
String portStr = System.getProperty(GlobalConfig.JSON_API_SERVER_PORT_PROPERTY);
int port = DEFAULT_JSON_API_SERVER_PORT;
if (portStr != null) {
port = Integer.parseInt(portStr);
}
jsonAPIServer = new Server(port);
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
jsonAPIServer.setHandler(context);
context.addServlet(new ServletHolder(new QueryAPIServlet()), "/query");
context.addServlet(new ServletHolder(new QueryStatusAPIServlet()), "/query/status");
context.addServlet(new ServletHolder(new QueryResultAPIServlet()), "/query/result");
context.addServlet(new ServletHolder(new UpdateAPIServlet()), "/update");
context.addServlet(new ServletHolder(new DDLAPIServlet()), "/ddl");
}
private void setupAPIServer() throws Exception {
// set the APINodeDataServer ports
int startPort = DEFAULT_API_NODEDATA_SERVER_PORT;
Map<String, Set<String>> nodeNameMap = new HashMap<String, Set<String>>();
getIPAddressNodeMap(nodeNameMap);
for (Map.Entry<String, Set<String>> entry : nodeNameMap.entrySet()) {
Set<String> nodeNames = entry.getValue();
Iterator<String> it = nodeNames.iterator();
while (it.hasNext()) {
AsterixNodeState ns = new AsterixNodeState();
ns.setAPINodeDataServerPort(startPort++);
proxy.setAsterixNodeState(it.next(), ns);
}
}
apiServer = new ThreadedServer(DEFAULT_API_SERVER_PORT, new APIClientThreadFactory(appCtx));
}
private void getIPAddressNodeMap(Map<String, Set<String>> nodeNameMap) throws IOException {
nodeNameMap.clear();
try {
appCtx.getCCContext().getIPAddressNodeMap(nodeNameMap);
} catch (Exception e) {
throw new IOException("Unable to obtain IP address node map", e);
}
}
=======
>>>>>>>
private void setupJSONAPIServer() throws Exception {
String portStr = System.getProperty(GlobalConfig.JSON_API_SERVER_PORT_PROPERTY);
int port = DEFAULT_JSON_API_SERVER_PORT;
if (portStr != null) {
port = Integer.parseInt(portStr);
}
jsonAPIServer = new Server(port);
ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
context.setContextPath("/");
jsonAPIServer.setHandler(context);
context.addServlet(new ServletHolder(new QueryAPIServlet()), "/query");
context.addServlet(new ServletHolder(new QueryStatusAPIServlet()), "/query/status");
context.addServlet(new ServletHolder(new QueryResultAPIServlet()), "/query/result");
context.addServlet(new ServletHolder(new UpdateAPIServlet()), "/update");
context.addServlet(new ServletHolder(new DDLAPIServlet()), "/ddl");
} |
<<<<<<<
public class AsterixAppRuntimeContext implements IAsterixAppRuntimeContext, IAsterixPropertiesProvider {
=======
public class AsterixAppRuntimeContext implements IAsterixAppRuntimeContext, IAsterixPropertiesProvider {
private static final int DEFAULT_BUFFER_CACHE_PAGE_SIZE = 32768;
private static final int DEFAULT_LIFECYCLEMANAGER_MEMORY_BUDGET = 1024 * 1024 * 1024; // 1GB
private static final int DEFAULT_MAX_OPEN_FILES = Integer.MAX_VALUE;
private static final int METADATA_IO_DEVICE_ID = 0;
>>>>>>>
public class AsterixAppRuntimeContext implements IAsterixAppRuntimeContext, IAsterixPropertiesProvider {
private static final int METADATA_IO_DEVICE_ID = 0; |
<<<<<<<
import org.apache.asterix.common.metadata.DataverseName;
=======
import org.apache.asterix.common.exceptions.CompilationException;
import org.apache.asterix.common.exceptions.ErrorCode;
>>>>>>>
import org.apache.asterix.common.exceptions.CompilationException;
import org.apache.asterix.common.exceptions.ErrorCode;
import org.apache.asterix.common.metadata.DataverseName;
<<<<<<<
import org.apache.hyracks.algebricks.common.utils.Pair;
=======
import org.apache.hyracks.api.exceptions.SourceLocation;
>>>>>>>
import org.apache.hyracks.algebricks.common.utils.Pair;
import org.apache.hyracks.api.exceptions.SourceLocation;
<<<<<<<
firstPass(typeDataverse, typeName, typeExpr, outTypeMap, incompleteFieldTypes, incompleteItemTypes,
incompleteTopLevelTypeReferences, defaultDataverse);
secondPass(mdTxnCtx, outTypeMap, incompleteFieldTypes, incompleteItemTypes, incompleteTopLevelTypeReferences,
typeDataverse);
=======
firstPass(typeExpr, typeName, typeMap, incompleteFieldTypes, incompleteItemTypes,
incompleteTopLevelTypeReferences, typeDataverse);
secondPass(mdTxnCtx, typeMap, incompleteFieldTypes, incompleteItemTypes, incompleteTopLevelTypeReferences,
typeDataverse, typeExpr.getSourceLocation());
>>>>>>>
firstPass(typeDataverse, typeName, typeExpr, outTypeMap, incompleteFieldTypes, incompleteItemTypes,
incompleteTopLevelTypeReferences, typeDataverse);
secondPass(mdTxnCtx, outTypeMap, incompleteFieldTypes, incompleteItemTypes, incompleteTopLevelTypeReferences,
typeDataverse, typeExpr.getSourceLocation());
<<<<<<<
Map<TypeSignature, List<TypeSignature>> incompleteTopLevelTypeReferences, DataverseName typeDataverse)
throws AlgebricksException {
=======
Map<TypeSignature, List<TypeSignature>> incompleteTopLevelTypeReferences, String typeDataverse,
SourceLocation sourceLoc) throws AlgebricksException {
>>>>>>>
Map<TypeSignature, List<TypeSignature>> incompleteTopLevelTypeReferences, DataverseName typeDataverse,
SourceLocation sourceLoc) throws AlgebricksException { |
<<<<<<<
System.out.println("connect to " + ipAddress + " " + port);
=======
String applicationName = conf.get("hive.hyracks.app");
//System.out.println("connect to " + ipAddress + " " + port);
>>>>>>>
//System.out.println("connect to " + ipAddress + " " + port); |
<<<<<<<
// Key is FeedId
protected final Map<FeedConnectionId, FeedActivity> feedActivity = new HashMap<FeedConnectionId, FeedActivity>();
// Key is DataverseName, Key of the value map is the Policy name
protected final Map<String, Map<String, FeedPolicy>> feedPolicies = new HashMap<String, Map<String, FeedPolicy>>();
// Key is library dataverse. Key of value map is the library name
protected final Map<String, Map<String, Library>> libraries = new HashMap<String, Map<String, Library>>();
// Key is library dataverse. Key of value map is the feed name
protected final Map<String, Map<String, Feed>> feeds = new HashMap<String, Map<String, Feed>>();
=======
// Key is DataverseName, Key of the value map is the Policy name
protected final Map<String, Map<String, CompactionPolicy>> compactionPolicies = new HashMap<String, Map<String, CompactionPolicy>>();
>>>>>>>
// Key is FeedId
protected final Map<FeedConnectionId, FeedActivity> feedActivity = new HashMap<FeedConnectionId, FeedActivity>();
// Key is DataverseName, Key of the value map is the Policy name
protected final Map<String, Map<String, FeedPolicy>> feedPolicies = new HashMap<String, Map<String, FeedPolicy>>();
// Key is library dataverse. Key of value map is the library name
protected final Map<String, Map<String, Library>> libraries = new HashMap<String, Map<String, Library>>();
// Key is library dataverse. Key of value map is the feed name
protected final Map<String, Map<String, Feed>> feeds = new HashMap<String, Map<String, Feed>>();
// Key is DataverseName, Key of the value map is the Policy name
protected final Map<String, Map<String, CompactionPolicy>> compactionPolicies = new HashMap<String, Map<String, CompactionPolicy>>();
<<<<<<<
synchronized (feedActivity) {
synchronized (libraries) {
dataverses.clear();
nodeGroups.clear();
datasets.clear();
indexes.clear();
datatypes.clear();
functions.clear();
adapters.clear();
feedActivity.clear();
libraries.clear();
}
}
=======
synchronized (compactionPolicies) {
dataverses.clear();
nodeGroups.clear();
datasets.clear();
indexes.clear();
datatypes.clear();
functions.clear();
adapters.clear();
compactionPolicies.clear();
}
>>>>>>>
synchronized (feedActivity) {
synchronized (libraries) {
synchronized (compactionPolicies) {
dataverses.clear();
nodeGroups.clear();
datasets.clear();
indexes.clear();
datatypes.clear();
functions.clear();
adapters.clear();
feedActivity.clear();
libraries.clear();
compactionPolicies.clear();
}
}
} |
<<<<<<<
import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
=======
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory;
>>>>>>>
import edu.uci.ics.asterix.om.base.temporal.GregorianCalendarSystem;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptor;
import edu.uci.ics.asterix.om.functions.IFunctionDescriptorFactory; |
<<<<<<<
import java.io.IOException;
import java.net.InetSocketAddress;
=======
import java.nio.charset.Charset;
>>>>>>>
import java.nio.charset.Charset;
import java.net.InetSocketAddress;
<<<<<<<
private final List<String> names;
private final List<String> values;
public static IServletRequest create(ChannelHandlerContext ctx, FullHttpRequest request) throws IOException {
List<String> names = new ArrayList<>();
List<String> values = new ArrayList<>();
HttpPostRequestDecoder decoder = new HttpPostRequestDecoder(request);
try {
List<InterfaceHttpData> bodyHttpDatas = decoder.getBodyHttpDatas();
for (InterfaceHttpData data : bodyHttpDatas) {
if (data.getHttpDataType().equals(InterfaceHttpData.HttpDataType.Attribute)) {
Attribute attr = (MixedAttribute) data;
names.add(data.getName());
values.add(attr.getValue());
}
}
} finally {
decoder.destroy();
}
InetSocketAddress remoteAddress = (InetSocketAddress) ctx.channel().remoteAddress();
return new FormUrlEncodedRequest(request, remoteAddress, new QueryStringDecoder(request.uri()).parameters(),
names, values);
=======
public static IServletRequest create(FullHttpRequest request) {
Charset charset = HttpUtil.getRequestCharset(request);
Map<String, List<String>> parameters = new LinkedHashMap<>();
URLEncodedUtils.parse(request.content().toString(charset), charset).forEach(
pair -> parameters.computeIfAbsent(pair.getName(), a -> new ArrayList<>()).add(pair.getValue()));
new QueryStringDecoder(request.uri()).parameters()
.forEach((name, value) -> parameters.computeIfAbsent(name, a -> new ArrayList<>()).addAll(value));
return new FormUrlEncodedRequest(request, parameters);
>>>>>>>
public static IServletRequest create(ChannelHandlerContext ctx, FullHttpRequest request) {
Charset charset = HttpUtil.getRequestCharset(request);
Map<String, List<String>> parameters = new LinkedHashMap<>();
URLEncodedUtils.parse(request.content().toString(charset), charset).forEach(
pair -> parameters.computeIfAbsent(pair.getName(), a -> new ArrayList<>()).add(pair.getValue()));
new QueryStringDecoder(request.uri()).parameters()
.forEach((name, value) -> parameters.computeIfAbsent(name, a -> new ArrayList<>()).addAll(value));
InetSocketAddress remoteAddress = (InetSocketAddress) ctx.channel().remoteAddress();
return new FormUrlEncodedRequest(request, remoteAddress, parameters);
<<<<<<<
protected FormUrlEncodedRequest(FullHttpRequest request, InetSocketAddress remoteAddress,
Map<String, List<String>> parameters, List<String> names, List<String> values) {
super(request, remoteAddress, parameters);
this.names = names;
this.values = values;
}
@Override
public String getParameter(CharSequence name) {
for (int i = 0; i < names.size(); i++) {
if (name.equals(names.get(i))) {
return values.get(i);
}
}
return HttpUtil.getParameter(parameters, name);
}
@Override
public Set<String> getParameterNames() {
HashSet<String> paramNames = new HashSet<>();
paramNames.addAll(parameters.keySet());
paramNames.addAll(names);
return Collections.unmodifiableSet(paramNames);
}
@Override
public Map<String, String> getParameters() {
HashMap<String, String> paramMap = new HashMap<>();
paramMap.putAll(super.getParameters());
for (int i = 0; i < names.size(); i++) {
paramMap.put(names.get(i), values.get(i));
}
return Collections.unmodifiableMap(paramMap);
=======
private FormUrlEncodedRequest(FullHttpRequest request, Map<String, List<String>> parameters) {
super(request, parameters);
>>>>>>>
private FormUrlEncodedRequest(FullHttpRequest request, InetSocketAddress remoteAddress,
Map<String, List<String>> parameters) {
super(request, remoteAddress, parameters); |
<<<<<<<
return LSMBTreeTestContext.create(harness.getVirtualBufferCache(), harness.getIOManager(),
harness.getFileReference(), harness.getDiskBufferCache(), harness.getDiskFileMapProvider(),
fieldSerdes, numKeys, harness.getBoomFilterFalsePositiveRate(), harness.getMergePolicy(),
harness.getOperationTrackerFactory(), harness.getIOScheduler(),
harness.getIOOperationCallbackProvider());
=======
return LSMBTreeTestContext.create(harness.getMemBufferCache(), harness.getMemFreePageManager(),
harness.getIOManager(), harness.getFileReference(), harness.getDiskBufferCache(),
harness.getDiskFileMapProvider(), fieldSerdes, numKeys, harness.getBoomFilterFalsePositiveRate(),
harness.getMergePolicy(), harness.getOperationTrackerFactory(), harness.getIOScheduler(),
harness.getIOOperationCallbackProvider(), harness.getIODeviceId());
>>>>>>>
return LSMBTreeTestContext.create(harness.getVirtualBufferCache(), harness.getIOManager(),
harness.getFileReference(), harness.getDiskBufferCache(), harness.getDiskFileMapProvider(),
fieldSerdes, numKeys, harness.getBoomFilterFalsePositiveRate(), harness.getMergePolicy(),
harness.getOperationTrackerFactory(), harness.getIOScheduler(),
harness.getIOOperationCallbackProvider(), harness.getIODeviceId()); |
<<<<<<<
public class AsterixAppContextInfo implements IAsterixApplicationContextInfo, IAsterixPropertiesProvider {
private static AsterixAppContextInfo INSTANCE;
private final ICCApplicationContext appCtx;
private final IHyracksClientConnection hcc;
private AsterixCompilerProperties compilerProperties;
private AsterixExternalProperties externalProperties;
private AsterixMetadataProperties metadataProperties;
private AsterixStorageProperties storageProperties;
private AsterixTransactionProperties txnProperties;
public static void initialize(ICCApplicationContext ccAppCtx, IHyracksClientConnection hcc) throws AsterixException {
if (INSTANCE == null) {
INSTANCE = new AsterixAppContextInfo(ccAppCtx, hcc);
}
AsterixPropertiesAccessor propertiesAccessor = new AsterixPropertiesAccessor();
INSTANCE.compilerProperties = new AsterixCompilerProperties(propertiesAccessor);
INSTANCE.externalProperties = new AsterixExternalProperties(propertiesAccessor);
INSTANCE.metadataProperties = new AsterixMetadataProperties(propertiesAccessor);
INSTANCE.storageProperties = new AsterixStorageProperties(propertiesAccessor);
INSTANCE.txnProperties = new AsterixTransactionProperties(propertiesAccessor);
Logger.getLogger("edu.uci.ics").setLevel(INSTANCE.externalProperties.getLogLevel());
}
private AsterixAppContextInfo(ICCApplicationContext ccAppCtx, IHyracksClientConnection hcc) {
this.appCtx = ccAppCtx;
this.hcc = hcc;
}
public static AsterixAppContextInfo getInstance() {
return INSTANCE;
}
public IHyracksClientConnection getHcc() {
return hcc;
}
@Override
public ICCApplicationContext getCCApplicationContext() {
return appCtx;
}
@Override
public AsterixStorageProperties getStorageProperties() {
return storageProperties;
}
@Override
public AsterixTransactionProperties getTransactionProperties() {
return txnProperties;
}
@Override
public AsterixCompilerProperties getCompilerProperties() {
return compilerProperties;
}
@Override
public AsterixMetadataProperties getMetadataProperties() {
return metadataProperties;
}
@Override
public AsterixExternalProperties getExternalProperties() {
return externalProperties;
}
@Override
public IIndexLifecycleManagerProvider getIndexLifecycleManagerProvider() {
return AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER;
}
@Override
public IStorageManagerInterface getStorageManagerInterface() {
return AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER;
}
=======
public class AsterixAppContextInfo implements IAsterixApplicationContextInfo, IAsterixPropertiesProvider {
private static AsterixAppContextInfo INSTANCE;
private final ICCApplicationContext appCtx;
private AsterixCompilerProperties compilerProperties;
private AsterixExternalProperties externalProperties;
private AsterixMetadataProperties metadataProperties;
private AsterixStorageProperties storageProperties;
private AsterixTransactionProperties txnProperties;
private IHyracksClientConnection hcc;
public static void initialize(ICCApplicationContext ccAppCtx, IHyracksClientConnection hcc) throws AsterixException {
if (INSTANCE == null) {
INSTANCE = new AsterixAppContextInfo(ccAppCtx);
}
AsterixPropertiesAccessor propertiesAccessor = new AsterixPropertiesAccessor();
INSTANCE.compilerProperties = new AsterixCompilerProperties(propertiesAccessor);
INSTANCE.externalProperties = new AsterixExternalProperties(propertiesAccessor);
INSTANCE.metadataProperties = new AsterixMetadataProperties(propertiesAccessor);
INSTANCE.storageProperties = new AsterixStorageProperties(propertiesAccessor);
INSTANCE.txnProperties = new AsterixTransactionProperties(propertiesAccessor);
INSTANCE.hcc = hcc;
Logger.getLogger("edu.uci.ics").setLevel(INSTANCE.externalProperties.getLogLevel());
}
private AsterixAppContextInfo(ICCApplicationContext ccAppCtx) {
this.appCtx = ccAppCtx;
}
public static AsterixAppContextInfo getInstance() {
return INSTANCE;
}
@Override
public ICCApplicationContext getCCApplicationContext() {
return appCtx;
}
@Override
public AsterixStorageProperties getStorageProperties() {
return storageProperties;
}
@Override
public AsterixTransactionProperties getTransactionProperties() {
return txnProperties;
}
@Override
public AsterixCompilerProperties getCompilerProperties() {
return compilerProperties;
}
@Override
public AsterixMetadataProperties getMetadataProperties() {
return metadataProperties;
}
@Override
public AsterixExternalProperties getExternalProperties() {
return externalProperties;
}
public IHyracksClientConnection getHcc() {
return hcc;
}
@Override
public IIndexLifecycleManagerProvider getIndexLifecycleManagerProvider() {
return AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER;
}
@Override
public IStorageManagerInterface getStorageManagerInterface() {
return AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER;
}
>>>>>>>
public class AsterixAppContextInfo implements IAsterixApplicationContextInfo, IAsterixPropertiesProvider {
private static AsterixAppContextInfo INSTANCE;
private final ICCApplicationContext appCtx;
private AsterixCompilerProperties compilerProperties;
private AsterixExternalProperties externalProperties;
private AsterixMetadataProperties metadataProperties;
private AsterixStorageProperties storageProperties;
private AsterixTransactionProperties txnProperties;
private IHyracksClientConnection hcc;
public static void initialize(ICCApplicationContext ccAppCtx, IHyracksClientConnection hcc) throws AsterixException {
if (INSTANCE == null) {
INSTANCE = new AsterixAppContextInfo(ccAppCtx, hcc);
}
AsterixPropertiesAccessor propertiesAccessor = new AsterixPropertiesAccessor();
INSTANCE.compilerProperties = new AsterixCompilerProperties(propertiesAccessor);
INSTANCE.externalProperties = new AsterixExternalProperties(propertiesAccessor);
INSTANCE.metadataProperties = new AsterixMetadataProperties(propertiesAccessor);
INSTANCE.storageProperties = new AsterixStorageProperties(propertiesAccessor);
INSTANCE.txnProperties = new AsterixTransactionProperties(propertiesAccessor);
INSTANCE.hcc = hcc;
Logger.getLogger("edu.uci.ics").setLevel(INSTANCE.externalProperties.getLogLevel());
}
private AsterixAppContextInfo(ICCApplicationContext ccAppCtx, IHyracksClientConnection hcc) {
this.appCtx = ccAppCtx;
this.hcc = hcc;
}
public static AsterixAppContextInfo getInstance() {
return INSTANCE;
}
@Override
public ICCApplicationContext getCCApplicationContext() {
return appCtx;
}
@Override
public AsterixStorageProperties getStorageProperties() {
return storageProperties;
}
@Override
public AsterixTransactionProperties getTransactionProperties() {
return txnProperties;
}
@Override
public AsterixCompilerProperties getCompilerProperties() {
return compilerProperties;
}
@Override
public AsterixMetadataProperties getMetadataProperties() {
return metadataProperties;
}
@Override
public AsterixExternalProperties getExternalProperties() {
return externalProperties;
}
public IHyracksClientConnection getHcc() {
return hcc;
}
@Override
public IIndexLifecycleManagerProvider getIndexLifecycleManagerProvider() {
return AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER;
}
@Override
public IStorageManagerInterface getStorageManagerInterface() {
return AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER;
} |
<<<<<<<
physicalRewritesAllLevels.add(new InlineSingleReferenceVariablesRule());
physicalRewritesAllLevels.add(new RemoveUnusedAssignAndAggregateRule());
physicalRewritesAllLevels.add(new ConsolidateAssignsRule());
=======
// After adding projects, we may need need to set physical operators again.
physicalRewritesAllLevels.add(new SetAlgebricksPhysicalOperatorsRule());
>>>>>>>
physicalRewritesAllLevels.add(new InlineSingleReferenceVariablesRule());
physicalRewritesAllLevels.add(new RemoveUnusedAssignAndAggregateRule());
physicalRewritesAllLevels.add(new ConsolidateAssignsRule());
// After adding projects, we may need need to set physical operators again.
physicalRewritesAllLevels.add(new SetAlgebricksPhysicalOperatorsRule()); |
<<<<<<<
=======
import edu.uci.ics.asterix.common.transactions.JobId;
import edu.uci.ics.asterix.external.dataset.adapter.AdapterIdentifier;
>>>>>>>
import edu.uci.ics.asterix.common.transactions.JobId;
import edu.uci.ics.asterix.external.dataset.adapter.AdapterIdentifier;
<<<<<<<
import edu.uci.ics.asterix.metadata.feeds.AdapterIdentifier;
import edu.uci.ics.asterix.transaction.management.service.transaction.JobId;
=======
>>>>>>>
import edu.uci.ics.asterix.metadata.feeds.AdapterIdentifier;
import edu.uci.ics.asterix.transaction.management.service.transaction.JobId; |
<<<<<<<
import edu.uci.ics.asterix.common.api.AsterixThreadFactory;
import edu.uci.ics.asterix.common.config.AsterixProperties;
import edu.uci.ics.asterix.common.context.AsterixAppRuntimeContext;
=======
import edu.uci.ics.asterix.api.common.AsterixAppRuntimeContext;
import edu.uci.ics.asterix.common.api.IAsterixAppRuntimeContext;
import edu.uci.ics.asterix.common.config.AsterixMetadataProperties;
import edu.uci.ics.asterix.common.config.IAsterixPropertiesProvider;
import edu.uci.ics.asterix.common.transactions.IRecoveryManager;
import edu.uci.ics.asterix.common.transactions.IRecoveryManager.SystemState;
>>>>>>>
import edu.uci.ics.asterix.api.common.AsterixAppRuntimeContext;
import edu.uci.ics.asterix.common.api.AsterixThreadFactory;
import edu.uci.ics.asterix.common.api.IAsterixAppRuntimeContext;
import edu.uci.ics.asterix.common.config.AsterixMetadataProperties;
import edu.uci.ics.asterix.common.config.IAsterixPropertiesProvider;
import edu.uci.ics.asterix.common.transactions.IRecoveryManager;
import edu.uci.ics.asterix.common.transactions.IRecoveryManager.SystemState; |
<<<<<<<
import org.apache.asterix.common.metadata.DataverseName;
=======
import org.apache.asterix.common.external.IDataSourceAdapter;
>>>>>>>
import org.apache.asterix.common.external.IDataSourceAdapter;
import org.apache.asterix.common.metadata.DataverseName;
<<<<<<<
configuration.put(ExternalDataConstants.KEY_DATAVERSE, dataset.getDataverseName().getCanonicalForm());
IAdapterFactory adapterFactory = AdapterFactoryProvider.getAdapterFactory(
=======
configuration.put(ExternalDataConstants.KEY_DATAVERSE, dataset.getDataverseName());
ITypedAdapterFactory adapterFactory = AdapterFactoryProvider.getAdapterFactory(
>>>>>>>
configuration.put(ExternalDataConstants.KEY_DATAVERSE, dataset.getDataverseName().getCanonicalForm());
ITypedAdapterFactory adapterFactory = AdapterFactoryProvider.getAdapterFactory( |
<<<<<<<
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
=======
>>>>>>>
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator; |
<<<<<<<
=======
public int getMostRecentDatasetId() throws MetadataException;
>>>>>>>
public int getMostRecentDatasetId() throws MetadataException; |
<<<<<<<
lsmBtree = LSMBTreeUtils.createLSMTree(
virtualBufferCaches,
file,
bufferCache,
fileMapProvider,
typeTraits,
comparatorFactories,
bloomFilterKeyFields,
runtimeContext.getBloomFilterFalsePositiveRate(),
runtimeContext.getMetadataMergePolicyFactory().createMergePolicy(
GlobalConfig.DEFAULT_COMPACTION_POLICY_PROPERTIES), opTracker,
runtimeContext.getLSMIOScheduler(), rtcProvider);
=======
lsmBtree = LSMBTreeUtils.createLSMTree(virtualBufferCaches, file, bufferCache, fileMapProvider, typeTraits,
comparatorFactories, bloomFilterKeyFields, runtimeContext.getBloomFilterFalsePositiveRate(),
runtimeContext.getLSMMergePolicy(), opTracker, runtimeContext.getLSMIOScheduler(),
LSMBTreeIOOperationCallbackFactory.INSTANCE.createIOOperationCallback());
>>>>>>>
lsmBtree = LSMBTreeUtils.createLSMTree(
virtualBufferCaches,
file,
bufferCache,
fileMapProvider,
typeTraits,
comparatorFactories,
bloomFilterKeyFields,
runtimeContext.getBloomFilterFalsePositiveRate(),
runtimeContext.getMetadataMergePolicyFactory().createMergePolicy(
GlobalConfig.DEFAULT_COMPACTION_POLICY_PROPERTIES), opTracker,
runtimeContext.getLSMIOScheduler(),
LSMBTreeIOOperationCallbackFactory.INSTANCE.createIOOperationCallback());
<<<<<<<
typeTraits, comparatorFactories, bloomFilterKeyFields, runtimeContext
.getBloomFilterFalsePositiveRate(), runtimeContext.getMetadataMergePolicyFactory()
.createMergePolicy(GlobalConfig.DEFAULT_COMPACTION_POLICY_PROPERTIES), opTracker,
runtimeContext.getLSMIOScheduler(), AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER);
=======
typeTraits, comparatorFactories, bloomFilterKeyFields,
runtimeContext.getBloomFilterFalsePositiveRate(), runtimeContext.getLSMMergePolicy(),
opTracker, runtimeContext.getLSMIOScheduler(),
LSMBTreeIOOperationCallbackFactory.INSTANCE.createIOOperationCallback());
>>>>>>>
typeTraits, comparatorFactories, bloomFilterKeyFields, runtimeContext
.getBloomFilterFalsePositiveRate(), runtimeContext.getMetadataMergePolicyFactory()
.createMergePolicy(GlobalConfig.DEFAULT_COMPACTION_POLICY_PROPERTIES), opTracker,
runtimeContext.getLSMIOScheduler(), LSMBTreeIOOperationCallbackFactory.INSTANCE
.createIOOperationCallback()); |
<<<<<<<
=======
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Starting DDL recovery ...");
}
>>>>>>>
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Starting DDL recovery ...");
} |
<<<<<<<
public static void setConnectionHeader(HttpRequest request, DefaultHttpResponse response) {
final boolean keepAlive = io.netty.handler.codec.http.HttpUtil.isKeepAlive(request);
final AsciiString connectionHeaderValue = keepAlive ? HttpHeaderValues.KEEP_ALIVE : HttpHeaderValues.CLOSE;
response.headers().set(HttpHeaderNames.CONNECTION, connectionHeaderValue);
}
public static String getPreferredCharset(IServletRequest request) {
=======
public static Charset getPreferredCharset(IServletRequest request) {
>>>>>>>
public static void setConnectionHeader(HttpRequest request, DefaultHttpResponse response) {
final boolean keepAlive = io.netty.handler.codec.http.HttpUtil.isKeepAlive(request);
final AsciiString connectionHeaderValue = keepAlive ? HttpHeaderValues.KEEP_ALIVE : HttpHeaderValues.CLOSE;
response.headers().set(HttpHeaderNames.CONNECTION, connectionHeaderValue);
}
public static Charset getPreferredCharset(IServletRequest request) { |
<<<<<<<
ITupleReference tuple = getTupleToBeDeleted(jobId, MetadataPrimaryIndexes.DATATYPE_DATASET, searchKey);
deleteTupleFromIndex(jobId, MetadataPrimaryIndexes.DATATYPE_DATASET, tuple);
deleteFromDatatypeSecondaryIndex(jobId, dataverseName, datatypeName);
List<String> nestedTypes = getNestedDatatypeNames(jobId, dataverseName, datatypeName);
=======
ITupleReference tuple = getTupleToBeDeleted(txnId, MetadataPrimaryIndexes.DATATYPE_DATASET, searchKey);
// This call uses the secondary index on datatype. Get nested types before deleting entry from secondary index.
List<String> nestedTypes = getNestedDatatypeNames(txnId, dataverseName, datatypeName);
deleteTupleFromIndex(txnId, MetadataPrimaryIndexes.DATATYPE_DATASET, tuple);
deleteFromDatatypeSecondaryIndex(txnId, dataverseName, datatypeName);
>>>>>>>
ITupleReference tuple = getTupleToBeDeleted(jobId, MetadataPrimaryIndexes.DATATYPE_DATASET, searchKey);
// This call uses the secondary index on datatype. Get nested types before deleting entry from secondary index.
List<String> nestedTypes = getNestedDatatypeNames(jobId, dataverseName, datatypeName);
deleteTupleFromIndex(jobId, MetadataPrimaryIndexes.DATATYPE_DATASET, tuple);
deleteFromDatatypeSecondaryIndex(jobId, dataverseName, datatypeName); |
<<<<<<<
LSMInvertedIndex invIndex = InvertedIndexUtils.createLSMInvertedIndex(virtualBufferCache,
diskFileMapProvider, invIndexOpDesc.getInvListsTypeTraits(),
invIndexOpDesc.getInvListsComparatorFactories(), invIndexOpDesc.getTokenTypeTraits(),
invIndexOpDesc.getTokenComparatorFactories(), invIndexOpDesc.getTokenizerFactory(),
diskBufferCache, ctx.getIOManager(), file.getFile().getPath(), bloomFilterFalsePositiveRate,
mergePolicy, opTrackerFactory, ioScheduler, ioOpCallbackProvider, partition);
=======
LSMInvertedIndex invIndex = InvertedIndexUtils.createLSMInvertedIndex(memBufferCache, memFreePageManager,
diskFileMapProvider, invIndexOpDesc.getInvListsTypeTraits(), invIndexOpDesc
.getInvListsComparatorFactories(), invIndexOpDesc.getTokenTypeTraits(), invIndexOpDesc
.getTokenComparatorFactories(), invIndexOpDesc.getTokenizerFactory(), diskBufferCache, ctx
.getIOManager(), file.getFile().getPath(), bloomFilterFalsePositiveRate, mergePolicy,
opTrackerFactory, ioScheduler, ioOpCallbackProvider,
opDesc.getFileSplitProvider().getFileSplits()[partition].getIODeviceId());
>>>>>>>
LSMInvertedIndex invIndex = InvertedIndexUtils.createLSMInvertedIndex(virtualBufferCache,
diskFileMapProvider, invIndexOpDesc.getInvListsTypeTraits(), invIndexOpDesc
.getInvListsComparatorFactories(), invIndexOpDesc.getTokenTypeTraits(), invIndexOpDesc
.getTokenComparatorFactories(), invIndexOpDesc.getTokenizerFactory(), diskBufferCache, ctx
.getIOManager(), file.getFile().getPath(), bloomFilterFalsePositiveRate, mergePolicy,
opTrackerFactory, ioScheduler, ioOpCallbackProvider,
opDesc.getFileSplitProvider().getFileSplits()[partition].getIODeviceId()); |
<<<<<<<
public static final String MANAGIX_INTERNAL_DIR = ".installer";
public static final String MANAGIX_EVENT_DIR = MANAGIX_INTERNAL_DIR + File.separator + "eventrix";
public static final String MANAGIX_EVENT_SCRIPTS_DIR = MANAGIX_INTERNAL_DIR + File.separator + "eventrix"
+ File.separator + "scripts";
public static final String DEFAULT_ASTERIX_CONFIGURATION_PATH = "clusters" + File.separator + "local"
+ File.separator + "conf" + File.separator + "asterix-conf.xml";
public static final String ASTERIX_DIR = "asterix";
public static final String EVENTS_DIR = "events";
private static final Logger LOGGER = Logger.getLogger(InstallerDriver.class.getName());
public static final String ENV_MANAGIX_HOME = "MANAGIX_HOME";
public static final String MANAGIX_CONF_XML = "conf" + File.separator + "managix-conf.xml";
private static Configuration conf;
private static String managixHome;
private static String asterixZip;
public static String getAsterixZip() {
return asterixZip;
}
public static Configuration getConfiguration() {
return conf;
}
public static void initConfig() throws Exception {
File configFile = new File(managixHome + File.separator + MANAGIX_CONF_XML);
JAXBContext configCtx = JAXBContext.newInstance(Configuration.class);
Unmarshaller unmarshaller = configCtx.createUnmarshaller();
conf = (Configuration) unmarshaller.unmarshal(configFile);
asterixZip = initBinary("asterix-server");
ILookupService lookupService = ServiceProvider.INSTANCE.getLookupService();
if (!lookupService.isRunning(conf)) {
lookupService.startService(conf);
}
}
private static String initBinary(final String fileNamePattern) {
String asterixDir = InstallerDriver.getAsterixDir();
File file = new File(asterixDir);
File[] zipFiles = file.listFiles(new FileFilter() {
public boolean accept(File arg0) {
return arg0.getAbsolutePath().contains(fileNamePattern) && arg0.isFile();
}
});
if (zipFiles.length == 0) {
String msg = " Binary not found at " + asterixDir;
LOGGER.log(Level.FATAL, msg);
throw new IllegalStateException(msg);
}
if (zipFiles.length > 1) {
String msg = " Multiple binaries found at " + asterixDir;
LOGGER.log(Level.FATAL, msg);
throw new IllegalStateException(msg);
}
return zipFiles[0].getAbsolutePath();
}
public static String getManagixHome() {
return managixHome;
}
public static String getAsterixDir() {
return managixHome + File.separator + ASTERIX_DIR;
}
public static void main(String args[]) {
try {
if (args.length != 0) {
managixHome = System.getenv(ENV_MANAGIX_HOME);
CommandHandler cmdHandler = new CommandHandler();
cmdHandler.processCommand(args);
} else {
printUsage();
}
} catch (IllegalArgumentException iae) {
LOGGER.error("Unknown command");
printUsage();
} catch (Exception e) {
LOGGER.error(e.getMessage());
if (e.getMessage() == null || e.getMessage().length() == 0) {
e.printStackTrace();
}
}
}
private static void printUsage() {
StringBuffer buffer = new StringBuffer("managix <command> <options>" + "\n");
buffer.append("Commands" + "\n");
buffer.append("create " + ":" + " Creates a new asterix instance" + "\n");
buffer.append("delete " + ":" + " Deletes an asterix instance" + "\n");
buffer.append("start " + ":" + " Starts an asterix instance" + "\n");
buffer.append("stop " + ":" + " Stops an asterix instance that is in ACTIVE state" + "\n");
buffer.append("backup " + ":" + " Creates a back up for an existing asterix instance" + "\n");
buffer.append("restore " + ":" + " Restores an asterix instance" + "\n");
buffer.append("describe " + ":" + " Describes an existing asterix instance" + "\n");
buffer.append("validate " + ":" + " Validates the installer/cluster configuration" + "\n");
buffer.append("configure" + ":" + " Auto-generate configuration for local psedu-distributed Asterix instance"
+ "\n");
buffer.append("shutdown " + ":" + " Shutdown the installer service" + "\n");
buffer.append("validate " + ":" + " Validates the installer/cluster configuration" + "\n");
buffer.append("configure" + ":" + " Auto-generate configuration for local psedu-distributed Asterix instance"
+ "\n");
buffer.append("shutdown " + ":" + " Shutdown the installer service" + "\n");
buffer.append("help " + ":" + " Provides usage description of a command" + "\n");
LOGGER.info(buffer.toString());
}
=======
public static final String MANAGIX_INTERNAL_DIR = ".installer";
public static final String MANAGIX_EVENT_DIR = MANAGIX_INTERNAL_DIR + File.separator + "eventrix";
public static final String MANAGIX_EVENT_SCRIPTS_DIR = MANAGIX_INTERNAL_DIR + File.separator + "eventrix"
+ File.separator + "scripts";
public static final String ASTERIX_DIR = "asterix";
public static final String EVENTS_DIR = "events";
private static final Logger LOGGER = Logger.getLogger(InstallerDriver.class.getName());
public static final String ENV_MANAGIX_HOME = "MANAGIX_HOME";
public static final String MANAGIX_CONF_XML = "conf" + File.separator + "managix-conf.xml";
private static Configuration conf;
private static String managixHome;
private static String asterixZip;
public static String getAsterixZip() {
return asterixZip;
}
public static Configuration getConfiguration() {
return conf;
}
public static void initConfig() throws Exception {
File configFile = new File(managixHome + File.separator + MANAGIX_CONF_XML);
JAXBContext configCtx = JAXBContext.newInstance(Configuration.class);
Unmarshaller unmarshaller = configCtx.createUnmarshaller();
conf = (Configuration) unmarshaller.unmarshal(configFile);
asterixZip = initBinary("asterix-server");
ILookupService lookupService = ServiceProvider.INSTANCE.getLookupService();
if (!lookupService.isRunning(conf)) {
lookupService.startService(conf);
}
}
private static String initBinary(final String fileNamePattern) {
String asterixDir = InstallerDriver.getAsterixDir();
File file = new File(asterixDir);
File[] zipFiles = file.listFiles(new FileFilter() {
public boolean accept(File arg0) {
return arg0.getAbsolutePath().contains(fileNamePattern) && arg0.isFile();
}
});
if (zipFiles.length == 0) {
String msg = " Binary not found at " + asterixDir;
LOGGER.log(Level.FATAL, msg);
throw new IllegalStateException(msg);
}
if (zipFiles.length > 1) {
String msg = " Multiple binaries found at " + asterixDir;
LOGGER.log(Level.FATAL, msg);
throw new IllegalStateException(msg);
}
return zipFiles[0].getAbsolutePath();
}
public static String getManagixHome() {
return managixHome;
}
public static String getAsterixDir() {
return managixHome + File.separator + ASTERIX_DIR;
}
public static void main(String args[]) {
try {
if (args.length != 0) {
managixHome = System.getenv(ENV_MANAGIX_HOME);
CommandHandler cmdHandler = new CommandHandler();
cmdHandler.processCommand(args);
} else {
printUsage();
}
} catch (IllegalArgumentException iae) {
LOGGER.error("Unknown command");
printUsage();
} catch (Exception e) {
LOGGER.error(e.getMessage());
if (e.getMessage() == null || e.getMessage().length() == 0) {
e.printStackTrace();
}
}
}
private static void printUsage() {
StringBuffer buffer = new StringBuffer("managix <command> <options>" + "\n");
buffer.append("Commands" + "\n");
buffer.append("create " + ":" + " Creates a new asterix instance" + "\n");
buffer.append("delete " + ":" + " Deletes an asterix instance" + "\n");
buffer.append("start " + ":" + " Starts an asterix instance" + "\n");
buffer.append("stop " + ":" + " Stops an asterix instance that is in ACTIVE state" + "\n");
buffer.append("backup " + ":" + " Creates a back up for an existing asterix instance" + "\n");
buffer.append("restore " + ":" + " Restores an asterix instance" + "\n");
buffer.append("describe " + ":" + " Describes an existing asterix instance" + "\n");
buffer.append("validate " + ":" + " Validates the installer/cluster configuration" + "\n");
buffer.append("configure" + ":" + " Auto-generate configuration for local psedu-distributed Asterix instance"
+ "\n");
buffer.append("shutdown " + ":" + " Shutdown the installer service" + "\n");
buffer.append("help " + ":" + " Provides usage description of a command" + "\n");
LOGGER.info(buffer.toString());
}
>>>>>>>
public static final String MANAGIX_INTERNAL_DIR = ".installer";
public static final String MANAGIX_EVENT_DIR = MANAGIX_INTERNAL_DIR + File.separator + "eventrix";
public static final String MANAGIX_EVENT_SCRIPTS_DIR = MANAGIX_INTERNAL_DIR + File.separator + "eventrix"
+ File.separator + "scripts";
public static final String DEFAULT_ASTERIX_CONFIGURATION_PATH = "clusters" + File.separator + "local"
+ File.separator + "conf" + File.separator + "asterix-conf.xml";
public static final String ASTERIX_DIR = "asterix";
public static final String EVENTS_DIR = "events";
private static final Logger LOGGER = Logger.getLogger(InstallerDriver.class.getName());
public static final String ENV_MANAGIX_HOME = "MANAGIX_HOME";
public static final String MANAGIX_CONF_XML = "conf" + File.separator + "managix-conf.xml";
private static Configuration conf;
private static String managixHome;
private static String asterixZip;
public static String getAsterixZip() {
return asterixZip;
}
public static Configuration getConfiguration() {
return conf;
}
public static void initConfig() throws Exception {
File configFile = new File(managixHome + File.separator + MANAGIX_CONF_XML);
JAXBContext configCtx = JAXBContext.newInstance(Configuration.class);
Unmarshaller unmarshaller = configCtx.createUnmarshaller();
conf = (Configuration) unmarshaller.unmarshal(configFile);
asterixZip = initBinary("asterix-server");
ILookupService lookupService = ServiceProvider.INSTANCE.getLookupService();
if (!lookupService.isRunning(conf)) {
lookupService.startService(conf);
}
}
private static String initBinary(final String fileNamePattern) {
String asterixDir = InstallerDriver.getAsterixDir();
File file = new File(asterixDir);
File[] zipFiles = file.listFiles(new FileFilter() {
public boolean accept(File arg0) {
return arg0.getAbsolutePath().contains(fileNamePattern) && arg0.isFile();
}
});
if (zipFiles.length == 0) {
String msg = " Binary not found at " + asterixDir;
LOGGER.log(Level.FATAL, msg);
throw new IllegalStateException(msg);
}
if (zipFiles.length > 1) {
String msg = " Multiple binaries found at " + asterixDir;
LOGGER.log(Level.FATAL, msg);
throw new IllegalStateException(msg);
}
return zipFiles[0].getAbsolutePath();
}
public static String getManagixHome() {
return managixHome;
}
public static String getAsterixDir() {
return managixHome + File.separator + ASTERIX_DIR;
}
public static void main(String args[]) {
try {
if (args.length != 0) {
managixHome = System.getenv(ENV_MANAGIX_HOME);
CommandHandler cmdHandler = new CommandHandler();
cmdHandler.processCommand(args);
} else {
printUsage();
}
} catch (IllegalArgumentException iae) {
LOGGER.error("Unknown command");
printUsage();
} catch (Exception e) {
LOGGER.error(e.getMessage());
if (e.getMessage() == null || e.getMessage().length() == 0) {
e.printStackTrace();
}
}
}
private static void printUsage() {
StringBuffer buffer = new StringBuffer("managix <command> <options>" + "\n");
buffer.append("Commands" + "\n");
buffer.append("create " + ":" + " Creates a new asterix instance" + "\n");
buffer.append("delete " + ":" + " Deletes an asterix instance" + "\n");
buffer.append("start " + ":" + " Starts an asterix instance" + "\n");
buffer.append("stop " + ":" + " Stops an asterix instance that is in ACTIVE state" + "\n");
buffer.append("backup " + ":" + " Creates a back up for an existing asterix instance" + "\n");
buffer.append("restore " + ":" + " Restores an asterix instance" + "\n");
buffer.append("describe " + ":" + " Describes an existing asterix instance" + "\n");
buffer.append("validate " + ":" + " Validates the installer/cluster configuration" + "\n");
buffer.append("configure" + ":" + " Auto-generate configuration for local psedu-distributed Asterix instance"
+ "\n");
buffer.append("shutdown " + ":" + " Shutdown the installer service" + "\n");
buffer.append("help " + ":" + " Provides usage description of a command" + "\n");
LOGGER.info(buffer.toString());
} |
<<<<<<<
import java.util.ArrayList;
=======
import java.io.PrintWriter;
import java.io.StringWriter;
>>>>>>>
import java.util.ArrayList;
import java.io.PrintWriter;
import java.io.StringWriter; |
<<<<<<<
DataverseName itemTypeDataverseName = getActiveDataverseName(dd.getItemTypeDataverse());
String itemTypeName = dd.getItemTypeName().getValue();
DataverseName metaItemTypeDataverseName = null;
String metaItemTypeName = null;
Identifier metaItemTypeId = dd.getMetaItemTypeName();
if (metaItemTypeId != null) {
metaItemTypeName = metaItemTypeId.getValue();
metaItemTypeDataverseName = getActiveDataverseName(dd.getMetaItemTypeDataverse());
}
=======
DatasetType dsType = dd.getDatasetType();
TypeExpression itemTypeExpr = dd.getItemType();
String itemTypeDataverseName = null, itemTypeName = null, itemTypeFullyQualifiedName = null;
switch (itemTypeExpr.getTypeKind()) {
case TYPEREFERENCE:
TypeReferenceExpression itemTypeRefExpr = (TypeReferenceExpression) itemTypeExpr;
Identifier itemTypeDataverseIdent = itemTypeRefExpr.getIdent().first;
itemTypeDataverseName = itemTypeDataverseIdent != null && itemTypeDataverseIdent.getValue() != null
? itemTypeDataverseIdent.getValue() : dataverseName;
itemTypeName = itemTypeRefExpr.getIdent().second.getValue();
itemTypeFullyQualifiedName = itemTypeDataverseName + '.' + itemTypeName;
break;
case RECORD:
break;
default:
throw new CompilationException(ErrorCode.COMPILATION_ILLEGAL_STATE, sourceLoc,
String.valueOf(itemTypeExpr.getTypeKind()));
}
TypeExpression metaItemTypeExpr = dd.getMetaItemType();
String metaItemTypeDataverseName = null, metaItemTypeName = null, metaItemTypeFullyQualifiedName = null;
if (metaItemTypeExpr != null) {
switch (metaItemTypeExpr.getTypeKind()) {
case TYPEREFERENCE:
TypeReferenceExpression metaItemTypeRefExpr = (TypeReferenceExpression) metaItemTypeExpr;
Identifier metaItemTypeDataverseIdent = metaItemTypeRefExpr.getIdent().first;
metaItemTypeDataverseName =
metaItemTypeDataverseIdent != null && metaItemTypeDataverseIdent.getValue() != null
? metaItemTypeDataverseIdent.getValue() : dataverseName;
metaItemTypeName = metaItemTypeRefExpr.getIdent().second.getValue();
metaItemTypeFullyQualifiedName = metaItemTypeDataverseName + '.' + metaItemTypeName;
break;
case RECORD:
break;
default:
throw new CompilationException(ErrorCode.COMPILATION_ILLEGAL_STATE, sourceLoc,
String.valueOf(metaItemTypeExpr.getTypeKind()));
}
}
>>>>>>>
TypeExpression itemTypeExpr = dd.getItemType();
DataverseName itemTypeDataverseName = null;
String itemTypeName = null;
switch (itemTypeExpr.getTypeKind()) {
case TYPEREFERENCE:
TypeReferenceExpression itemTypeRefExpr = (TypeReferenceExpression) itemTypeExpr;
Pair<DataverseName, Identifier> itemTypeIdent = itemTypeRefExpr.getIdent();
itemTypeDataverseName = itemTypeIdent.first != null ? itemTypeIdent.first : dataverseName;
itemTypeName = itemTypeRefExpr.getIdent().second.getValue();
break;
case RECORD:
break;
default:
throw new CompilationException(ErrorCode.COMPILATION_ILLEGAL_STATE, stmt.getSourceLocation(),
String.valueOf(itemTypeExpr.getTypeKind()));
}
TypeExpression metaItemTypeExpr = dd.getMetaItemType();
DataverseName metaItemTypeDataverseName = null;
String metaItemTypeName = null;
if (metaItemTypeExpr != null) {
switch (metaItemTypeExpr.getTypeKind()) {
case TYPEREFERENCE:
TypeReferenceExpression metaItemTypeRefExpr = (TypeReferenceExpression) metaItemTypeExpr;
Pair<DataverseName, Identifier> metaItemTypeIdent = metaItemTypeRefExpr.getIdent();
metaItemTypeDataverseName =
metaItemTypeIdent.first != null ? metaItemTypeIdent.first : dataverseName;
metaItemTypeName = metaItemTypeRefExpr.getIdent().second.getValue();
break;
case RECORD:
break;
default:
throw new CompilationException(ErrorCode.COMPILATION_ILLEGAL_STATE, stmt.getSourceLocation(),
String.valueOf(metaItemTypeExpr.getTypeKind()));
}
}
<<<<<<<
=======
MetadataLockUtil.createDatasetBegin(lockManager, metadataProvider.getLocks(), dataverseName,
itemTypeDataverseName, itemTypeFullyQualifiedName, metaItemTypeDataverseName,
metaItemTypeFullyQualifiedName, nodegroupName, compactionPolicy, dataverseName + "." + datasetName,
defaultCompactionPolicy);
>>>>>>>
<<<<<<<
Map<TypeSignature, IAType> typeMap = TypeTranslator.computeTypes(dataverseName,
stmtCreateType.getIdent().getValue(), stmtCreateType.getTypeDef(), dataverseName, mdTxnCtx);
TypeSignature typeSignature = new TypeSignature(dataverseName, typeName);
IAType type = typeMap.get(typeSignature);
=======
IAType type = translateType(dataverseName, typeName, stmtCreateType.getTypeDef(), mdTxnCtx);
>>>>>>>
IAType type = translateType(dataverseName, typeName, stmtCreateType.getTypeDef(), mdTxnCtx); |
<<<<<<<
ILSMMergePolicyFactory mergePolicyFactory, Map<String, String> mergePolicyProperties,
ILSMOperationTrackerProvider opTrackerProvider, ILSMIOOperationSchedulerProvider ioSchedulerProvider,
ILSMIOOperationCallbackProvider ioOpCallbackProvider, double bloomFilterFalsePositiveRate) {
super(virtualBufferCacheProvider, mergePolicyFactory, mergePolicyProperties, opTrackerProvider,
ioSchedulerProvider, ioOpCallbackProvider, bloomFilterFalsePositiveRate);
=======
ILSMMergePolicyProvider mergePolicyProvider, ILSMOperationTrackerProvider opTrackerProvider,
ILSMIOOperationSchedulerProvider ioSchedulerProvider, ILSMIOOperationCallbackFactory ioOpCallbackFactory,
double bloomFilterFalsePositiveRate) {
super(virtualBufferCacheProvider, mergePolicyProvider, opTrackerProvider, ioSchedulerProvider,
ioOpCallbackFactory, bloomFilterFalsePositiveRate);
>>>>>>>
ILSMMergePolicyFactory mergePolicyFactory, Map<String, String> mergePolicyProperties,
ILSMOperationTrackerProvider opTrackerProvider, ILSMIOOperationSchedulerProvider ioSchedulerProvider,
ILSMIOOperationCallbackFactory ioOpCallbackFactory, double bloomFilterFalsePositiveRate) {
super(virtualBufferCacheProvider, mergePolicyFactory, mergePolicyProperties, opTrackerProvider,
ioSchedulerProvider, ioOpCallbackFactory, bloomFilterFalsePositiveRate);
<<<<<<<
mergePolicyFactory.createMergePolicy(mergePolicyProperties), opTrackerFactory,
ioSchedulerProvider.getIOScheduler(ctx), ioOpCallbackProvider);
=======
mergePolicyProvider.getMergePolicy(ctx), opTrackerFactory, ioSchedulerProvider.getIOScheduler(ctx),
ioOpCallbackFactory);
>>>>>>>
mergePolicyFactory.createMergePolicy(mergePolicyProperties), opTrackerFactory,
ioSchedulerProvider.getIOScheduler(ctx), ioOpCallbackFactory); |
<<<<<<<
import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.tokenizers.IBinaryTokenizer;
import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.tokenizers.IToken;
import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.tokenizers.IntArray;
import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.tokenizers.NGramUTF8StringBinaryTokenizer;
=======
import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.IBinaryTokenizer;
import edu.uci.ics.hyracks.storage.am.invertedindex.tokenizers.NGramUTF8StringBinaryTokenizer;
>>>>>>>
import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.tokenizers.IBinaryTokenizer;
import edu.uci.ics.hyracks.storage.am.lsm.invertedindex.tokenizers.NGramUTF8StringBinaryTokenizer; |
<<<<<<<
import org.apache.asterix.common.functions.ExternalFunctionLanguage;
import org.apache.asterix.common.library.ILibrary;
import org.apache.asterix.common.metadata.DataverseName;
import org.apache.asterix.external.api.IAdapterFactory;
import org.apache.asterix.external.api.IDataSourceAdapter;
import org.apache.asterix.external.api.IDataSourceAdapter.AdapterType;
=======
import org.apache.asterix.common.external.IDataSourceAdapter;
import org.apache.asterix.common.external.IDataSourceAdapter.AdapterType;
import org.apache.asterix.external.api.ITypedAdapterFactory;
>>>>>>>
import org.apache.asterix.common.external.IDataSourceAdapter;
import org.apache.asterix.common.external.IDataSourceAdapter.AdapterType;
import org.apache.asterix.common.functions.ExternalFunctionLanguage;
import org.apache.asterix.common.library.ILibrary;
import org.apache.asterix.common.metadata.DataverseName;
import org.apache.asterix.external.api.ITypedAdapterFactory;
<<<<<<<
ILibrary lib = appCtx.getLibraryManager().getLibrary(feed.getDataverseName(), libraryName);
if (lib.getLanguage() != ExternalFunctionLanguage.JAVA) {
throw new HyracksDataException("Unexpected library language: " + lib.getLanguage());
}
ClassLoader cl = ((JavaLibrary) lib).getClassLoader();
adapterFactory = (IAdapterFactory) cl.loadClass(adapterFactoryClassname).newInstance();
=======
ClassLoader cl =
appCtx.getLibraryManager().getLibraryClassLoader(feed.getDataverseName(), libraryName);
adapterFactory = (ITypedAdapterFactory) cl.loadClass(adapterFactoryClassname).newInstance();
>>>>>>>
ILibrary lib = appCtx.getLibraryManager().getLibrary(feed.getDataverseName(), libraryName);
if (lib.getLanguage() != ExternalFunctionLanguage.JAVA) {
throw new HyracksDataException("Unexpected library language: " + lib.getLanguage());
}
ClassLoader cl = ((JavaLibrary) lib).getClassLoader();
adapterFactory = (ITypedAdapterFactory) cl.loadClass(adapterFactoryClassname).newInstance();
<<<<<<<
ILibrary lib = appCtx.getLibraryManager().getLibrary(feed.getDataverseName(), libraryName);
if (lib.getLanguage() != ExternalFunctionLanguage.JAVA) {
throw new HyracksDataException("Unexpected library language: " + lib.getLanguage());
}
ClassLoader cl = ((JavaLibrary) lib).getClassLoader();
adapterFactory = (IAdapterFactory) cl.loadClass(adapterFactoryClassname).newInstance();
=======
ClassLoader cl =
appCtx.getLibraryManager().getLibraryClassLoader(feed.getDataverseName(), libraryName);
adapterFactory = (ITypedAdapterFactory) cl.loadClass(adapterFactoryClassname).newInstance();
>>>>>>>
ILibrary lib = appCtx.getLibraryManager().getLibrary(feed.getDataverseName(), libraryName);
if (lib.getLanguage() != ExternalFunctionLanguage.JAVA) {
throw new HyracksDataException("Unexpected library language: " + lib.getLanguage());
}
ClassLoader cl = ((JavaLibrary) lib).getClassLoader();
adapterFactory = (ITypedAdapterFactory) cl.loadClass(adapterFactoryClassname).newInstance(); |
<<<<<<<
import edu.uci.ics.asterix.common.api.AsterixAppContextInfoImpl;
import edu.uci.ics.asterix.common.api.AsterixThreadFactory;
import edu.uci.ics.asterix.common.config.AsterixProperties;
import edu.uci.ics.asterix.common.config.GlobalConfig;
=======
import edu.uci.ics.asterix.common.config.AsterixExternalProperties;
import edu.uci.ics.asterix.common.config.AsterixMetadataProperties;
>>>>>>>
import edu.uci.ics.asterix.common.api.AsterixThreadFactory;
import edu.uci.ics.asterix.common.config.AsterixExternalProperties;
import edu.uci.ics.asterix.common.config.AsterixMetadataProperties;
<<<<<<<
appCtx.setThreadFactory(AsterixThreadFactory.INSTANCE);
=======
AsterixAppContextInfo.initialize(appCtx);
>>>>>>>
appCtx.setThreadFactory(AsterixThreadFactory.INSTANCE);
AsterixAppContextInfo.initialize(appCtx); |
<<<<<<<
import edu.uci.ics.asterix.common.config.GlobalConfig;
import edu.uci.ics.asterix.common.dataflow.IStorageContext;
=======
import edu.uci.ics.asterix.common.api.AsterixAppContextInfo;
import edu.uci.ics.asterix.common.config.AsterixStorageProperties;
import edu.uci.ics.asterix.common.context.AsterixRuntimeComponentsProvider;
import edu.uci.ics.asterix.common.dataflow.IAsterixApplicationContextInfo;
>>>>>>>
import edu.uci.ics.asterix.common.api.AsterixAppContextInfo;
import edu.uci.ics.asterix.common.config.AsterixStorageProperties;
import edu.uci.ics.asterix.common.dataflow.IStorageContext; |
<<<<<<<
import edu.uci.ics.asterix.transaction.management.service.transaction.JobIdFactory;
import edu.uci.ics.asterix.translator.DmlTranslator.CompiledLoadFromFileStatement;
=======
import edu.uci.ics.asterix.translator.CompiledStatements.CompiledDatasetDropStatement;
import edu.uci.ics.asterix.translator.CompiledStatements.CompiledLoadFromFileStatement;
>>>>>>>
import edu.uci.ics.asterix.transaction.management.service.transaction.JobIdFactory;
import edu.uci.ics.asterix.translator.CompiledStatements.CompiledDatasetDropStatement;
import edu.uci.ics.asterix.translator.CompiledStatements.CompiledLoadFromFileStatement;
<<<<<<<
Dataset dataset = metadata.findDataset(datasetName);
=======
IIndexRegistryProvider<IIndex> indexRegistryProvider = AsterixIndexRegistryProvider.INSTANCE;
IStorageManagerInterface storageManager = AsterixStorageManagerInterface.INSTANCE;
Dataset dataset = metadataProvider.findDataset(dataverseName, datasetName);
>>>>>>>
Dataset dataset = metadataProvider.findDataset(dataverseName, datasetName);
<<<<<<<
Pair<IFileSplitProvider, AlgebricksPartitionConstraint> idxSplitsAndConstraint = metadata
.splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName,
index.getIndexName());
IIndexDataflowHelperFactory dfhFactory;
switch (index.getIndexType()) {
case BTREE:
dfhFactory = new LSMBTreeDataflowHelperFactory(AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER);
break;
case RTREE:
dfhFactory = new LSMRTreeDataflowHelperFactory(
new IPrimitiveValueProviderFactory[] { null }, RTreePolicyType.RTREE,
new IBinaryComparatorFactory[] { null }, AsterixRuntimeComponentsProvider.LSMRTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMRTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMRTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMRTREE_PROVIDER, null);
break;
case NGRAM_INVIX:
case WORD_INVIX:
dfhFactory = new LSMInvertedIndexDataflowHelperFactory(
AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER,
AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER,
AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER,
AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER);
break;
default:
throw new AsterixException("Unknown index type provided.");
}
IndexDropOperatorDescriptor secondaryBtreeDrop = new IndexDropOperatorDescriptor(specs[i],
AsterixRuntimeComponentsProvider.NOINDEX_PROVIDER, AsterixRuntimeComponentsProvider.NOINDEX_PROVIDER,
idxSplitsAndConstraint.first, dfhFactory);
=======
Pair<IFileSplitProvider, AlgebricksPartitionConstraint> idxSplitsAndConstraint = metadataProvider
.splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataset.getDataverseName(),
datasetName, index.getIndexName());
TreeIndexDropOperatorDescriptor secondaryBtreeDrop = new TreeIndexDropOperatorDescriptor(specs[i],
storageManager, indexRegistryProvider, idxSplitsAndConstraint.first);
>>>>>>>
Pair<IFileSplitProvider, AlgebricksPartitionConstraint> idxSplitsAndConstraint = metadataProvider
.splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataset.getDataverseName(),
datasetName, index.getIndexName());
IIndexDataflowHelperFactory dfhFactory;
switch (index.getIndexType()) {
case BTREE:
dfhFactory = new LSMBTreeDataflowHelperFactory(AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER);
break;
case RTREE:
dfhFactory = new LSMRTreeDataflowHelperFactory(
new IPrimitiveValueProviderFactory[] { null }, RTreePolicyType.RTREE,
new IBinaryComparatorFactory[] { null }, AsterixRuntimeComponentsProvider.LSMRTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMRTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMRTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMRTREE_PROVIDER, null);
break;
case NGRAM_INVIX:
case WORD_INVIX:
dfhFactory = new LSMInvertedIndexDataflowHelperFactory(
AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER,
AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER,
AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER,
AsterixRuntimeComponentsProvider.LSMINVERTEDINDEX_PROVIDER);
break;
default:
throw new AsterixException("Unknown index type provided.");
}
IndexDropOperatorDescriptor secondaryBtreeDrop = new IndexDropOperatorDescriptor(specs[i],
AsterixRuntimeComponentsProvider.NOINDEX_PROVIDER, AsterixRuntimeComponentsProvider.NOINDEX_PROVIDER,
idxSplitsAndConstraint.first, dfhFactory);
<<<<<<<
Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadata
.splitProviderAndPartitionConstraintsForInternalOrFeedDataset(datasetName, datasetName);
IndexDropOperatorDescriptor primaryBtreeDrop = new IndexDropOperatorDescriptor(specPrimary,
AsterixRuntimeComponentsProvider.NOINDEX_PROVIDER, AsterixRuntimeComponentsProvider.NOINDEX_PROVIDER,
splitsAndConstraint.first, new LSMBTreeDataflowHelperFactory(AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER, AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER));
=======
Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadataProvider
.splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataset.getDataverseName(), datasetName,
datasetName);
TreeIndexDropOperatorDescriptor primaryBtreeDrop = new TreeIndexDropOperatorDescriptor(specPrimary,
storageManager, indexRegistryProvider, splitsAndConstraint.first);
>>>>>>>
Pair<IFileSplitProvider, AlgebricksPartitionConstraint> splitsAndConstraint = metadataProvider
.splitProviderAndPartitionConstraintsForInternalOrFeedDataset(dataset.getDataverseName(), datasetName,
datasetName);
IndexDropOperatorDescriptor primaryBtreeDrop = new IndexDropOperatorDescriptor(specPrimary,
AsterixRuntimeComponentsProvider.NOINDEX_PROVIDER, AsterixRuntimeComponentsProvider.NOINDEX_PROVIDER,
splitsAndConstraint.first, new LSMBTreeDataflowHelperFactory(AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER, AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER,
AsterixRuntimeComponentsProvider.LSMBTREE_PROVIDER));
<<<<<<<
edu.uci.ics.asterix.transaction.management.service.transaction.JobId asterixJobId = JobIdFactory
.generateJobId();
ARecordType itemType = (ARecordType) metadata.findType(dataset.getItemTypeName());
IDataFormat format = metadata.getFormat();
=======
ARecordType itemType = (ARecordType) MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataverseName,
dataset.getItemTypeName()).getDatatype();
>>>>>>>
edu.uci.ics.asterix.transaction.management.service.transaction.JobId asterixJobId = JobIdFactory
.generateJobId();
ARecordType itemType = (ARecordType) MetadataManager.INSTANCE.getDatatype(mdTxnCtx, dataverseName,
dataset.getItemTypeName()).getDatatype(); |
<<<<<<<
/**
* @param jobId
* A globally unique id for an active metadata transaction.
* @param feedId
* A unique id for the feed
* @param feedActivity
*/
public void registerFeedActivity(JobId jobId, FeedId feedId, FeedActivity feedActivity) throws MetadataException,
RemoteException;
/**
* @param jobId
* @param feedPolicy
* @throws MetadataException
* @throws RemoteException
*/
public void addFeedPolicy(JobId jobId, FeedPolicy feedPolicy) throws MetadataException, RemoteException;
/**
* @param jobId
* @param dataverse
* @param policy
* @return
* @throws MetadataException
* @throws RemoteException
*/
public FeedPolicy getFeedPolicy(JobId jobId, String dataverse, String policy) throws MetadataException,
RemoteException;
/**
* @param jobId
* @return
* @throws MetadataException
* @throws RemoteException
*/
public List<FeedActivity> getActiveFeeds(JobId jobId) throws MetadataException, RemoteException;
=======
/**
* Removes a library , acquiring local locks on behalf of the given
* transaction id.
*
* @param txnId
* A globally unique id for an active metadata transaction.
* @param dataverseName
* dataverse asociated with the adapter that is to be deleted.
* @param libraryName
* Name of library to be deleted. MetadataException for example,
* if the library does not exists.
* @throws RemoteException
*/
public void dropLibrary(JobId jobId, String dataverseName, String libraryName) throws MetadataException,
RemoteException;
/**
* Adds a library, acquiring local locks on behalf of the given
* transaction id.
*
* @param txnId
* A globally unique id for an active metadata transaction.
* @param library
* Library to be added
* @throws MetadataException
* for example, if the library is already added.
* @throws RemoteException
*/
public void addLibrary(JobId jobId, Library library) throws MetadataException, RemoteException;
/**
* @param txnId
* A globally unique id for an active metadata transaction.
* @param dataverseName
* dataverse asociated with the library that is to be retrieved.
* @param libraryName
* name of the library that is to be retrieved
* @return Library
* @throws MetadataException
* @throws RemoteException
*/
public Library getLibrary(JobId jobId, String dataverseName, String libraryName) throws MetadataException,
RemoteException;
/**
* Retireve libraries installed in a given dataverse.
*
* @param txnId
* A globally unique id for an active metadata transaction.
* @param dataverseName
* dataverse asociated with the library that is to be retrieved.
* @return Library
* @throws MetadataException
* @throws RemoteException
*/
public List<Library> getDataverseLibraries(JobId jobId, String dataverseName) throws MetadataException,
RemoteException;
>>>>>>>
/**
* @param jobId
* A globally unique id for an active metadata transaction.
* @param feedId
* A unique id for the feed
* @param feedActivity
*/
public void registerFeedActivity(JobId jobId, FeedId feedId, FeedActivity feedActivity) throws MetadataException,
RemoteException;
/**
* @param jobId
* @param feedPolicy
* @throws MetadataException
* @throws RemoteException
*/
public void addFeedPolicy(JobId jobId, FeedPolicy feedPolicy) throws MetadataException, RemoteException;
/**
* @param jobId
* @param dataverse
* @param policy
* @return
* @throws MetadataException
* @throws RemoteException
*/
public FeedPolicy getFeedPolicy(JobId jobId, String dataverse, String policy) throws MetadataException,
RemoteException;
/**
* @param jobId
* @return
* @throws MetadataException
* @throws RemoteException
*/
public List<FeedActivity> getActiveFeeds(JobId jobId) throws MetadataException, RemoteException;
/**
* Removes a library , acquiring local locks on behalf of the given
* transaction id.
*
* @param txnId
* A globally unique id for an active metadata transaction.
* @param dataverseName
* dataverse asociated with the adapter that is to be deleted.
* @param libraryName
* Name of library to be deleted. MetadataException for example,
* if the library does not exists.
* @throws RemoteException
*/
public void dropLibrary(JobId jobId, String dataverseName, String libraryName) throws MetadataException,
RemoteException;
/**
* Adds a library, acquiring local locks on behalf of the given
* transaction id.
*
* @param txnId
* A globally unique id for an active metadata transaction.
* @param library
* Library to be added
* @throws MetadataException
* for example, if the library is already added.
* @throws RemoteException
*/
public void addLibrary(JobId jobId, Library library) throws MetadataException, RemoteException;
/**
* @param txnId
* A globally unique id for an active metadata transaction.
* @param dataverseName
* dataverse asociated with the library that is to be retrieved.
* @param libraryName
* name of the library that is to be retrieved
* @return Library
* @throws MetadataException
* @throws RemoteException
*/
public Library getLibrary(JobId jobId, String dataverseName, String libraryName) throws MetadataException,
RemoteException;
/**
* Retireve libraries installed in a given dataverse.
*
* @param txnId
* A globally unique id for an active metadata transaction.
* @param dataverseName
* dataverse asociated with the library that is to be retrieved.
* @return Library
* @throws MetadataException
* @throws RemoteException
*/
public List<Library> getDataverseLibraries(JobId jobId, String dataverseName) throws MetadataException,
RemoteException; |
<<<<<<<
import edu.uci.ics.asterix.runtime.evaluators.functions.SubstringDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.SwitchCaseDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.UnorderedListConstructorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.WordTokensDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericAbsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericCeilingDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericFloorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericRoundDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericRoundHalfToEvenDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.NumericRoundHalfToEven2Descriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.StringEqualDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.StringStartWithDescrtiptor;
=======
import edu.uci.ics.asterix.runtime.evaluators.functions.StringConcatDescriptor;
>>>>>>>
import edu.uci.ics.asterix.runtime.evaluators.functions.SubstringDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.SwitchCaseDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.UnorderedListConstructorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.WordTokensDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.StringConcatDescriptor;
<<<<<<<
import edu.uci.ics.asterix.runtime.evaluators.functions.StringToCodePointDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.CodePointToStringDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.StringConcatDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.StringJoinDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AddDateDurationDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AddDatetimeDurationDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AddTimeDurationDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AdjustDateTimeForTimeZoneDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AdjustTimeForTimeZoneDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.CalendarDuartionFromDateDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.CalendarDurationFromDateTimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.CurrentDateDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.CurrentDateTimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.CurrentTimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.DateFromDatetimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.DateFromUnixTimeInDaysDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.DatetimeFromDateAndTimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.DatetimeFromUnixTimeInMsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalAfterDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalBeforeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalCoveredByDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalCoversDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalEndedByDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalEndsDecriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalMeetsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalMetByDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.OverlapDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalOverlappedByDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalOverlapsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalStartedByDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalStartsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.SubtractDateDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.SubtractDatetimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.SubtractTimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.TimeFromDatetimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.TimeFromUnixTimeInMsDescriptor;
=======
import edu.uci.ics.asterix.runtime.evaluators.functions.SubstringBeforeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.SubstringDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.SwitchCaseDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.UnorderedListConstructorDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.WordTokensDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.YearDescriptor;
>>>>>>>
import edu.uci.ics.asterix.runtime.evaluators.functions.SubstringBeforeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AddDateDurationDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AddDatetimeDurationDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AddTimeDurationDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AdjustDateTimeForTimeZoneDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.AdjustTimeForTimeZoneDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.CalendarDuartionFromDateDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.CalendarDurationFromDateTimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.CurrentDateDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.CurrentDateTimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.CurrentTimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.DateFromDatetimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.DateFromUnixTimeInDaysDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.DatetimeFromDateAndTimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.DatetimeFromUnixTimeInMsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalAfterDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalBeforeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalCoveredByDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalCoversDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalEndedByDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalEndsDecriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalMeetsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalMetByDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.OverlapDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalOverlappedByDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalOverlapsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalStartedByDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.IntervalStartsDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.SubtractDateDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.SubtractDatetimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.SubtractTimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.TimeFromDatetimeDescriptor;
import edu.uci.ics.asterix.runtime.evaluators.functions.temporal.TimeFromUnixTimeInMsDescriptor; |
<<<<<<<
private static final int DATATYPE_PAYLOAD_TUPLE_FIELD_INDEX = 2;
=======
public static final int DATATYPE_PAYLOAD_TUPLE_FIELD_INDEX = 2;
public enum DerivedTypeTag {
RECORD,
UNORDEREDLIST,
ORDEREDLIST
}
@SuppressWarnings("unchecked")
private ISerializerDeserializer<ARecord> recordSerDes =
SerializerDeserializerProvider.INSTANCE.getSerializerDeserializer(MetadataRecordTypes.DATATYPE_RECORDTYPE);
private final MetadataNode metadataNode;
private final TxnId txnId;
protected final transient ArrayBackedValueStorage fieldName = new ArrayBackedValueStorage();
>>>>>>>
private static final int DATATYPE_PAYLOAD_TUPLE_FIELD_INDEX = 2;
<<<<<<<
.getValueByPos(MetadataRecordTypes.FIELD_ARECORD_ISNULLABLE_FIELD_INDEX)).getBoolean();
fieldTypes[fieldId] = BuiltinTypeMap.getTypeFromTypeName(metadataNode, txnId, dataverseName,
fieldTypeName, isNullable);
=======
.getValueByPos(MetadataRecordTypes.FIELD_ARECORD_ISNULLABLE_FIELD_INDEX)).getBoolean();
int isMissableIdx = field.getType().getFieldIndex(MetadataRecordTypes.FIELD_NAME_IS_MISSABLE);
boolean isMissable;
if (isMissableIdx >= 0) {
isMissable = ((ABoolean) field.getValueByPos(isMissableIdx)).getBoolean();
} else {
// back-compat
// we previously stored 'isNullable' = true if type was 'unknowable',
// or 'isNullable' = 'false' if the type was 'not unknowable'.
isMissable = isNullable;
}
IAType fieldType =
BuiltinTypeMap.getTypeFromTypeName(metadataNode, txnId, dataverseName, fieldTypeName);
fieldTypes[fieldId] = TypeUtil.createQuantifiedType(fieldType, isNullable, isMissable);
>>>>>>>
.getValueByPos(MetadataRecordTypes.FIELD_ARECORD_ISNULLABLE_FIELD_INDEX)).getBoolean();
int isMissableIdx = field.getType().getFieldIndex(MetadataRecordTypes.FIELD_NAME_IS_MISSABLE);
boolean isMissable;
if (isMissableIdx >= 0) {
isMissable = ((ABoolean) field.getValueByPos(isMissableIdx)).getBoolean();
} else {
// back-compat
// we previously stored 'isNullable' = true if type was 'unknowable',
// or 'isNullable' = 'false' if the type was 'not unknowable'.
isMissable = isNullable;
}
IAType fieldType =
BuiltinTypeMap.getTypeFromTypeName(metadataNode, txnId, dataverseName, fieldTypeName);
fieldTypes[fieldId] = TypeUtil.createQuantifiedType(fieldType, isNullable, isMissable);
<<<<<<<
=======
private void writeDerivedTypeRecord(Datatype type, AbstractComplexType derivedDatatype, DataOutput out)
throws HyracksDataException {
DerivedTypeTag tag;
IARecordBuilder derivedRecordBuilder = new RecordBuilder();
ArrayBackedValueStorage fieldValue = new ArrayBackedValueStorage();
switch (derivedDatatype.getTypeTag()) {
case ARRAY:
tag = DerivedTypeTag.ORDEREDLIST;
break;
case MULTISET:
tag = DerivedTypeTag.UNORDEREDLIST;
break;
case OBJECT:
tag = DerivedTypeTag.RECORD;
break;
default:
throw new UnsupportedOperationException(
"No metadata record Type for " + derivedDatatype.getDisplayName());
}
derivedRecordBuilder.reset(MetadataRecordTypes.DERIVEDTYPE_RECORDTYPE);
// write field 0
fieldValue.reset();
aString.setValue(tag.toString());
stringSerde.serialize(aString, fieldValue.getDataOutput());
derivedRecordBuilder.addField(MetadataRecordTypes.DERIVEDTYPE_ARECORD_TAG_FIELD_INDEX, fieldValue);
// write field 1
fieldValue.reset();
booleanSerde.serialize(ABoolean.valueOf(type.getIsAnonymous()), fieldValue.getDataOutput());
derivedRecordBuilder.addField(MetadataRecordTypes.DERIVEDTYPE_ARECORD_ISANONYMOUS_FIELD_INDEX, fieldValue);
switch (tag) {
case RECORD:
fieldValue.reset();
writeRecordType(type, derivedDatatype, fieldValue.getDataOutput());
derivedRecordBuilder.addField(MetadataRecordTypes.DERIVEDTYPE_ARECORD_RECORD_FIELD_INDEX, fieldValue);
break;
case UNORDEREDLIST:
fieldValue.reset();
writeCollectionType(type, derivedDatatype, fieldValue.getDataOutput());
derivedRecordBuilder.addField(MetadataRecordTypes.DERIVEDTYPE_ARECORD_UNORDEREDLIST_FIELD_INDEX,
fieldValue);
break;
case ORDEREDLIST:
fieldValue.reset();
writeCollectionType(type, derivedDatatype, fieldValue.getDataOutput());
derivedRecordBuilder.addField(MetadataRecordTypes.DERIVEDTYPE_ARECORD_ORDEREDLIST_FIELD_INDEX,
fieldValue);
break;
}
derivedRecordBuilder.write(out, true);
}
private void writeCollectionType(Datatype instance, AbstractComplexType type, DataOutput out)
throws HyracksDataException {
AbstractCollectionType listType = (AbstractCollectionType) type;
IAType itemType = listType.getItemType();
if (itemType.getTypeTag().isDerivedType()) {
handleNestedDerivedType(itemType.getTypeName(), (AbstractComplexType) itemType, instance,
instance.getDataverseName(), instance.getDatatypeName());
}
aString.setValue(listType.getItemType().getTypeName());
stringSerde.serialize(aString, out);
}
private void writeRecordType(Datatype instance, AbstractComplexType type, DataOutput out)
throws HyracksDataException {
ArrayBackedValueStorage fieldValue = new ArrayBackedValueStorage();
ArrayBackedValueStorage itemValue = new ArrayBackedValueStorage();
IARecordBuilder recordRecordBuilder = new RecordBuilder();
IARecordBuilder fieldRecordBuilder = new RecordBuilder();
ARecordType recType = (ARecordType) type;
OrderedListBuilder listBuilder = new OrderedListBuilder();
listBuilder.reset(new AOrderedListType(MetadataRecordTypes.FIELD_RECORDTYPE, null));
IAType fieldType;
for (int i = 0; i < recType.getFieldNames().length; i++) {
fieldType = recType.getFieldTypes()[i];
boolean fieldIsNullable = false;
boolean fieldIsMissable = false;
if (fieldType.getTypeTag() == ATypeTag.UNION) {
AUnionType fieldUnionType = (AUnionType) fieldType;
fieldIsNullable = fieldUnionType.isNullableType();
fieldIsMissable = fieldUnionType.isMissableType();
fieldType = fieldUnionType.getActualType();
}
if (fieldType.getTypeTag().isDerivedType()) {
handleNestedDerivedType(fieldType.getTypeName(), (AbstractComplexType) fieldType, instance,
instance.getDataverseName(), instance.getDatatypeName());
}
itemValue.reset();
fieldRecordBuilder.reset(MetadataRecordTypes.FIELD_RECORDTYPE);
// write field 0
fieldValue.reset();
aString.setValue(recType.getFieldNames()[i]);
stringSerde.serialize(aString, fieldValue.getDataOutput());
fieldRecordBuilder.addField(MetadataRecordTypes.FIELD_ARECORD_FIELDNAME_FIELD_INDEX, fieldValue);
// write field 1
fieldValue.reset();
aString.setValue(fieldType.getTypeName());
stringSerde.serialize(aString, fieldValue.getDataOutput());
fieldRecordBuilder.addField(MetadataRecordTypes.FIELD_ARECORD_FIELDTYPE_FIELD_INDEX, fieldValue);
// write field 2
fieldValue.reset();
booleanSerde.serialize(fieldIsNullable ? ABoolean.TRUE : ABoolean.FALSE, fieldValue.getDataOutput());
fieldRecordBuilder.addField(MetadataRecordTypes.FIELD_ARECORD_ISNULLABLE_FIELD_INDEX, fieldValue);
// write open fields
fieldName.reset();
aString.setValue(MetadataRecordTypes.FIELD_NAME_IS_MISSABLE);
stringSerde.serialize(aString, fieldName.getDataOutput());
fieldValue.reset();
booleanSerde.serialize(ABoolean.valueOf(fieldIsMissable), fieldValue.getDataOutput());
fieldRecordBuilder.addField(fieldName, fieldValue);
// write record
fieldRecordBuilder.write(itemValue.getDataOutput(), true);
// add item to the list of fields
listBuilder.addItem(itemValue);
}
recordRecordBuilder.reset(MetadataRecordTypes.RECORD_RECORDTYPE);
// write field 0
fieldValue.reset();
booleanSerde.serialize(recType.isOpen() ? ABoolean.TRUE : ABoolean.FALSE, fieldValue.getDataOutput());
recordRecordBuilder.addField(MetadataRecordTypes.RECORDTYPE_ARECORD_ISOPEN_FIELD_INDEX, fieldValue);
// write field 1
fieldValue.reset();
listBuilder.write(fieldValue.getDataOutput(), true);
recordRecordBuilder.addField(MetadataRecordTypes.RECORDTYPE_ARECORD_FIELDS_FIELD_INDEX, fieldValue);
// write record
recordRecordBuilder.write(out, true);
}
private String handleNestedDerivedType(String typeName, AbstractComplexType nestedType, Datatype topLevelType,
String dataverseName, String datatypeName) throws HyracksDataException {
try {
metadataNode.addDatatype(txnId, new Datatype(dataverseName, typeName, nestedType, true));
} catch (AlgebricksException e) {
// The nested record type may have been inserted by a previous DDL statement or
// by
// a previous nested type.
if (!(e.getCause() instanceof HyracksDataException)) {
throw HyracksDataException.create(e);
} else {
HyracksDataException hde = (HyracksDataException) e.getCause();
if (!hde.getComponent().equals(ErrorCode.HYRACKS) || hde.getErrorCode() != ErrorCode.DUPLICATE_KEY) {
throw hde;
}
}
} catch (RemoteException e) {
// TODO: This should not be a HyracksDataException. Can't
// fix this currently because of BTree exception model whose
// fixes must get in.
throw HyracksDataException.create(e);
}
return typeName;
}
>>>>>>> |
<<<<<<<
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
=======
import edu.uci.ics.hyracks.api.lifecycle.ILifeCycleComponent;
>>>>>>>
import edu.uci.ics.hyracks.api.exceptions.HyracksDataException;
import edu.uci.ics.hyracks.api.lifecycle.ILifeCycleComponent;
<<<<<<<
boolean countIsZero = transactionProvider.getLockManager().unlock(datasetId, PKHashVal, txnContext, true);
if (!countIsZero) {
// Lock count != 0 for a particular entity implies that the entity has been locked
// more than once (probably due to a hash collision in our current model).
// It is safe to decrease the active transaction count on indexes since,
// by virtue of the counter not being zero, there is another transaction
// that has increased the transaction count. Thus, decreasing it will not
// allow the data to be flushed (yet). The flush will occur when the log page
// flush thread decides to decrease the count for the last time.
try {
//decrease the transaction reference count on index
txnContext.decreaseActiveTransactionCountOnIndexes();
} catch (HyracksDataException e) {
throw new ACIDException("failed to complete index operation", e);
}
}
=======
transactionProvider.getLockManager().unlock(datasetId, PKHashVal, txnContext, true);
/*****************************
* try {
* //decrease the transaction reference count on index
* txnContext.decreaseActiveTransactionCountOnIndexes();
* } catch (HyracksDataException e) {
* throw new ACIDException("failed to complete index operation", e);
* }
*****************************/
>>>>>>>
boolean countIsZero = transactionProvider.getLockManager().unlock(datasetId, PKHashVal, txnContext,
true);
if (!countIsZero) {
// Lock count != 0 for a particular entity implies that the entity has been locked
// more than once (probably due to a hash collision in our current model).
// It is safe to decrease the active transaction count on indexes since,
// by virtue of the counter not being zero, there is another transaction
// that has increased the transaction count. Thus, decreasing it will not
// allow the data to be flushed (yet). The flush will occur when the log page
// flush thread decides to decrease the count for the last time.
try {
//decrease the transaction reference count on index
txnContext.decreaseActiveTransactionCountOnIndexes();
} catch (HyracksDataException e) {
throw new ACIDException("failed to complete index operation", e);
}
} |
<<<<<<<
import android.view.Menu;
import android.view.MenuInflater;
=======
import android.support.v4.app.NavUtils;
>>>>>>>
import android.view.Menu;
import android.view.MenuInflater;
<<<<<<<
=======
initUI();
qbUser = App.getInstance().getUser();
imageHelper = new ImageHelper(this);
useDoubleBackPressed = true;
initUsersData();
>>>>>>>
initUI();
qbUser = App.getInstance().getUser();
imageHelper = new ImageHelper(this);
useDoubleBackPressed = true;
initUsersData(); |
<<<<<<<
=======
import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
import edu.uci.ics.hyracks.storage.am.common.api.IInMemoryFreePageManager;
import edu.uci.ics.hyracks.storage.am.common.api.ITreeIndexMetaDataFrameFactory;
import edu.uci.ics.hyracks.storage.am.common.frames.LIFOMetaDataFrameFactory;
>>>>>>>
import edu.uci.ics.hyracks.dataflow.std.file.FileSplit;
<<<<<<<
IVirtualBufferCache virtualBufferCache = runtimeContextProvider.getVirtualBufferCache(datasetID);
LSMBTree lsmBTree = LSMBTreeUtils.createLSMTree(virtualBufferCache, runtimeContextProvider.getIOManager(),
file, runtimeContextProvider.getBufferCache(), runtimeContextProvider.getFileMapManager(), typeTraits,
cmpFactories, bloomFilterKeyFields, runtimeContextProvider.getBloomFilterFalsePositiveRate(),
runtimeContextProvider.getLSMMergePolicy(),
runtimeContextProvider.getLSMBTreeOperationTrackerFactory(),
runtimeContextProvider.getLSMIOScheduler(),
runtimeContextProvider.getLSMBTreeIOOperationCallbackProvider(), partition);
=======
IInMemoryBufferCache memBufferCache = new InMemoryBufferCache(new HeapBufferAllocator(), memPageSize,
memNumPages, new TransientFileMapManager());
ITreeIndexMetaDataFrameFactory metaDataFrameFactory = new LIFOMetaDataFrameFactory();
IInMemoryFreePageManager memFreePageManager = new InMemoryFreePageManager(memNumPages, metaDataFrameFactory);
LSMBTree lsmBTree = LSMBTreeUtils.createLSMTree(memBufferCache, memFreePageManager, runtimeContextProvider
.getIOManager(), file, runtimeContextProvider.getBufferCache(), runtimeContextProvider
.getFileMapManager(), typeTraits, cmpFactories, bloomFilterKeyFields, runtimeContextProvider
.getBloomFilterFalsePositiveRate(), runtimeContextProvider.getLSMMergePolicy(), runtimeContextProvider
.getLSMBTreeOperationTrackerFactory(), runtimeContextProvider.getLSMIOScheduler(),
runtimeContextProvider.getLSMBTreeIOOperationCallbackProvider(), fileSplits == null ? ioDeviceID
: fileSplits[partition].getIODeviceId());
>>>>>>>
IVirtualBufferCache virtualBufferCache = runtimeContextProvider.getVirtualBufferCache(datasetID);
LSMBTree lsmBTree = LSMBTreeUtils.createLSMTree(virtualBufferCache, runtimeContextProvider.getIOManager(),
file, runtimeContextProvider.getBufferCache(), runtimeContextProvider.getFileMapManager(), typeTraits,
cmpFactories, bloomFilterKeyFields, runtimeContextProvider.getBloomFilterFalsePositiveRate(),
runtimeContextProvider.getLSMMergePolicy(),
runtimeContextProvider.getLSMBTreeOperationTrackerFactory(),
runtimeContextProvider.getLSMIOScheduler(), runtimeContextProvider
.getLSMBTreeIOOperationCallbackProvider(), fileSplits == null ? ioDeviceID
: fileSplits[partition].getIODeviceId()); |
<<<<<<<
import static org.mockito.Matchers.any;
=======
import static org.apache.hyracks.util.file.FileUtil.canonicalize;
>>>>>>>
import static org.apache.hyracks.util.file.FileUtil.canonicalize;
import static org.mockito.Matchers.any; |
<<<<<<<
import org.apache.asterix.common.metadata.DataverseName;
=======
import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.exceptions.ErrorCode;
>>>>>>>
import org.apache.asterix.common.exceptions.AsterixException;
import org.apache.asterix.common.exceptions.ErrorCode;
import org.apache.asterix.common.metadata.DataverseName;
<<<<<<<
if (dataverseName == null || typeName == null) {
=======
Datatype type = findTypeEntity(mdTxnCtx, dataverse, typeName);
return type != null ? type.getDatatype() : null;
}
public static Datatype findTypeEntity(MetadataTransactionContext mdTxnCtx, String dataverse, String typeName)
throws AlgebricksException {
if (dataverse == null || typeName == null) {
>>>>>>>
Datatype type = findTypeEntity(mdTxnCtx, dataverseName, typeName);
return type != null ? type.getDatatype() : null;
}
public static Datatype findTypeEntity(MetadataTransactionContext mdTxnCtx, DataverseName dataverseName,
String typeName) throws AlgebricksException {
if (dataverseName == null || typeName == null) {
<<<<<<<
throw new AlgebricksException("Type name '" + typeName + "' unknown in dataverse '" + dataverseName + "'");
=======
throw new AsterixException(ErrorCode.UNKNOWN_TYPE, dataverse + "." + typeName);
>>>>>>>
throw new AsterixException(ErrorCode.UNKNOWN_TYPE, dataverseName + "." + typeName); |
<<<<<<<
=======
>>>>>>> |
<<<<<<<
ILSMMergePolicyFactory mergePolicyFactory, Map<String, String> mergePolicyProperties,
ILSMOperationTrackerProvider opTrackerProvider, ILSMIOOperationSchedulerProvider ioSchedulerProvider,
ILSMIOOperationCallbackProvider ioOpCallbackProvider, double bloomFilterFalsePositiveRate) {
super(virtualBufferCacheProvider, mergePolicyFactory, mergePolicyProperties, opTrackerProvider,
ioSchedulerProvider, ioOpCallbackProvider, bloomFilterFalsePositiveRate);
=======
ILSMMergePolicyProvider mergePolicyProvider, ILSMOperationTrackerProvider opTrackerProvider,
ILSMIOOperationSchedulerProvider ioSchedulerProvider, ILSMIOOperationCallbackFactory ioOpCallbackFactory,
double bloomFilterFalsePositiveRate) {
super(virtualBufferCacheProvider, mergePolicyProvider, opTrackerProvider, ioSchedulerProvider,
ioOpCallbackFactory, bloomFilterFalsePositiveRate);
>>>>>>>
ILSMMergePolicyFactory mergePolicyFactory, Map<String, String> mergePolicyProperties,
ILSMOperationTrackerProvider opTrackerProvider, ILSMIOOperationSchedulerProvider ioSchedulerProvider,
ILSMIOOperationCallbackFactory ioOpCallbackFactory, double bloomFilterFalsePositiveRate) {
super(virtualBufferCacheProvider, mergePolicyFactory, mergePolicyProperties, opTrackerProvider,
ioSchedulerProvider, ioOpCallbackFactory, bloomFilterFalsePositiveRate);
<<<<<<<
mergePolicyFactory.createMergePolicy(mergePolicyProperties), opTrackerFactory,
ioSchedulerProvider.getIOScheduler(ctx), ioOpCallbackProvider);
=======
mergePolicyProvider.getMergePolicy(ctx), opTrackerFactory, ioSchedulerProvider.getIOScheduler(ctx),
ioOpCallbackFactory);
>>>>>>>
mergePolicyFactory.createMergePolicy(mergePolicyProperties), opTrackerFactory,
ioSchedulerProvider.getIOScheduler(ctx), ioOpCallbackFactory); |
<<<<<<<
String dataverseName = cfs.getDataverseName() == null ? activeDefaultDataverse == null ? null
: activeDefaultDataverse.getDataverseName() : cfs.getDatasetName().getValue();
String datasetName = cfs.getDatasetName().getValue();
Dataset dataset = MetadataManager.INSTANCE.getDataset(metadataProvider.getMetadataTxnContext(),
dataverseName, cfs.getDatasetName().getValue());
if (dataset == null) {
throw new AsterixException("Unknown dataset :" + cfs.getDatasetName().getValue() + " in dataverse "
+ dataverseName);
}
if (!dataset.getDatasetType().equals(DatasetType.FEED)) {
throw new AsterixException("Statement not applicable. Dataset " + cfs.getDatasetName().getValue()
+ " is not a " + DatasetType.FEED);
}
FeedActivity feedActivity = MetadataManager.INSTANCE.getRecentFeedActivity(mdTxnCtx, dataverseName,
datasetName);
if (feedActivity == null || !FeedActivityType.FEED_BEGIN.equals(feedActivity.getFeedActivityType())) {
throw new AsterixException("Invalid operation. The feed is currently not " + FeedState.ACTIVE);
}
=======
String dataverseName = getActiveDataverseName(cfs.getDataverseName());
>>>>>>>
String dataverseName = getActiveDataverseName(cfs.getDataverseName());
String datasetName = cfs.getDatasetName().getValue();
Dataset dataset = MetadataManager.INSTANCE.getDataset(metadataProvider.getMetadataTxnContext(),
dataverseName, cfs.getDatasetName().getValue());
if (dataset == null) {
throw new AsterixException("Unknown dataset :" + cfs.getDatasetName().getValue() + " in dataverse "
+ dataverseName);
}
if (!dataset.getDatasetType().equals(DatasetType.FEED)) {
throw new AsterixException("Statement not applicable. Dataset " + cfs.getDatasetName().getValue()
+ " is not a " + DatasetType.FEED);
}
FeedActivity feedActivity = MetadataManager.INSTANCE.getRecentFeedActivity(mdTxnCtx, dataverseName,
datasetName);
if (feedActivity == null || !FeedActivityType.FEED_BEGIN.equals(feedActivity.getFeedActivityType())) {
throw new AsterixException("Invalid operation. The feed is currently not " + FeedState.ACTIVE);
} |
<<<<<<<
protected BaseRecyclerViewAdapter messagesAdapter;
protected User opponentUser;
protected QBChatHelper chatHelper;
=======
protected BaseChatMessagesAdapter messagesAdapter;
protected QMUser opponentUser;
protected QBBaseChatHelper baseChatHelper;
>>>>>>>
protected BaseChatMessagesAdapter messagesAdapter;
protected QMUser opponentUser;
protected QBChatHelper baseChatHelper;
<<<<<<<
chatHelper.sendTypingStatusToServer(dialog.getDialogId(), isTypingNow);
=======
baseChatHelper.sendTypingStatusToServer(opponentUser.getId(), isTypingNow);
>>>>>>>
chatHelper.sendTypingStatusToServer(dialog.getDialogId(), isTypingNow);
<<<<<<<
chatHelper.sendChatMessage(messageEditText.getText().toString(), ChatUtils.createQBDialogFromLocalDialog(dataManager, dialog));
=======
if (privateMessage) {
((QBPrivateChatHelper) baseChatHelper).sendPrivateMessage(
messageEditText.getText().toString(), opponentUser.getId());
} else {
((QBGroupChatHelper) baseChatHelper).sendGroupMessage(dialog.getRoomJid(),
messageEditText.getText().toString());
}
>>>>>>>
chatHelper.sendChatMessage(messageEditText.getText().toString(), ChatUtils.createQBDialogFromLocalDialog(dataManager, dialog)); |
<<<<<<<
private static final String EXTERNAL_FEEDSERVER_KEY = "feed.port";
private static int EXTERNAL_FEEDSERVER_DEFAULT = 19003;
private static final String EXTERNAL_CC_JAVA_OPTS_KEY = "cc.java.opts";
private static String EXTERNAL_CC_JAVA_OPTS_DEFAULT = "-Xmx1024m";
private static final String EXTERNAL_NC_JAVA_OPTS_KEY = "nc.java.opts";
private static String EXTERNAL_NC_JAVA_OPTS_DEFAULT = "-Xmx1024m";
=======
private static final String EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER = "max.wait.active.cluster";
private static int EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER_DEFAULT = 60;
>>>>>>>
private static final String EXTERNAL_FEEDSERVER_KEY = "feed.port";
private static int EXTERNAL_FEEDSERVER_DEFAULT = 19003;
private static final String EXTERNAL_CC_JAVA_OPTS_KEY = "cc.java.opts";
private static String EXTERNAL_CC_JAVA_OPTS_DEFAULT = "-Xmx1024m";
private static final String EXTERNAL_NC_JAVA_OPTS_KEY = "nc.java.opts";
private static String EXTERNAL_NC_JAVA_OPTS_DEFAULT = "-Xmx1024m";
private static final String EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER = "max.wait.active.cluster";
private static int EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER_DEFAULT = 60;
<<<<<<<
public String getNCJavaParams() {
return accessor.getProperty(EXTERNAL_NC_JAVA_OPTS_KEY, EXTERNAL_NC_JAVA_OPTS_DEFAULT,
PropertyInterpreters.getStringPropertyInterpreter());
}
public String getCCJavaParams() {
return accessor.getProperty(EXTERNAL_CC_JAVA_OPTS_KEY, EXTERNAL_CC_JAVA_OPTS_DEFAULT,
PropertyInterpreters.getStringPropertyInterpreter());
}
=======
public int getMaxWaitClusterActive() {
return accessor.getProperty(EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER, EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER_DEFAULT,
PropertyInterpreters.getIntegerPropertyInterpreter());
}
>>>>>>>
public String getNCJavaParams() {
return accessor.getProperty(EXTERNAL_NC_JAVA_OPTS_KEY, EXTERNAL_NC_JAVA_OPTS_DEFAULT,
PropertyInterpreters.getStringPropertyInterpreter());
}
public String getCCJavaParams() {
return accessor.getProperty(EXTERNAL_CC_JAVA_OPTS_KEY, EXTERNAL_CC_JAVA_OPTS_DEFAULT,
PropertyInterpreters.getStringPropertyInterpreter());
}
public int getMaxWaitClusterActive() {
return accessor.getProperty(EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER, EXTERNAL_MAX_WAIT_FOR_ACTIVE_CLUSTER_DEFAULT,
PropertyInterpreters.getIntegerPropertyInterpreter());
} |
<<<<<<<
import edu.uci.ics.asterix.common.config.IAsterixPropertiesProvider;
=======
import edu.uci.ics.asterix.common.config.DatasetConfig.DatasetType;
import edu.uci.ics.asterix.common.config.IAsterixPropertiesProvider;
>>>>>>>
import edu.uci.ics.asterix.common.config.IAsterixPropertiesProvider;
<<<<<<<
import edu.uci.ics.asterix.transaction.management.opcallbacks.SecondaryIndexOperationTrackerProvider;
=======
import edu.uci.ics.asterix.external.data.operator.ExternalDataIndexingOperatorDescriptor;
import edu.uci.ics.asterix.external.util.ExternalIndexHashPartitionComputerFactory;
import edu.uci.ics.asterix.metadata.utils.DatasetUtils;
import edu.uci.ics.asterix.runtime.formats.NonTaggedDataFormat;
import edu.uci.ics.asterix.transaction.management.opcallbacks.SecondaryIndexOperationTrackerProvider;
>>>>>>>
import edu.uci.ics.asterix.transaction.management.opcallbacks.SecondaryIndexOperationTrackerProvider;
<<<<<<<
@Override
public JobSpecification buildCreationJobSpec() throws AsterixException, AlgebricksException {
JobSpecification spec = JobSpecificationUtils.createJobSpecification();
AsterixStorageProperties storageProperties = propertiesProvider.getStorageProperties();
//prepare a LocalResourceMetadata which will be stored in NC's local resource repository
ILocalResourceMetadata localResourceMetadata = new LSMBTreeLocalResourceMetadata(
secondaryRecDesc.getTypeTraits(), secondaryComparatorFactories, secondaryBloomFilterKeyFields, true,
dataset.getDatasetId());
ILocalResourceFactoryProvider localResourceFactoryProvider = new PersistentLocalResourceFactoryProvider(
localResourceMetadata, LocalResource.LSMBTreeResource);
=======
@Override
public JobSpecification buildCreationJobSpec() throws AsterixException, AlgebricksException {
JobSpecification spec = JobSpecificationUtils.createJobSpecification();
AsterixStorageProperties storageProperties = propertiesProvider.getStorageProperties();
//prepare a LocalResourceMetadata which will be stored in NC's local resource repository
ILocalResourceMetadata localResourceMetadata = new LSMBTreeLocalResourceMetadata(
secondaryRecDesc.getTypeTraits(), secondaryComparatorFactories, secondaryBloomFilterKeyFields, true,
dataset.getDatasetId());
ILocalResourceFactoryProvider localResourceFactoryProvider = new PersistentLocalResourceFactoryProvider(
localResourceMetadata, LocalResource.LSMBTreeResource);
>>>>>>>
@Override
public JobSpecification buildCreationJobSpec() throws AsterixException, AlgebricksException {
JobSpecification spec = JobSpecificationUtils.createJobSpecification();
AsterixStorageProperties storageProperties = propertiesProvider.getStorageProperties();
//prepare a LocalResourceMetadata which will be stored in NC's local resource repository
ILocalResourceMetadata localResourceMetadata = new LSMBTreeLocalResourceMetadata(
secondaryRecDesc.getTypeTraits(), secondaryComparatorFactories, secondaryBloomFilterKeyFields, true,
dataset.getDatasetId());
ILocalResourceFactoryProvider localResourceFactoryProvider = new PersistentLocalResourceFactoryProvider(
localResourceMetadata, LocalResource.LSMBTreeResource);
<<<<<<<
@Override
public JobSpecification buildLoadingJobSpec() throws AsterixException, AlgebricksException {
JobSpecification spec = JobSpecificationUtils.createJobSpecification();
// Create dummy key provider for feeding the primary index scan.
AbstractOperatorDescriptor keyProviderOp = createDummyKeyProviderOp(spec);
// Create primary index scan op.
BTreeSearchOperatorDescriptor primaryScanOp = createPrimaryIndexScanOp(spec);
// Assign op.
AlgebricksMetaOperatorDescriptor asterixAssignOp = createAssignOp(spec, primaryScanOp, numSecondaryKeys);
// If any of the secondary fields are nullable, then add a select op that filters nulls.
AlgebricksMetaOperatorDescriptor selectOp = null;
if (anySecondaryKeyIsNullable) {
selectOp = createFilterNullsSelectOp(spec, numSecondaryKeys);
}
// Sort by secondary keys.
ExternalSortOperatorDescriptor sortOp = createSortOp(spec, secondaryComparatorFactories, secondaryRecDesc);
AsterixStorageProperties storageProperties = propertiesProvider.getStorageProperties();
// Create secondary BTree bulk load op.
TreeIndexBulkLoadOperatorDescriptor secondaryBulkLoadOp = createTreeIndexBulkLoadOp(
spec,
numSecondaryKeys,
new LSMBTreeDataflowHelperFactory(new AsterixVirtualBufferCacheProvider(dataset.getDatasetId()),
AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER, new SecondaryIndexOperationTrackerProvider(
LSMBTreeIOOperationCallbackFactory.INSTANCE, dataset.getDatasetId()),
AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER,
AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER, storageProperties
.getBloomFilterFalsePositiveRate()), BTree.DEFAULT_FILL_FACTOR);
// Connect the operators.
spec.connect(new OneToOneConnectorDescriptor(spec), keyProviderOp, 0, primaryScanOp, 0);
spec.connect(new OneToOneConnectorDescriptor(spec), primaryScanOp, 0, asterixAssignOp, 0);
if (anySecondaryKeyIsNullable) {
spec.connect(new OneToOneConnectorDescriptor(spec), asterixAssignOp, 0, selectOp, 0);
spec.connect(new OneToOneConnectorDescriptor(spec), selectOp, 0, sortOp, 0);
} else {
spec.connect(new OneToOneConnectorDescriptor(spec), asterixAssignOp, 0, sortOp, 0);
}
spec.connect(new OneToOneConnectorDescriptor(spec), sortOp, 0, secondaryBulkLoadOp, 0);
spec.addRoot(secondaryBulkLoadOp);
spec.setConnectorPolicyAssignmentPolicy(new ConnectorPolicyAssignmentPolicy());
return spec;
}
}
=======
@Override
public JobSpecification buildLoadingJobSpec() throws AsterixException, AlgebricksException {
if (dataset.getDatasetType() == DatasetType.EXTERNAL) {
JobSpecification spec = JobSpecificationUtils.createJobSpecification();
Pair<ExternalDataIndexingOperatorDescriptor, AlgebricksPartitionConstraint> RIDScanOpAndConstraints;
AlgebricksMetaOperatorDescriptor asterixAssignOp;
try {
//create external indexing scan operator
RIDScanOpAndConstraints = createExternalIndexingOp(spec);
//create assign operator
asterixAssignOp = createExternalAssignOp(spec);
AlgebricksPartitionConstraintHelper.setPartitionConstraintInJobSpec(spec, asterixAssignOp,
RIDScanOpAndConstraints.second);
} catch (Exception e) {
throw new AsterixException("Failed to create external index scanning and loading job");
}
// If any of the secondary fields are nullable, then add a select op that filters nulls.
AlgebricksMetaOperatorDescriptor selectOp = null;
if (anySecondaryKeyIsNullable) {
selectOp = createFilterNullsSelectOp(spec, numSecondaryKeys);
}
// Sort by secondary keys.
ExternalSortOperatorDescriptor sortOp = createSortOp(spec, secondaryComparatorFactories, secondaryRecDesc,
RIDScanOpAndConstraints.second);
AsterixStorageProperties storageProperties = propertiesProvider.getStorageProperties();
// Create secondary BTree bulk load op.
TreeIndexBulkLoadOperatorDescriptor secondaryBulkLoadOp = createTreeIndexBulkLoadOp(
spec,
numSecondaryKeys,
new LSMBTreeDataflowHelperFactory(new AsterixVirtualBufferCacheProvider(dataset.getDatasetId()),
AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER,
new SecondaryIndexOperationTrackerProvider(dataset.getDatasetId()),
AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER,
LSMBTreeIOOperationCallbackFactory.INSTANCE, storageProperties
.getBloomFilterFalsePositiveRate()), BTree.DEFAULT_FILL_FACTOR);
IBinaryHashFunctionFactory[] hashFactories = DatasetUtils.computeExternalDataKeysBinaryHashFunFactories(
dataset, NonTaggedDataFormat.INSTANCE.getBinaryHashFunctionFactoryProvider());
//select partitioning keys (always the first 2 after secondary keys)
int[] keys = new int[2];
keys[0] = numSecondaryKeys;
keys[1] = numSecondaryKeys + 1;
IConnectorDescriptor hashConn = new MToNPartitioningConnectorDescriptor(spec,
new ExternalIndexHashPartitionComputerFactory(keys, hashFactories));
spec.connect(new OneToOneConnectorDescriptor(spec), RIDScanOpAndConstraints.first, 0, asterixAssignOp, 0);
if (anySecondaryKeyIsNullable) {
spec.connect(new OneToOneConnectorDescriptor(spec), asterixAssignOp, 0, selectOp, 0);
spec.connect(hashConn, selectOp, 0, sortOp, 0);
} else {
spec.connect(hashConn, asterixAssignOp, 0, sortOp, 0);
}
spec.connect(new OneToOneConnectorDescriptor(spec), sortOp, 0, secondaryBulkLoadOp, 0);
spec.addRoot(secondaryBulkLoadOp);
spec.setConnectorPolicyAssignmentPolicy(new ConnectorPolicyAssignmentPolicy());
return spec;
} else {
JobSpecification spec = JobSpecificationUtils.createJobSpecification();
// Create dummy key provider for feeding the primary index scan.
AbstractOperatorDescriptor keyProviderOp = createDummyKeyProviderOp(spec);
// Create primary index scan op.
BTreeSearchOperatorDescriptor primaryScanOp = createPrimaryIndexScanOp(spec);
// Assign op.
AlgebricksMetaOperatorDescriptor asterixAssignOp = createAssignOp(spec, primaryScanOp, numSecondaryKeys);
// If any of the secondary fields are nullable, then add a select op that filters nulls.
AlgebricksMetaOperatorDescriptor selectOp = null;
if (anySecondaryKeyIsNullable) {
selectOp = createFilterNullsSelectOp(spec, numSecondaryKeys);
}
// Sort by secondary keys.
ExternalSortOperatorDescriptor sortOp = createSortOp(spec, secondaryComparatorFactories, secondaryRecDesc);
AsterixStorageProperties storageProperties = propertiesProvider.getStorageProperties();
// Create secondary BTree bulk load op.
TreeIndexBulkLoadOperatorDescriptor secondaryBulkLoadOp = createTreeIndexBulkLoadOp(
spec,
numSecondaryKeys,
new LSMBTreeDataflowHelperFactory(new AsterixVirtualBufferCacheProvider(dataset.getDatasetId()),
AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER,
new SecondaryIndexOperationTrackerProvider(dataset.getDatasetId()),
AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER,
LSMBTreeIOOperationCallbackFactory.INSTANCE, storageProperties
.getBloomFilterFalsePositiveRate()), BTree.DEFAULT_FILL_FACTOR);
// Connect the operators.
spec.connect(new OneToOneConnectorDescriptor(spec), keyProviderOp, 0, primaryScanOp, 0);
spec.connect(new OneToOneConnectorDescriptor(spec), primaryScanOp, 0, asterixAssignOp, 0);
if (anySecondaryKeyIsNullable) {
spec.connect(new OneToOneConnectorDescriptor(spec), asterixAssignOp, 0, selectOp, 0);
spec.connect(new OneToOneConnectorDescriptor(spec), selectOp, 0, sortOp, 0);
} else {
spec.connect(new OneToOneConnectorDescriptor(spec), asterixAssignOp, 0, sortOp, 0);
}
spec.connect(new OneToOneConnectorDescriptor(spec), sortOp, 0, secondaryBulkLoadOp, 0);
spec.addRoot(secondaryBulkLoadOp);
spec.setConnectorPolicyAssignmentPolicy(new ConnectorPolicyAssignmentPolicy());
return spec;
}
}
}
>>>>>>>
@Override
public JobSpecification buildLoadingJobSpec() throws AsterixException, AlgebricksException {
JobSpecification spec = JobSpecificationUtils.createJobSpecification();
// Create dummy key provider for feeding the primary index scan.
AbstractOperatorDescriptor keyProviderOp = createDummyKeyProviderOp(spec);
// Create primary index scan op.
BTreeSearchOperatorDescriptor primaryScanOp = createPrimaryIndexScanOp(spec);
// Assign op.
AlgebricksMetaOperatorDescriptor asterixAssignOp = createAssignOp(spec, primaryScanOp, numSecondaryKeys);
// If any of the secondary fields are nullable, then add a select op that filters nulls.
AlgebricksMetaOperatorDescriptor selectOp = null;
if (anySecondaryKeyIsNullable) {
selectOp = createFilterNullsSelectOp(spec, numSecondaryKeys);
}
// Sort by secondary keys.
ExternalSortOperatorDescriptor sortOp = createSortOp(spec, secondaryComparatorFactories, secondaryRecDesc);
AsterixStorageProperties storageProperties = propertiesProvider.getStorageProperties();
// Create secondary BTree bulk load op.
TreeIndexBulkLoadOperatorDescriptor secondaryBulkLoadOp = createTreeIndexBulkLoadOp(
spec,
numSecondaryKeys,
new LSMBTreeDataflowHelperFactory(new AsterixVirtualBufferCacheProvider(dataset.getDatasetId()),
AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER, new SecondaryIndexOperationTrackerProvider(
dataset.getDatasetId()), AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER,
LSMBTreeIOOperationCallbackFactory.INSTANCE, storageProperties
.getBloomFilterFalsePositiveRate()), BTree.DEFAULT_FILL_FACTOR);
// Connect the operators.
spec.connect(new OneToOneConnectorDescriptor(spec), keyProviderOp, 0, primaryScanOp, 0);
spec.connect(new OneToOneConnectorDescriptor(spec), primaryScanOp, 0, asterixAssignOp, 0);
if (anySecondaryKeyIsNullable) {
spec.connect(new OneToOneConnectorDescriptor(spec), asterixAssignOp, 0, selectOp, 0);
spec.connect(new OneToOneConnectorDescriptor(spec), selectOp, 0, sortOp, 0);
} else {
spec.connect(new OneToOneConnectorDescriptor(spec), asterixAssignOp, 0, sortOp, 0);
}
spec.connect(new OneToOneConnectorDescriptor(spec), sortOp, 0, secondaryBulkLoadOp, 0);
spec.addRoot(secondaryBulkLoadOp);
spec.setConnectorPolicyAssignmentPolicy(new ConnectorPolicyAssignmentPolicy());
return spec;
}
} |
<<<<<<<
private static final ARecordType createDataverseRecordType() {
return new ARecordType("DataverseRecordType", new String[] { "DataverseName", "DataFormat", "Timestamp", "PendingOp" },
new IAType[] { BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.AINT32 }, true);
=======
private static final ARecordType createDataverseRecordType() throws AsterixException {
return new ARecordType("DataverseRecordType", new String[] { "DataverseName", "DataFormat", "Timestamp" },
new IAType[] { BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING }, true);
>>>>>>>
private static final ARecordType createDataverseRecordType() throws AsterixException {
return new ARecordType("DataverseRecordType", new String[] { "DataverseName", "DataFormat", "Timestamp",
"PendingOp" }, new IAType[] { BuiltinType.ASTRING, BuiltinType.ASTRING, BuiltinType.ASTRING,
BuiltinType.AINT32 }, true);
<<<<<<<
public static final int DATASET_ARECORD_TIMESTAMP_FIELD_INDEX = 7;
public static final int DATASET_ARECORD_DATASETID_FIELD_INDEX = 8;
public static final int DATASET_ARECORD_PENDINGOP_FIELD_INDEX = 9;
=======
public static final int DATASET_ARECORD_HINTS_FIELD_INDEX = 7;
public static final int DATASET_ARECORD_TIMESTAMP_FIELD_INDEX = 8;
>>>>>>>
public static final int DATASET_ARECORD_HINTS_FIELD_INDEX = 7;
public static final int DATASET_ARECORD_TIMESTAMP_FIELD_INDEX = 8;
public static final int DATASET_ARECORD_DATASETID_FIELD_INDEX = 9;
public static final int DATASET_ARECORD_PENDINGOP_FIELD_INDEX = 10;
<<<<<<<
"ExternalDetails", "FeedDetails", "Timestamp", "DatasetId", "PendingOp" };
=======
"ExternalDetails", "FeedDetails", "Hints", "Timestamp" };
>>>>>>>
"ExternalDetails", "FeedDetails", "Hints", "Timestamp", "DatasetId", "PendingOp" };
<<<<<<<
internalRecordUnion, externalRecordUnion, feedRecordUnion, BuiltinType.ASTRING, BuiltinType.AINT32,
BuiltinType.AINT32 };
=======
internalRecordUnion, externalRecordUnion, feedRecordUnion, unorderedListOfHintsType,
BuiltinType.ASTRING };
>>>>>>>
internalRecordUnion, externalRecordUnion, feedRecordUnion, unorderedListOfHintsType,
BuiltinType.ASTRING, BuiltinType.AINT32, BuiltinType.AINT32 }; |
<<<<<<<
import android.os.Handler;
import android.os.Looper;
=======
>>>>>>>
import android.os.Handler;
import android.os.Looper;
<<<<<<<
import com.quickblox.q_municate.ui.adapters.chats.BaseChatMessagesAdapter;
=======
import com.quickblox.q_municate.ui.adapters.base.BaseRecyclerViewAdapter;
import com.quickblox.q_municate_core.core.concurrency.BaseAsyncTask;
import com.quickblox.q_municate_core.core.loader.BaseLoader;
>>>>>>>
import com.quickblox.q_municate.ui.adapters.base.BaseRecyclerViewAdapter;
import com.quickblox.q_municate_core.core.concurrency.BaseAsyncTask;
import com.quickblox.q_municate_core.core.loader.BaseLoader;
import com.quickblox.q_municate.ui.adapters.chats.BaseChatMessagesAdapter;
<<<<<<<
public static class CombinationMessageLoader extends BaseLoader<List<CombinationMessage>> {
=======
protected abstract void additionalActionsAfterLoadMessages();
public static class CombinationMessageLoader extends BaseLoader<List<CombinationMessage>> {
>>>>>>>
protected abstract void additionalActionsAfterLoadMessages();
public static class CombinationMessageLoader extends BaseLoader<List<CombinationMessage>> {
<<<<<<<
@Override
public void execute(Bundle bundle) {
messageSwipeRefreshLayout.setRefreshing(false);
int totalEntries = bundle.getInt(QBServiceConsts.EXTRA_TOTAL_ENTRIES, ConstsCore.ZERO_INT_VALUE);
=======
@Override
public void execute(Bundle bundle) {
final int totalEntries = bundle.getInt(QBServiceConsts.EXTRA_TOTAL_ENTRIES,
ConstsCore.ZERO_INT_VALUE);
final long lastMessageDate = bundle.getLong(QBServiceConsts.EXTRA_LAST_DATE_LOAD_MESSAGES,
ConstsCore.ZERO_INT_VALUE);
final boolean isLoadedOldMessages = bundle.getBoolean(QBServiceConsts.EXTRA_IS_LOAD_NEW_MESSAGES);
>>>>>>>
@Override
public void execute(Bundle bundle) {
messageSwipeRefreshLayout.setRefreshing(false);
final int totalEntries = bundle.getInt(QBServiceConsts.EXTRA_TOTAL_ENTRIES,
ConstsCore.ZERO_INT_VALUE);
final long lastMessageDate = bundle.getLong(QBServiceConsts.EXTRA_LAST_DATE_LOAD_MESSAGES,
ConstsCore.ZERO_INT_VALUE);
final boolean isLoadedOldMessages = bundle.getBoolean(QBServiceConsts.EXTRA_IS_LOAD_NEW_MESSAGES);
<<<<<<<
loadMore = false;
=======
isLoadingMessages = false;
>>>>>>>
isLoadingMessages = false;
<<<<<<<
if (!QBMessageTextClickMovement.QBLinkType.NONE.equals(qbLinkType)) {
canPerformLogout.set(false);
=======
if (!isLoadingMessages) {
isLoadingMessages = true;
startLoadDialogMessages(true);
>>>>>>>
if (!QBMessageTextClickMovement.QBLinkType.NONE.equals(qbLinkType)) {
canPerformLogout.set(false); |
<<<<<<<
IRuntimeHookFactory postHookFactory, IRecordDescriptorFactory inputRdFactory, int outputArity)
throws HyracksDataException {
treeIndexOpHelper = (TreeIndexDataflowHelper) opDesc.getIndexDataflowHelperFactory().createIndexDataflowHelper(
=======
IRuntimeHookFactory postHookFactory, IRecordDescriptorFactory inputRdFactory, int outputArity) {
treeIndexOpHelper = (IndexDataflowHelper) opDesc.getIndexDataflowHelperFactory().createIndexDataflowHelper(
>>>>>>>
IRuntimeHookFactory postHookFactory, IRecordDescriptorFactory inputRdFactory, int outputArity)
throws HyracksDataException {
treeIndexOpHelper = (IndexDataflowHelper) opDesc.getIndexDataflowHelperFactory().createIndexDataflowHelper( |
<<<<<<<
import java.io.InputStream;
import java.nio.ByteBuffer;
=======
import java.lang.reflect.Field;
import java.lang.reflect.Method;
>>>>>>>
import java.io.InputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.nio.ByteBuffer;
<<<<<<<
import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
import org.apache.asterix.om.base.AGeometry;
import org.apache.asterix.om.base.AInt32;
=======
import org.apache.asterix.external.parser.AbstractDataParser;
>>>>>>>
import org.apache.asterix.external.parser.AbstractDataParser;
import org.apache.asterix.formats.nontagged.SerializerDeserializerProvider;
import org.apache.asterix.om.base.AGeometry;
import org.apache.asterix.om.base.AInt32;
<<<<<<<
import com.esri.core.geometry.ogc.OGCPoint;
import junit.extensions.PA;
=======
>>>>>>>
import com.esri.core.geometry.ogc.OGCPoint;
<<<<<<<
public void test() throws IOException {
char[][] dates = toChars(
new String[] { "-9537-08-04", "9656-06-03", "-9537-04-04", "9656-06-04", "-9537-10-04", "9626-09-05" });
=======
public void test() throws IOException, NoSuchMethodException, SecurityException, NoSuchFieldException {
String[] dates = { "-9537-08-04", "9656-06-03", "-9537-04-04", "9656-06-04", "-9537-10-04", "9626-09-05" };
>>>>>>>
public void test() throws IOException, NoSuchMethodException, SecurityException, NoSuchFieldException {
char[][] dates = toChars(
new String[] { "-9537-08-04", "9656-06-03", "-9537-04-04", "9656-06-04", "-9537-10-04", "9626-09-05" });
<<<<<<<
PA.invokeMethod(parser, "parseDate(char[], int, int, java.io.DataOutput)", dates[index],
0, dates[index].length, dos);
AMutableDate aDate = (AMutableDate) PA.getValue(parser, "aDate");
=======
parseDateMethod.invoke(parser, dates[index], dos);
AMutableDate aDate = (AMutableDate) aDateField.get(parser);
>>>>>>>
parseDateMethod.invoke(parser, dates[index], 0, dates[index].length, dos);
AMutableDate aDate = (AMutableDate) aDateField.get(parser);
<<<<<<<
PA.invokeMethod(parser, "parseTime(char[], int, int, java.io.DataOutput)", times[index],
0, times[index].length, dos);
AMutableTime aTime = (AMutableTime) PA.getValue(parser, "aTime");
=======
parseTimeMethod.invoke(parser, times[index], dos);
AMutableTime aTime = (AMutableTime) aTimeField.get(parser);
>>>>>>>
parseTimeMethod.invoke(parser, times[index], 0, times[index].length, dos);
AMutableTime aTime = (AMutableTime) aTimeField.get(parser);
<<<<<<<
PA.invokeMethod(parser, "parseDateTime(char[], int, int, java.io.DataOutput)",
dateTimes[index], 0, dateTimes[index].length, dos);
AMutableDateTime aDateTime = (AMutableDateTime) PA.getValue(parser, "aDateTime");
=======
parseDateTimeMethod.invoke(parser, dateTimes[index], dos);
AMutableDateTime aDateTime = (AMutableDateTime) aDateTimeField.get(parser);
>>>>>>>
parseDateTimeMethod.invoke(parser, dateTimes[index], 0, dateTimes[index].length, dos);
AMutableDateTime aDateTime = (AMutableDateTime) aDateTimeField.get(parser); |
<<<<<<<
FEED_ACTIVITY_DATASET = new MetadataIndex("FeedActivity", null, 4, new IAType[] { BuiltinType.ASTRING,
BuiltinType.ASTRING, BuiltinType.AINT32 },
new String[] { "DataverseName", "DatasetName", "ActivityId" }, 0,
MetadataRecordTypes.FEED_ACTIVITY_RECORDTYPE, FEED_ACTIVITY_DATASET_ID, true, new int[] { 0, 1, 2 });
FEED_POLICY_DATASET = new MetadataIndex("FeedPolicy", null, 3, new IAType[] { BuiltinType.ASTRING,
BuiltinType.ASTRING }, new String[] { "DataverseName", "PolicyName" }, 0,
MetadataRecordTypes.FEED_POLICY_RECORDTYPE, FEED_POLICY_DATASET_ID, true, new int[] { 0, 1 });
=======
LIBRARY_DATASET = new MetadataIndex("Library", null, 3,
new IAType[] { BuiltinType.ASTRING, BuiltinType.ASTRING }, new String[] { "DataverseName", "Name" }, 0,
MetadataRecordTypes.LIBRARY_RECORDTYPE, LIBRARY_DATASET_ID, true, new int[] { 0, 1 });
>>>>>>>
FEED_ACTIVITY_DATASET = new MetadataIndex("FeedActivity", null, 4, new IAType[] { BuiltinType.ASTRING,
BuiltinType.ASTRING, BuiltinType.AINT32 },
new String[] { "DataverseName", "DatasetName", "ActivityId" }, 0,
MetadataRecordTypes.FEED_ACTIVITY_RECORDTYPE, FEED_ACTIVITY_DATASET_ID, true, new int[] { 0, 1, 2 });
LIBRARY_DATASET = new MetadataIndex("Library", null, 3,
new IAType[] { BuiltinType.ASTRING, BuiltinType.ASTRING }, new String[] { "DataverseName", "Name" }, 0,
MetadataRecordTypes.LIBRARY_RECORDTYPE, LIBRARY_DATASET_ID, true, new int[] { 0, 1 });
FEED_POLICY_DATASET = new MetadataIndex("FeedPolicy", null, 3, new IAType[] { BuiltinType.ASTRING,
BuiltinType.ASTRING }, new String[] { "DataverseName", "PolicyName" }, 0,
MetadataRecordTypes.FEED_POLICY_RECORDTYPE, FEED_POLICY_DATASET_ID, true, new int[] { 0, 1 }); |
<<<<<<<
public void onGotImageFile(File imageFile) {
String status = statusMessageEditText.getText().toString();
QBUpdateUserCommand.start(this, user, imageFile, status);
=======
public void onCachedImageFileReceived(File imageFile) {
QBUpdateUserCommand.start(this, qbUser, imageFile);
>>>>>>>
public void onCachedImageFileReceived(File imageFile) {
String status = statusMessageEditText.getText().toString();
QBUpdateUserCommand.start(this, user, imageFile, status);
<<<<<<<
if (isUserDataChanged(fullnameCurrent, emailCurrent, statusCurrent)) {
trySaveUserData();
=======
if (isUserDataChanges(fullnameCurrent, emailCurrent)) {
try {
saveChanges(fullnameCurrent, emailCurrent);
} catch (IOException e) {
e.printStackTrace();
}
>>>>>>>
if (isUserDataChanged(fullnameCurrent, emailCurrent, statusCurrent)) {
trySaveUserData();
<<<<<<<
private boolean isUserDataChanged(String fullname, String email, String status) {
return isNeedUpdateAvatar || !fullname.equals(fullnameOld) || !email.equals(emailOld) || !status
.equals(statusOld);
}
private void saveChanges(final String fullname, final String email) throws IOException {
showProgress();
user.setFullName(fullname);
user.setEmail(email);
if (isNeedUpdateAvatar) {
new GetImageFileTask(this).execute(imageHelper, avatarBitmapCurrent);
} else {
String status = statusMessageEditText.getText().toString();
QBUpdateUserCommand.start(this, user, null, status);
=======
private void saveChanges(final String fullname, final String email) throws IOException {
if (!isUserDataCorrect()) {
DialogUtils.showLong(this, getString(R.string.dlg_not_all_fields_entered));
return;
}
if (isUserDataChanges(fullname, email)) {
showProgress();
qbUser.setFullName(fullname);
qbUser.setEmail(email);
if (isNeedUpdateAvatar) {
new ReceiveImageFileTask(this).execute(imageHelper, avatarBitmapCurrent, true);
} else {
QBUpdateUserCommand.start(this, qbUser, null);
}
>>>>>>>
private boolean isUserDataChanged(String fullname, String email, String status) {
return isNeedUpdateAvatar || !fullname.equals(fullnameOld) || !email.equals(emailOld) || !status
.equals(statusOld);
}
private void saveChanges(final String fullname, final String email) throws IOException {
if (!isUserDataCorrect()) {
DialogUtils.showLong(this, getString(R.string.dlg_not_all_fields_entered));
return;
}
showProgress();
user.setFullName(fullname);
user.setEmail(email);
if (isNeedUpdateAvatar) {
new ReceiveImageFileTask(this).execute(imageHelper, avatarBitmapCurrent, true);
} else {
String status = statusMessageEditText.getText().toString();
QBUpdateUserCommand.start(this, user, null, status);
<<<<<<<
App.getInstance().getPrefsHelper().savePref(PrefsHelper.PREF_STATUS, statusCurrent);
=======
updateOldUserData();
>>>>>>>
App.getInstance().getPrefsHelper().savePref(PrefsHelper.PREF_STATUS, statusCurrent);
updateOldUserData(); |
<<<<<<<
MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
throw e;
=======
abort(e, e, mdTxnCtx);
throw new AlgebricksException(e);
>>>>>>>
abort(e, e, mdTxnCtx);
throw e;
<<<<<<<
MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
throw e;
=======
abort(e, e, mdTxnCtx);
throw new AlgebricksException(e);
>>>>>>>
abort(e, e, mdTxnCtx);
throw e;
<<<<<<<
MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
throw e;
=======
abort(e, e, mdTxnCtx);
throw new AlgebricksException(e);
>>>>>>>
abort(e, e, mdTxnCtx);
throw e;
<<<<<<<
MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
throw e;
=======
abort(e, e, mdTxnCtx);
throw new AlgebricksException(e);
>>>>>>>
abort(e, e, mdTxnCtx);
throw e;
<<<<<<<
MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
throw e;
=======
abort(e, e, mdTxnCtx);
throw new AlgebricksException(e);
>>>>>>>
abort(e, e, mdTxnCtx);
throw e;
<<<<<<<
MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
throw e;
=======
abort(e, e, mdTxnCtx);
throw new AlgebricksException(e);
>>>>>>>
abort(e, e, mdTxnCtx);
throw e;
<<<<<<<
MetadataManager.INSTANCE.abortTransaction(mdTxnCtx);
throw e;
=======
abort(e, e, mdTxnCtx);
throw new AlgebricksException(e);
>>>>>>>
abort(e, e, mdTxnCtx);
throw e; |
<<<<<<<
bufferManager.setConstrain(VPartitionTupleBufferManager.NO_CONSTRAIN);
=======
inMemJoiner.setComparator(comparator);
>>>>>>>
inMemJoiner.setComparator(comparator);
bufferManager.setConstrain(VPartitionTupleBufferManager.NO_CONSTRAIN); |
<<<<<<<
btreeLeafFrameFactory, fileManager, new LSMRTreeWithAntiMatterTuplesDiskComponentFactory(
diskRTreeFactory), diskFileMapProvider, fieldCount, rtreeCmpFactories, btreeCmpFactories,
linearizer, comparatorFields, linearizerArray, 0, mergePolicy, opTracker, ioScheduler,
ioOpCallbackProvider);
=======
btreeLeafFrameFactory, fileManager, new LSMRTreeWithAntiMatterTuplesDiskComponentFactory(diskRTreeFactory),
diskFileMapProvider, fieldCount, rtreeCmpFactories, btreeCmpFactories, linearizer, comparatorFields,
linearizerArray, 0, mergePolicy, opTracker, ioScheduler, ioOpCallback);
>>>>>>>
btreeLeafFrameFactory, fileManager, new LSMRTreeWithAntiMatterTuplesDiskComponentFactory(
diskRTreeFactory), diskFileMapProvider, fieldCount, rtreeCmpFactories, btreeCmpFactories,
linearizer, comparatorFields, linearizerArray, 0, mergePolicy, opTracker, ioScheduler, ioOpCallback); |
<<<<<<<
ConnectFeedStatement cfs = (ConnectFeedStatement) stmt;
String dataverseName = getActiveDataverseName(cfs.getDataverseName());
=======
metadataProvider.setWriteTransaction(true);
BeginFeedStatement bfs = (BeginFeedStatement) stmt;
String dataverseName = getActiveDataverseName(bfs.getDataverseName());
>>>>>>>
metadataProvider.setWriteTransaction(true);
ConnectFeedStatement cfs = (ConnectFeedStatement) stmt;
String dataverseName = getActiveDataverseName(cfs.getDataverseName()); |
<<<<<<<
=======
imageAttachment.setPadding(Consts.ZERO_INT_VALUE, Consts.ZERO_INT_VALUE, Consts.ZERO_INT_VALUE,
Consts.ZERO_INT_VALUE);
>>>>>>>
<<<<<<<
public SimpleImageLoading(final ImageView attachImageView, final RelativeLayout progressRelativeLayout,
final RelativeLayout attachMessageRelativeLayout, final ProgressBar verticalProgressBar,
final ProgressBar centeredProgressBar, boolean isOwnMessage) {
=======
public SimpleImageLoading(final ImageView attachImageView,
final RelativeLayout progressRelativeLayout, final ProgressBar verticalProgressBar,
final ProgressBar centeredProgressBar, boolean isOwnMessage) {
>>>>>>>
public SimpleImageLoading(final ImageView attachImageView, final RelativeLayout progressRelativeLayout,
final RelativeLayout attachMessageRelativeLayout, final ProgressBar verticalProgressBar,
final ProgressBar centeredProgressBar, boolean isOwnMessage) {
<<<<<<<
=======
Bitmap backgroundBitmap = BitmapFactory.decodeResource(resources,
isOwnMessage ? R.drawable.right_bubble : R.drawable.left_bubble);
>>>>>>> |
<<<<<<<
import edu.uci.ics.asterix.common.context.AsterixAppRuntimeContext;
import edu.uci.ics.asterix.common.context.AsterixRuntimeComponentsProvider;
=======
import edu.uci.ics.asterix.common.context.BaseOperationTracker;
import edu.uci.ics.asterix.common.exceptions.ACIDException;
import edu.uci.ics.asterix.common.ioopcallbacks.LSMBTreeIOOperationCallbackFactory;
import edu.uci.ics.asterix.common.transactions.IResourceManager.ResourceType;
import edu.uci.ics.asterix.common.transactions.TransactionalResourceManagerRepository;
import edu.uci.ics.asterix.external.adapter.factory.IAdapterFactory;
import edu.uci.ics.asterix.external.dataset.adapter.AdapterIdentifier;
>>>>>>>
import edu.uci.ics.asterix.common.context.AsterixAppRuntimeContext;
import edu.uci.ics.asterix.common.context.AsterixRuntimeComponentsProvider;
import edu.uci.ics.asterix.common.context.BaseOperationTracker;
import edu.uci.ics.asterix.common.exceptions.ACIDException;
import edu.uci.ics.asterix.common.ioopcallbacks.LSMBTreeIOOperationCallbackFactory;
import edu.uci.ics.asterix.common.transactions.IResourceManager.ResourceType;
import edu.uci.ics.asterix.common.transactions.TransactionalResourceManagerRepository;
import edu.uci.ics.asterix.external.adapter.factory.IAdapterFactory;
import edu.uci.ics.asterix.external.dataset.adapter.AdapterIdentifier; |
<<<<<<<
return LSMRTreeWithAntiMatterTuplesTestContext.create(harness.getVirtualBufferCache(), harness.getIOManager(),
harness.getFileReference(), harness.getDiskBufferCache(), harness.getDiskFileMapProvider(),
fieldSerdes, valueProviderFactories, numKeys, rtreePolicyType, harness.getMergePolicy(),
harness.getOperationTrackerFactory(), harness.getIOScheduler(),
harness.getIOOperationCallbackProvider());
=======
return LSMRTreeWithAntiMatterTuplesTestContext.create(harness.getMemBufferCache(),
harness.getMemFreePageManager(), harness.getIOManager(), harness.getFileReference(),
harness.getDiskBufferCache(), harness.getDiskFileMapProvider(), fieldSerdes, valueProviderFactories,
numKeys, rtreePolicyType, harness.getMergePolicy(), harness.getOperationTrackerFactory(),
harness.getIOScheduler(), harness.getIOOperationCallbackProvider(), harness.getIODeviceId());
>>>>>>>
return LSMRTreeWithAntiMatterTuplesTestContext.create(harness.getVirtualBufferCache(), harness.getIOManager(),
harness.getFileReference(), harness.getDiskBufferCache(), harness.getDiskFileMapProvider(),
fieldSerdes, valueProviderFactories, numKeys, rtreePolicyType, harness.getMergePolicy(),
harness.getOperationTrackerFactory(), harness.getIOScheduler(),
harness.getIOOperationCallbackProvider(), harness.getIODeviceId()); |
<<<<<<<
lockUtil.createIndexBegin(lockManager, metadataProvider.getLocks(), dataverseName, datasetName);
=======
Dataset ds;
Index index;
MetadataLockUtil.createIndexBegin(lockManager, metadataProvider.getLocks(), dataverseName,
datasetFullyQualifiedName);
>>>>>>>
lockUtil.createIndexBegin(lockManager, metadataProvider.getLocks(), dataverseName, datasetName);
<<<<<<<
Index index = MetadataManager.INSTANCE.getIndex(metadataProvider.getMetadataTxnContext(), dataverseName,
=======
DatasetType datasetType = ds.getDatasetType();
validateIndexType(datasetType, indexType, isSecondaryPrimary, sourceLoc);
index = MetadataManager.INSTANCE.getIndex(metadataProvider.getMetadataTxnContext(), dataverseName,
>>>>>>>
DatasetType datasetType = ds.getDatasetType();
validateIndexType(datasetType, indexType, isSecondaryPrimary, sourceLoc);
Index index = MetadataManager.INSTANCE.getIndex(metadataProvider.getMetadataTxnContext(), dataverseName, |
<<<<<<<
private List<Expression> extractExpressions(List<Expression> exprList, int limit) {
StackElement stackElement = stack.peek();
if (stackElement == null) {
return null;
}
int n = exprList.size();
List<Expression> newExprList = new ArrayList<>(n);
for (int i = 0; i < n; i++) {
Expression expr = exprList.get(i);
Expression newExpr;
if (i < limit && isExtractableExpression(expr)) {
VarIdentifier v = stackElement.addPendingLetClause(expr);
VariableExpr vExpr = new VariableExpr(v);
vExpr.setSourceLocation(expr.getSourceLocation());
newExpr = vExpr;
} else {
newExpr = expr;
}
newExprList.add(newExpr);
}
return newExprList;
}
private boolean isExtractableExpression(Expression expr) {
=======
protected static boolean isExtractableExpression(Expression expr) {
>>>>>>>
private List<Expression> extractExpressions(List<Expression> exprList, int limit) {
StackElement stackElement = stack.peek();
if (stackElement == null) {
return null;
}
int n = exprList.size();
List<Expression> newExprList = new ArrayList<>(n);
for (int i = 0; i < n; i++) {
Expression expr = exprList.get(i);
Expression newExpr;
if (i < limit && isExtractableExpression(expr)) {
VarIdentifier v = stackElement.addPendingLetClause(expr);
VariableExpr vExpr = new VariableExpr(v);
vExpr.setSourceLocation(expr.getSourceLocation());
newExpr = vExpr;
} else {
newExpr = expr;
}
newExprList.add(newExpr);
}
return newExprList;
}
protected static boolean isExtractableExpression(Expression expr) {
<<<<<<<
@Override
void handleUnsupportedClause(FromClause clause) throws CompilationException {
throw new CompilationException(ErrorCode.COMPILATION_UNEXPECTED_WINDOW_EXPRESSION, clause.getSourceLocation());
}
=======
>>>>>>>
@Override
void handleUnsupportedClause(FromClause clause) throws CompilationException {
throw new CompilationException(ErrorCode.COMPILATION_UNEXPECTED_WINDOW_EXPRESSION, clause.getSourceLocation());
} |
<<<<<<<
=======
import org.apache.asterix.test.aql.TestsUtils;
import org.apache.asterix.test.runtime.HDFSCluster;
import org.apache.asterix.testframework.context.TestCaseContext;
>>>>>>>
import org.apache.asterix.test.runtime.HDFSCluster;
import org.apache.asterix.testframework.context.TestCaseContext;
<<<<<<<
TestExecutor.executeScript(pb,
scriptHomePath + File.separator + "setup_teardown" + File.separator + "configure_and_validate.sh");
TestExecutor.executeScript(pb,
scriptHomePath + File.separator + "setup_teardown" + File.separator + "stop_and_delete.sh");
=======
TestsUtils.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" + File.separator
+ "configure_and_validate.sh");
TestsUtils.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" + File.separator
+ "stop_and_delete.sh");
HDFSCluster.getInstance().setup(HDFS_BASE);
>>>>>>>
TestExecutor.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" + File.separator
+ "configure_and_validate.sh");
TestExecutor.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" + File.separator
+ "stop_and_delete.sh");
HDFSCluster.getInstance().setup(HDFS_BASE);
<<<<<<<
TestExecutor.executeScript(pb,
scriptHomePath + File.separator + "setup_teardown" + File.separator + "stop_and_delete.sh");
TestExecutor.executeScript(pb,
scriptHomePath + File.separator + "setup_teardown" + File.separator + "shutdown.sh");
=======
TestsUtils.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" + File.separator
+ "stop_and_delete.sh");
TestsUtils.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" + File.separator
+ "shutdown.sh");
HDFSCluster.getInstance().cleanup();
>>>>>>>
TestExecutor.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" + File.separator
+ "stop_and_delete.sh");
TestExecutor.executeScript(pb, scriptHomePath + File.separator + "setup_teardown" + File.separator
+ "shutdown.sh");
HDFSCluster.getInstance().cleanup(); |
<<<<<<<
import edu.uci.ics.asterix.api.http.servlet.AsterixSDKServlet;
import edu.uci.ics.asterix.common.api.AsterixAppContextInfo;
=======
>>>>>>>
import edu.uci.ics.asterix.api.http.servlet.AsterixSDKServlet; |
<<<<<<<
registerRemoteMetadataNode(proxy);
}
MetadataManager.INSTANCE = new MetadataManager(proxy, metadataProperties);
MetadataManager.INSTANCE.init();
if (isMetadataNode) {
=======
>>>>>>>
<<<<<<<
=======
MetadataNode.INSTANCE.initialize(runtimeContext);
// This is a special case, we just give the metadataNode directly.
// This way we can delay the registration of the metadataNode until
// it is completely initialized.
MetadataManager.INSTANCE = new MetadataManager(proxy, MetadataNode.INSTANCE);
>>>>>>>
MetadataNode.INSTANCE.initialize(runtimeContext);
// This is a special case, we just give the metadataNode directly.
// This way we can delay the registration of the metadataNode until
// it is completely initialized.
MetadataManager.INSTANCE = new MetadataManager(proxy, MetadataNode.INSTANCE);
<<<<<<<
ncApplicationContext.setStateDumpHandler(new AsterixStateDumpHandler(ncApplicationContext.getNodeId(), lccm
.getDumpPath(), lccm));
lccm.startAll();
=======
LifeCycleComponentManager.INSTANCE.startAll();
>>>>>>>
ncApplicationContext.setStateDumpHandler(new AsterixStateDumpHandler(ncApplicationContext.getNodeId(), lccm
.getDumpPath(), lccm));
lccm.startAll();
<<<<<<<
public void registerRemoteMetadataNode(IAsterixStateProxy proxy) throws RemoteException {
IMetadataNode stub = null;
MetadataNode.INSTANCE.initialize(runtimeContext);
stub = (IMetadataNode) UnicastRemoteObject.exportObject(MetadataNode.INSTANCE, 0);
proxy.setMetadataNode(stub);
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Metadata node bound");
}
}
private void updateOnNodeJoin() {
AsterixMetadataProperties metadataProperties = ((IAsterixPropertiesProvider) runtimeContext)
.getMetadataProperties();
if (!metadataProperties.getNodeNames().contains(nodeId)) {
metadataProperties.getNodeNames().add(nodeId);
Cluster cluster = AsterixClusterProperties.INSTANCE.getCluster();
String asterixInstanceName = cluster.getInstanceName();
AsterixTransactionProperties txnProperties = ((IAsterixPropertiesProvider) runtimeContext)
.getTransactionProperties();
Node self = null;
for (Node node : cluster.getSubstituteNodes().getNode()) {
String ncId = asterixInstanceName + "_" + node.getId();
if (ncId.equalsIgnoreCase(nodeId)) {
String storeDir = node.getStore() == null ? cluster.getStore() : node.getStore();
metadataProperties.getStores().put(nodeId, storeDir.split(","));
String coredumpPath = node.getLogDir() == null ? cluster.getLogDir() : node.getLogDir();
metadataProperties.getCoredumpPaths().put(nodeId, coredumpPath);
String txnLogDir = node.getTxnLogDir() == null ? cluster.getTxnLogDir() : node.getTxnLogDir();
txnProperties.getLogDirectories().put(nodeId, txnLogDir);
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Store set to : " + storeDir);
LOGGER.info("Coredump dir set to : " + coredumpPath);
LOGGER.info("Transaction log dir set to :" + txnLogDir);
}
self = node;
break;
}
}
if (self != null) {
cluster.getSubstituteNodes().getNode().remove(self);
cluster.getNode().add(self);
} else {
throw new IllegalStateException("Unknown node joining the cluster");
}
}
}
/**
* Shutdown hook that invokes {@link NCApplicationEntryPoint#stop() stop} method.
*/
private static class JVMShutdownHook extends Thread {
private final NCApplicationEntryPoint ncAppEntryPoint;
public JVMShutdownHook(NCApplicationEntryPoint ncAppEntryPoint) {
this.ncAppEntryPoint = ncAppEntryPoint;
}
public void run() {
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Shutdown hook in progress");
}
try {
ncAppEntryPoint.stop();
} catch (Exception e) {
if (LOGGER.isLoggable(Level.WARNING)) {
LOGGER.warning("Exception in executing shutdown hook" + e);
}
}
}
}
=======
>>>>>>>
private void updateOnNodeJoin() {
AsterixMetadataProperties metadataProperties = ((IAsterixPropertiesProvider) runtimeContext)
.getMetadataProperties();
if (!metadataProperties.getNodeNames().contains(nodeId)) {
metadataProperties.getNodeNames().add(nodeId);
Cluster cluster = AsterixClusterProperties.INSTANCE.getCluster();
String asterixInstanceName = cluster.getInstanceName();
AsterixTransactionProperties txnProperties = ((IAsterixPropertiesProvider) runtimeContext)
.getTransactionProperties();
Node self = null;
for (Node node : cluster.getSubstituteNodes().getNode()) {
String ncId = asterixInstanceName + "_" + node.getId();
if (ncId.equalsIgnoreCase(nodeId)) {
String storeDir = node.getStore() == null ? cluster.getStore() : node.getStore();
metadataProperties.getStores().put(nodeId, storeDir.split(","));
String coredumpPath = node.getLogDir() == null ? cluster.getLogDir() : node.getLogDir();
metadataProperties.getCoredumpPaths().put(nodeId, coredumpPath);
String txnLogDir = node.getTxnLogDir() == null ? cluster.getTxnLogDir() : node.getTxnLogDir();
txnProperties.getLogDirectories().put(nodeId, txnLogDir);
if (LOGGER.isLoggable(Level.INFO)) {
LOGGER.info("Store set to : " + storeDir);
LOGGER.info("Coredump dir set to : " + coredumpPath);
LOGGER.info("Transaction log dir set to :" + txnLogDir);
}
self = node;
break;
}
}
if (self != null) {
cluster.getSubstituteNodes().getNode().remove(self);
cluster.getNode().add(self);
} else {
throw new IllegalStateException("Unknown node joining the cluster");
}
}
} |
<<<<<<<
=======
protected void setExternalSecondaryRecDescAndComparators(CompiledCreateIndexStatement createIndexStmt,
AqlMetadataProvider metadataProvider) throws AlgebricksException, AsterixException {
secondaryKeyFields = createIndexStmt.getKeyFields();
if (numSecondaryKeys != 1) {
throw new AsterixException(
"Cannot use "
+ numSecondaryKeys
+ " fields as a key for the R-tree index. There can be only one field as a key for the R-tree index.");
}
Pair<IAType, Boolean> spatialTypePair = Index.getNonNullableKeyFieldType(secondaryKeyFields.get(0), itemType);
IAType spatialType = spatialTypePair.first;
anySecondaryKeyIsNullable = spatialTypePair.second;
if (spatialType == null) {
throw new AsterixException("Could not find field " + secondaryKeyFields.get(0) + " in the schema.");
}
int numDimensions = NonTaggedFormatUtil.getNumDimensions(spatialType.getTypeTag());
numNestedSecondaryKeyFields = numDimensions * 2;
secondaryFieldAccessEvalFactories = metadataProvider.getFormat().createMBRFactory(itemType,
secondaryKeyFields.get(0), numPrimaryKeys, numDimensions);
secondaryComparatorFactories = new IBinaryComparatorFactory[numNestedSecondaryKeyFields];
valueProviderFactories = new IPrimitiveValueProviderFactory[numNestedSecondaryKeyFields];
ISerializerDeserializer[] secondaryRecFields = new ISerializerDeserializer[numPrimaryKeys
+ numNestedSecondaryKeyFields];
ITypeTraits[] secondaryTypeTraits = new ITypeTraits[numNestedSecondaryKeyFields + numPrimaryKeys];
IAType nestedKeyType = NonTaggedFormatUtil.getNestedSpatialType(spatialType.getTypeTag());
keyType = nestedKeyType.getTypeTag();
for (int i = 0; i < numNestedSecondaryKeyFields; i++) {
ISerializerDeserializer keySerde = AqlSerializerDeserializerProvider.INSTANCE
.getSerializerDeserializer(nestedKeyType);
secondaryRecFields[i] = keySerde;
secondaryComparatorFactories[i] = AqlBinaryComparatorFactoryProvider.INSTANCE.getBinaryComparatorFactory(
nestedKeyType, true);
secondaryTypeTraits[i] = AqlTypeTraitProvider.INSTANCE.getTypeTrait(nestedKeyType);
valueProviderFactories[i] = AqlPrimitiveValueProviderFactory.INSTANCE;
}
// Add serializers and comparators for primary index fields.
for (int i = 0; i < numPrimaryKeys; i++) {
secondaryRecFields[numNestedSecondaryKeyFields + i] = primaryRecDesc.getFields()[i];
secondaryTypeTraits[numNestedSecondaryKeyFields + i] = primaryRecDesc.getTypeTraits()[i];
}
secondaryRecDesc = new RecordDescriptor(secondaryRecFields, secondaryTypeTraits);
}
@Override
>>>>>>> |
<<<<<<<
ComparisonEnum compare, Charset actualEncoding, String statement) throws Exception {
LOGGER.info("Expected results file: {} ", expectedFile);
=======
ComparisonEnum compare, Charset actualEncoding) throws Exception {
LOGGER.info("Expected results file: {} ", canonicalize(expectedFile));
>>>>>>>
ComparisonEnum compare, Charset actualEncoding, String statement) throws Exception {
LOGGER.info("Expected results file: {} ", canonicalize(expectedFile)); |
<<<<<<<
IRecordDescriptorFactory inputRdFactory, int outputArity) throws HyracksDataException {
treeIndexOpHelper = (TreeIndexDataflowHelper) opDesc.getIndexDataflowHelperFactory().createIndexDataflowHelper(
=======
IRecordDescriptorFactory inputRdFactory, int outputArity) {
treeIndexOpHelper = (IndexDataflowHelper) opDesc.getIndexDataflowHelperFactory().createIndexDataflowHelper(
>>>>>>>
IRecordDescriptorFactory inputRdFactory, int outputArity) throws HyracksDataException {
treeIndexOpHelper = (IndexDataflowHelper) opDesc.getIndexDataflowHelperFactory().createIndexDataflowHelper( |
<<<<<<<
public static ARecordType FEED_RECORDTYPE;
public static ARecordType FEED_ADAPTOR_CONFIGURATION_RECORDTYPE;
public static ARecordType FEED_ACTIVITY_RECORDTYPE;
public static ARecordType FEED_POLICY_RECORDTYPE;
public static ARecordType POLICY_PARAMS_RECORDTYPE;
public static ARecordType FEED_ACTIVITY_DETAILS_RECORDTYPE;
public static ARecordType LIBRARY_RECORDTYPE;
=======
public static ARecordType COMPACTION_POLICY_RECORDTYPE;
>>>>>>>
public static ARecordType FEED_RECORDTYPE;
public static ARecordType FEED_ADAPTOR_CONFIGURATION_RECORDTYPE;
public static ARecordType FEED_ACTIVITY_RECORDTYPE;
public static ARecordType FEED_POLICY_RECORDTYPE;
public static ARecordType POLICY_PARAMS_RECORDTYPE;
public static ARecordType FEED_ACTIVITY_DETAILS_RECORDTYPE;
public static ARecordType LIBRARY_RECORDTYPE;
public static ARecordType COMPACTION_POLICY_RECORDTYPE;
<<<<<<<
FEED_RECORDTYPE = createFeedRecordType();
FEED_ADAPTOR_CONFIGURATION_RECORDTYPE = createPropertiesRecordType();
FEED_ACTIVITY_DETAILS_RECORDTYPE = createPropertiesRecordType();
FEED_ACTIVITY_RECORDTYPE = createFeedActivityRecordType();
FEED_POLICY_RECORDTYPE = createFeedPolicyRecordType();
LIBRARY_RECORDTYPE = createLibraryRecordType();
=======
COMPACTION_POLICY_RECORDTYPE = createCompactionPolicyRecordType();
>>>>>>>
FEED_RECORDTYPE = createFeedRecordType();
FEED_ADAPTOR_CONFIGURATION_RECORDTYPE = createPropertiesRecordType();
FEED_ACTIVITY_DETAILS_RECORDTYPE = createPropertiesRecordType();
FEED_ACTIVITY_RECORDTYPE = createFeedActivityRecordType();
FEED_POLICY_RECORDTYPE = createFeedPolicyRecordType();
LIBRARY_RECORDTYPE = createLibraryRecordType();
COMPACTION_POLICY_RECORDTYPE = createCompactionPolicyRecordType();
<<<<<<<
=======
public static final int FEED_DETAILS_ARECORD_STATE_FIELD_INDEX = 8;
public static final int FEED_DETAILS_ARECORD_COMPACTION_POLICY_FIELD_INDEX = 9;
public static final int FEED_DETAILS_ARECORD_COMPACTION_POLICY_PROPERTIES_FIELD_INDEX = 10;
>>>>>>>
public static final int FEED_DETAILS_ARECORD_STATE_FIELD_INDEX = 8;
public static final int FEED_DETAILS_ARECORD_COMPACTION_POLICY_FIELD_INDEX = 9;
public static final int FEED_DETAILS_ARECORD_COMPACTION_POLICY_PROPERTIES_FIELD_INDEX = 10;
<<<<<<<
BuiltinType.ASTRING, BuiltinType.ASTRING, orderedListOfPropertiesType, feedFunctionUnion };
=======
BuiltinType.ASTRING, BuiltinType.ASTRING, orderedListOfPropertiesType, feedFunctionUnion,
BuiltinType.ASTRING, BuiltinType.ASTRING, compactionPolicyPropertyListType };
>>>>>>>
BuiltinType.ASTRING, BuiltinType.ASTRING, orderedListOfPropertiesType, feedFunctionUnion,
BuiltinType.ASTRING, BuiltinType.ASTRING, compactionPolicyPropertyListType }; |
<<<<<<<
import com.quickblox.internal.core.exception.QBResponseException;
import com.quickblox.module.chat.QBChatMessage;
import com.quickblox.module.chat.QBChatService;
import com.quickblox.module.chat.QBPrivateChat;
import com.quickblox.module.chat.QBPrivateChatManager;
=======
import android.util.Log;
import com.quickblox.module.chat.*;
>>>>>>>
import com.quickblox.internal.core.exception.QBResponseException;
import com.quickblox.module.chat.QBChatMessage;
import com.quickblox.module.chat.QBChatService;
import com.quickblox.module.chat.QBPrivateChat;
import com.quickblox.module.chat.QBPrivateChatManager;
import com.quickblox.module.chat.QBRoomChat;
import com.quickblox.module.chat.QBRoomChatManager;
<<<<<<<
import com.quickblox.module.chat.model.QBAttachment;
import com.quickblox.module.content.QBContent;
import com.quickblox.module.content.model.QBFile;
=======
import com.quickblox.module.chat.listeners.QBRoomChatManagerListener;
>>>>>>>
import com.quickblox.module.chat.listeners.QBRoomChatManagerListener;
import com.quickblox.module.chat.model.QBAttachment;
import com.quickblox.module.content.QBContent;
import com.quickblox.module.content.model.QBFile;
<<<<<<<
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class QBChatHelper implements QBMessageListener<QBPrivateChat>, QBPrivateChatManagerListener {
=======
import java.util.List;
public class QBChatHelper implements QBMessageListener<QBPrivateChat>, QBPrivateChatManagerListener, QBRoomChatManagerListener {
>>>>>>>
import java.io.File;
import java.util.ArrayList;
import java.util.List;
public class QBChatHelper implements QBMessageListener<QBPrivateChat>, QBPrivateChatManagerListener, QBRoomChatManagerListener {
<<<<<<<
saveMessageToCache(chatMessage.getBody(), user.getId(), privateChatId, "");
=======
saveMessageToCache(chatMessage, user.getId(), privateChatId, opponentName);
}
public void sendGroupMessage(String message){
Log.i("GroupMessage: ", "From sendGroup, Chat message: " + message);
QBChatMessage chatMessage = getQBChatMessage(message);
try {
roomChat.sendMessage(chatMessage);
} catch (XMPPException e) {
e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
//TODO: reconnect
}
Log.i("GroupMessage: ", " Chat ID: " + groupChatName);
saveGroupMessageToCache(chatMessage, user.getId(), groupChatName);
>>>>>>>
saveMessageToCache(chatMessage.getBody(), user.getId(), privateChatId, "");
<<<<<<<
public void saveMessageToCache(String message, int senderId, int chatId, String attachUrl) {
DatabaseManager.savePrivateChatMessage(context, message, senderId, chatId, attachUrl);
}
public void sendPrivateMessageWithAttachImage(QBFile qbFile) {
QBChatMessage chatMessage = getQBChatMessageWithImage(qbFile);
try {
privateChat.sendMessage(chatMessage);
} catch (XMPPException e) {
e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
}
saveMessageToCache("", user.getId(), privateChatId, qbFile.getPublicUrl());
}
private QBChatMessage getQBChatMessageWithImage(QBFile qbFile) {
QBChatMessage chatMessage = new QBChatMessage();
QBAttachment attachment = new QBAttachment(QBAttachment.PHOTO_TYPE);
attachment.setUrl(qbFile.getPublicUrl());
chatMessage.addAttachment(attachment);
return chatMessage;
=======
private void saveMessageToCache(QBChatMessage chatMessage, int senderId, int chatId, String opponentName) {
DatabaseManager.savePrivateChatMessage(context, chatMessage, senderId, chatId, opponentName);
}
private void saveGroupMessageToCache(QBChatMessage chatMessage, int senderId, String groupId){
DatabaseManager.saveGroupChatMessage(context, chatMessage, senderId, groupId);
>>>>>>>
public void saveMessageToCache(String message, int senderId, int chatId, String attachUrl) {
DatabaseManager.savePrivateChatMessage(context, message, senderId, chatId, attachUrl);
}
public void sendGroupMessage(String message) {
QBChatMessage chatMessage = getQBChatMessage(message);
try {
roomChat.sendMessage(chatMessage);
} catch (XMPPException e) {
e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
//TODO: reconnect
}
saveGroupMessageToCache(chatMessage, user.getId(), groupChatName);
}
private void saveGroupMessageToCache(QBChatMessage chatMessage, int senderId, String groupId) {
DatabaseManager.saveGroupChatMessage(context, chatMessage, senderId, groupId);
}
public void sendPrivateMessageWithAttachImage(QBFile qbFile) {
QBChatMessage chatMessage = getQBChatMessageWithImage(qbFile);
try {
privateChat.sendMessage(chatMessage);
} catch (XMPPException e) {
e.printStackTrace();
} catch (SmackException.NotConnectedException e) {
e.printStackTrace();
}
saveMessageToCache("", user.getId(), privateChatId, qbFile.getPublicUrl());
}
private QBChatMessage getQBChatMessageWithImage(QBFile qbFile) {
QBChatMessage chatMessage = new QBChatMessage();
QBAttachment attachment = new QBAttachment(QBAttachment.PHOTO_TYPE);
attachment.setUrl(qbFile.getPublicUrl());
chatMessage.addAttachment(attachment);
return chatMessage;
<<<<<<<
=======
saveMessageToCache(chatMessage, chatMessage.getSenderId(), chatMessage.getSenderId(), null);
>>>>>>>
<<<<<<<
public QBFile loadAttachFile(File file) {
QBFile qbFile = null;
try {
qbFile = QBContent.uploadFileTask(file, true, (String) null);
} catch (QBResponseException e) {
e.printStackTrace();
}
return qbFile;
}
=======
public void initRoomChat(Context context, String roomName, List<Friend> friends){
this.context = context;
user = App.getInstance().getUser();
roomChat = roomChatManager.createRoom(roomName);
try{
roomChat.join();
roomChat.addRoomUser(user.getId());
for(Friend friend : friends){
roomChat.addRoomUser(Integer.valueOf(friend.getId()));
}
} catch (Exception e){
e.printStackTrace();
}
Log.i("GroupMessage: ", "From initRoomChat, RoomChat: " + roomChat);
groupChatName = roomName;
}
>>>>>>>
public void initRoomChat(Context context, String roomName, List<Friend> friends) {
this.context = context;
user = App.getInstance().getUser();
roomChat = roomChatManager.createRoom(roomName);
try {
roomChat.join();
roomChat.addRoomUser(user.getId());
for (Friend friend : friends) {
roomChat.addRoomUser(Integer.valueOf(friend.getId()));
}
} catch (Exception e) {
e.printStackTrace();
}
groupChatName = roomName;
}
public QBFile loadAttachFile(File file) {
QBFile qbFile = null;
try {
qbFile = QBContent.uploadFileTask(file, true, (String) null);
} catch (QBResponseException e) {
e.printStackTrace();
}
return qbFile;
} |
<<<<<<<
import edu.uci.ics.asterix.common.context.AsterixRuntimeComponentsProvider;
import edu.uci.ics.asterix.common.context.AsterixVirtualBufferCacheProvider;
=======
>>>>>>>
import edu.uci.ics.asterix.common.context.AsterixVirtualBufferCacheProvider; |
<<<<<<<
DataverseName itemTypeDataverseName = null;
String itemTypeName = null;
=======
String itemTypeDataverseName, itemTypeName;
boolean itemTypeAnonymous;
>>>>>>>
DataverseName itemTypeDataverseName;
String itemTypeName;
boolean itemTypeAnonymous;
<<<<<<<
=======
itemTypeAnonymous = false;
>>>>>>>
itemTypeAnonymous = false;
<<<<<<<
DataverseName metaItemTypeDataverseName = null;
String metaItemTypeName = null;
=======
String metaItemTypeDataverseName = null, metaItemTypeName = null, metaItemTypeFullyQualifiedName;
boolean metaItemTypeAnonymous;
>>>>>>>
DataverseName metaItemTypeDataverseName = null;
String metaItemTypeName = null;
boolean metaItemTypeAnonymous;
<<<<<<<
=======
metaItemTypeAnonymous = false;
>>>>>>>
metaItemTypeAnonymous = false;
<<<<<<<
=======
createDatasetBegin(metadataProvider, dataverseName, dataverseName + "." + datasetName, itemTypeDataverseName,
itemTypeAnonymous, itemTypeFullyQualifiedName, metaItemTypeDataverseName,
metaItemTypeFullyQualifiedName, metaItemTypeAnonymous, nodegroupName, compactionPolicy,
defaultCompactionPolicy, dd);
>>>>>>>
<<<<<<<
itemTypeDataverseName = dataverseName;
itemTypeName = DatasetUtil.createInlineTypeName(datasetName, false);
lockUtil.createTypeBegin(lockManager, metadataProvider.getLocks(), itemTypeDataverseName,
itemTypeName);
=======
>>>>>>>
<<<<<<<
metaItemTypeDataverseName = dataverseName;
metaItemTypeName = DatasetUtil.createInlineTypeName(datasetName, true);
lockUtil.createTypeBegin(lockManager, metadataProvider.getLocks(),
metaItemTypeDataverseName, metaItemTypeName);
=======
>>>>>>> |
<<<<<<<
import edu.uci.ics.asterix.aql.expression.ConnectFeedStatement;
=======
import edu.uci.ics.asterix.aql.expression.BeginFeedStatement;
import edu.uci.ics.asterix.aql.expression.CompactStatement;
import edu.uci.ics.asterix.aql.expression.ControlFeedStatement;
>>>>>>>
import edu.uci.ics.asterix.aql.expression.ConnectFeedStatement;
import edu.uci.ics.asterix.aql.expression.CompactStatement;
<<<<<<<
import edu.uci.ics.asterix.metadata.bootstrap.MetadataConstants;
import edu.uci.ics.asterix.metadata.dataset.hints.DatasetHints;
import edu.uci.ics.asterix.metadata.dataset.hints.DatasetHints.DatasetNodegroupCardinalityHint;
=======
import edu.uci.ics.asterix.metadata.bootstrap.MetadataConstants;
>>>>>>>
import edu.uci.ics.asterix.metadata.bootstrap.MetadataConstants;
import edu.uci.ics.asterix.metadata.dataset.hints.DatasetHints;
import edu.uci.ics.asterix.metadata.dataset.hints.DatasetHints.DatasetNodegroupCardinalityHint;
<<<<<<<
import edu.uci.ics.asterix.translator.CompiledStatements.CompiledDisconnectFeedStatement;
=======
import edu.uci.ics.asterix.translator.CompiledStatements.CompiledIndexCompactStatement;
>>>>>>>
import edu.uci.ics.asterix.translator.CompiledStatements.CompiledDisconnectFeedStatement;
import edu.uci.ics.asterix.translator.CompiledStatements.CompiledIndexCompactStatement;
<<<<<<<
Identifier ngName = ((InternalDetailsDecl) dd.getDatasetDetailsDecl()).getNodegroupName();
String nodegroupName = ngName != null ? ngName.getValue() : configureNodegroupForDataset(dd,
dataverseName, mdTxnCtx);
=======
String ngName = ((InternalDetailsDecl) dd.getDatasetDetailsDecl()).getNodegroupName().getValue();
String compactionPolicy = ((InternalDetailsDecl) dd.getDatasetDetailsDecl()).getCompactionPolicy();
Map<String, String> compactionPolicyProperties = ((InternalDetailsDecl) dd.getDatasetDetailsDecl())
.getCompactionPolicyProperties();
if (compactionPolicy == null) {
compactionPolicy = GlobalConfig.DEFAULT_COMPACTION_POLICY_NAME;
compactionPolicyProperties = GlobalConfig.DEFAULT_COMPACTION_POLICY_PROPERTIES;
} else {
validateCompactionPolicy(compactionPolicy, compactionPolicyProperties, mdTxnCtx);
}
>>>>>>>
Identifier ngNameId = ((InternalDetailsDecl) dd.getDatasetDetailsDecl()).getNodegroupName();
String ngName = ngNameId != null ? ngNameId.getValue() : configureNodegroupForDataset(dd,
dataverseName, mdTxnCtx);
String compactionPolicy = ((InternalDetailsDecl) dd.getDatasetDetailsDecl()).getCompactionPolicy();
Map<String, String> compactionPolicyProperties = ((InternalDetailsDecl) dd.getDatasetDetailsDecl())
.getCompactionPolicyProperties();
if (compactionPolicy == null) {
compactionPolicy = GlobalConfig.DEFAULT_COMPACTION_POLICY_NAME;
compactionPolicyProperties = GlobalConfig.DEFAULT_COMPACTION_POLICY_PROPERTIES;
} else {
validateCompactionPolicy(compactionPolicy, compactionPolicyProperties, mdTxnCtx);
}
<<<<<<<
nodegroupName);
=======
ngName, compactionPolicy, compactionPolicyProperties);
>>>>>>>
ngName, compactionPolicy, compactionPolicyProperties);
<<<<<<<
=======
case FEED: {
IAType itemType = dt.getDatatype();
if (itemType.getTypeTag() != ATypeTag.RECORD) {
throw new AlgebricksException("Can only partition ARecord's.");
}
List<String> partitioningExprs = ((FeedDetailsDecl) dd.getDatasetDetailsDecl())
.getPartitioningExprs();
ARecordType aRecordType = (ARecordType) itemType;
aRecordType.validatePartitioningExpressions(partitioningExprs);
String ngName = ((FeedDetailsDecl) dd.getDatasetDetailsDecl()).getNodegroupName().getValue();
String adapter = ((FeedDetailsDecl) dd.getDatasetDetailsDecl()).getAdapterFactoryClassname();
Map<String, String> configuration = ((FeedDetailsDecl) dd.getDatasetDetailsDecl())
.getConfiguration();
FunctionSignature signature = ((FeedDetailsDecl) dd.getDatasetDetailsDecl()).getFunctionSignature();
String compactionPolicy = ((FeedDetailsDecl) dd.getDatasetDetailsDecl()).getCompactionPolicy();
Map<String, String> compactionPolicyProperties = ((FeedDetailsDecl) dd.getDatasetDetailsDecl())
.getCompactionPolicyProperties();
if (compactionPolicy == null) {
compactionPolicy = GlobalConfig.DEFAULT_COMPACTION_POLICY_NAME;
compactionPolicyProperties = GlobalConfig.DEFAULT_COMPACTION_POLICY_PROPERTIES;
} else {
validateCompactionPolicy(compactionPolicy, compactionPolicyProperties, mdTxnCtx);
}
datasetDetails = new FeedDatasetDetails(InternalDatasetDetails.FileStructure.BTREE,
InternalDatasetDetails.PartitioningStrategy.HASH, partitioningExprs, partitioningExprs,
ngName, adapter, configuration, signature,
FeedDatasetDetails.FeedState.INACTIVE.toString(), compactionPolicy,
compactionPolicyProperties);
break;
}
>>>>>>> |
<<<<<<<
private final FileStructure fileStructure;
private final PartitioningStrategy partitioningStrategy;
private final List<String> partitioningKeys;
private final List<String> primaryKeys;
private final String nodeGroupName;
private final boolean autogenerated;
=======
protected final FileStructure fileStructure;
protected final PartitioningStrategy partitioningStrategy;
protected final List<String> partitioningKeys;
protected final List<String> primaryKeys;
protected final String nodeGroupName;
protected final String compactionPolicy;
protected final Map<String, String> compactionPolicyProperties;
>>>>>>>
protected final FileStructure fileStructure;
protected final PartitioningStrategy partitioningStrategy;
protected final List<String> partitioningKeys;
protected final List<String> primaryKeys;
protected final String nodeGroupName;
protected final boolean autogenerated;
protected final String compactionPolicy;
protected final Map<String, String> compactionPolicyProperties;
<<<<<<<
List<String> partitioningKey, List<String> primaryKey, boolean autogenerated, String groupName) {
=======
List<String> partitioningKey, List<String> primaryKey, String groupName, String compactionPolicy,
Map<String, String> compactionPolicyProperties) {
>>>>>>>
List<String> partitioningKey, List<String> primaryKey, String groupName, boolean autogenerated,
String compactionPolicy, Map<String, String> compactionPolicyProperties) { |
<<<<<<<
import edu.uci.ics.asterix.common.api.IAsterixAppRuntimeContext;
import edu.uci.ics.asterix.common.config.AsterixProperties;
=======
import edu.uci.ics.asterix.common.config.AsterixMetadataProperties;
import edu.uci.ics.asterix.common.config.AsterixStorageProperties;
>>>>>>>
import edu.uci.ics.asterix.common.api.IAsterixAppRuntimeContext;
import edu.uci.ics.asterix.common.config.AsterixMetadataProperties;
import edu.uci.ics.asterix.common.config.AsterixStorageProperties;
<<<<<<<
import edu.uci.ics.asterix.common.config.GlobalConfig;
import edu.uci.ics.asterix.common.exceptions.ACIDException;
import edu.uci.ics.asterix.common.transactions.IResourceManager.ResourceType;
import edu.uci.ics.asterix.common.transactions.TransactionalResourceManagerRepository;
=======
import edu.uci.ics.asterix.common.config.IAsterixPropertiesProvider;
import edu.uci.ics.asterix.common.context.AsterixAppRuntimeContext;
import edu.uci.ics.asterix.common.context.AsterixRuntimeComponentsProvider;
>>>>>>>
import edu.uci.ics.asterix.common.config.IAsterixPropertiesProvider;
import edu.uci.ics.asterix.common.exceptions.ACIDException;
import edu.uci.ics.asterix.common.transactions.IResourceManager.ResourceType;
import edu.uci.ics.asterix.common.transactions.TransactionalResourceManagerRepository;
<<<<<<<
public static void startUniverse(AsterixProperties asterixProperties, INCApplicationContext ncApplicationContext,
boolean isNewUniverse) throws Exception {
runtimeContext = (IAsterixAppRuntimeContext) ncApplicationContext.getApplicationObject();
=======
public static void startUniverse(IAsterixPropertiesProvider asterixPropertiesProvider,
INCApplicationContext ncApplicationContext, boolean isNewUniverse) throws Exception {
runtimeContext = (AsterixAppRuntimeContext) ncApplicationContext.getApplicationObject();
propertiesProvider = asterixPropertiesProvider;
>>>>>>>
public static void startUniverse(IAsterixPropertiesProvider asterixPropertiesProvider,
INCApplicationContext ncApplicationContext, boolean isNewUniverse) throws Exception {
runtimeContext = (IAsterixAppRuntimeContext) ncApplicationContext.getApplicationObject();
propertiesProvider = asterixPropertiesProvider; |
<<<<<<<
import com.quickblox.qmunicate.qb.helpers.QBChatHelper;
=======
import com.quickblox.qmunicate.ui.base.BaseFragmentActivity;
>>>>>>>
import com.quickblox.qmunicate.ui.base.BaseFragmentActivity;
<<<<<<<
boolean isLogined = App.getInstance().getPrefsHelper().getPref(PrefsHelper.PREF_IS_LOGINED, false);
if (numberOfActivitiesInForeground == 0 && isLogined) {
=======
if (numberOfActivitiesInForeground == 0 && !BaseFragmentActivity.isNeedToSaveSession) {
>>>>>>>
boolean isLogined = App.getInstance().getPrefsHelper().getPref(PrefsHelper.PREF_IS_LOGINED, false);
if (numberOfActivitiesInForeground == 0 && isLogined && !BaseFragmentActivity.isNeedToSaveSession) { |
<<<<<<<
public static void setConnectionHeader(HttpRequest request, DefaultHttpResponse response) {
final boolean keepAlive = io.netty.handler.codec.http.HttpUtil.isKeepAlive(request);
final AsciiString connectionHeaderValue = keepAlive ? HttpHeaderValues.KEEP_ALIVE : HttpHeaderValues.CLOSE;
response.headers().set(HttpHeaderNames.CONNECTION, connectionHeaderValue);
}
=======
public static String getPreferredCharset(IServletRequest request) {
return getPreferredCharset(request, DEFAULT_RESPONSE_CHARSET);
}
public static String getPreferredCharset(IServletRequest request, String defaultCharset) {
String acceptCharset = request.getHeader(HttpHeaderNames.ACCEPT_CHARSET);
if (acceptCharset == null) {
return defaultCharset;
}
// If no "q" parameter is present, the default weight is 1 [https://tools.ietf.org/html/rfc7231#section-5.3.1]
Optional<String> preferredCharset = Stream.of(StringUtils.split(acceptCharset, ","))
.map(WeightedHeaderValue::new).sorted().map(WeightedHeaderValue::getValue)
.map(a -> "*".equals(a) ? defaultCharset : a).filter(value -> {
if (!Charset.isSupported(value)) {
LOGGER.info("disregarding unsupported charset '{}'", value);
return false;
}
return true;
}).findFirst();
return preferredCharset.orElse(defaultCharset);
}
private static class WeightedHeaderValue implements Comparable<WeightedHeaderValue> {
final String value;
final double weight;
WeightedHeaderValue(String value) {
// Accept-Charset = 1#( ( charset / "*" ) [ weight ] )
// weight = OWS ";" OWS "q=" qvalue
String[] splits = StringUtils.split(value, ";");
this.value = splits[0].trim();
if (splits.length == 1) {
weight = 1.0d;
} else {
OptionalDouble specifiedWeight = Stream.of(splits).skip(1).map(String::trim).map(String::toLowerCase)
.filter(a -> a.startsWith("q="))
.mapToDouble(segment -> Double.parseDouble(StringUtils.splitByWholeSeparator(segment, "q=")[0]))
.findFirst();
this.weight = specifiedWeight.orElse(1.0d);
}
}
public String getValue() {
return value;
}
public double getWeight() {
return weight;
}
@Override
public int compareTo(WeightedHeaderValue o) {
return Double.compare(o.weight, weight);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WeightedHeaderValue that = (WeightedHeaderValue) o;
return Double.compare(that.weight, weight) == 0 && Objects.equals(value, that.value);
}
@Override
public int hashCode() {
return Objects.hash(value, weight);
}
}
>>>>>>>
public static void setConnectionHeader(HttpRequest request, DefaultHttpResponse response) {
final boolean keepAlive = io.netty.handler.codec.http.HttpUtil.isKeepAlive(request);
final AsciiString connectionHeaderValue = keepAlive ? HttpHeaderValues.KEEP_ALIVE : HttpHeaderValues.CLOSE;
response.headers().set(HttpHeaderNames.CONNECTION, connectionHeaderValue);
}
public static String getPreferredCharset(IServletRequest request) {
return getPreferredCharset(request, DEFAULT_RESPONSE_CHARSET);
}
public static String getPreferredCharset(IServletRequest request, String defaultCharset) {
String acceptCharset = request.getHeader(HttpHeaderNames.ACCEPT_CHARSET);
if (acceptCharset == null) {
return defaultCharset;
}
// If no "q" parameter is present, the default weight is 1 [https://tools.ietf.org/html/rfc7231#section-5.3.1]
Optional<String> preferredCharset = Stream.of(StringUtils.split(acceptCharset, ","))
.map(WeightedHeaderValue::new).sorted().map(WeightedHeaderValue::getValue)
.map(a -> "*".equals(a) ? defaultCharset : a).filter(value -> {
if (!Charset.isSupported(value)) {
LOGGER.info("disregarding unsupported charset '{}'", value);
return false;
}
return true;
}).findFirst();
return preferredCharset.orElse(defaultCharset);
}
private static class WeightedHeaderValue implements Comparable<WeightedHeaderValue> {
final String value;
final double weight;
WeightedHeaderValue(String value) {
// Accept-Charset = 1#( ( charset / "*" ) [ weight ] )
// weight = OWS ";" OWS "q=" qvalue
String[] splits = StringUtils.split(value, ";");
this.value = splits[0].trim();
if (splits.length == 1) {
weight = 1.0d;
} else {
OptionalDouble specifiedWeight = Stream.of(splits).skip(1).map(String::trim).map(String::toLowerCase)
.filter(a -> a.startsWith("q="))
.mapToDouble(segment -> Double.parseDouble(StringUtils.splitByWholeSeparator(segment, "q=")[0]))
.findFirst();
this.weight = specifiedWeight.orElse(1.0d);
}
}
public String getValue() {
return value;
}
public double getWeight() {
return weight;
}
@Override
public int compareTo(WeightedHeaderValue o) {
return Double.compare(o.weight, weight);
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
WeightedHeaderValue that = (WeightedHeaderValue) o;
return Double.compare(that.weight, weight) == 0 && Objects.equals(value, that.value);
}
@Override
public int hashCode() {
return Objects.hash(value, weight);
}
} |
<<<<<<<
dataset.getDatasetId()), compactionInfo.first, compactionInfo.second,
new SecondaryIndexOperationTrackerProvider(LSMBTreeIOOperationCallbackFactory.INSTANCE, dataset
.getDatasetId()), AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER,
AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER,
=======
dataset.getDatasetId()), AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER,
new SecondaryIndexOperationTrackerProvider(dataset.getDatasetId()),
AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER, LSMBTreeIOOperationCallbackFactory.INSTANCE,
>>>>>>>
dataset.getDatasetId()), compactionInfo.first, compactionInfo.second,
new SecondaryIndexOperationTrackerProvider(dataset.getDatasetId()),
AsterixRuntimeComponentsProvider.RUNTIME_PROVIDER, LSMBTreeIOOperationCallbackFactory.INSTANCE, |
<<<<<<<
public static class Encoding {
public static final String UTF8 = "utf-8";
private Encoding() {
}
}
public static class ContentType {
public static final String ADM = "adm";
public static final String JSON = "json";
public static final String CSV = "csv";
public static final String APPLICATION_ADM = "application/x-adm";
public static final String APPLICATION_JSON = "application/json";
public static final String APPLICATION_X_WWW_FORM_URLENCODED = "application/x-www-form-urlencoded";
public static final String TEXT_CSV = "text/csv";
public static final String IMG_PNG = "image/png";
public static final String TEXT_HTML = "text/html";
public static final String TEXT_PLAIN = "text/plain";
private ContentType() {
}
}
=======
>>>>>>> |
<<<<<<<
// start jetty http server
HttpServer httpServer = new HttpServer((int)port);
httpServer.start();
//final HTTPDemon protocolHandler = new HTTPDemon(sb);
//final serverCore server = new serverCore(
// timeout /*control socket timeout in milliseconds*/,
// true /* block attacks (wrong protocol) */,
// protocolHandler /*command class*/,
// sb,
// 30000 /*command max length incl. GET args*/);
//server.setName("httpd:"+port);
//server.setPriority(Thread.MAX_PRIORITY);
//server.setObeyIntermission(false);
=======
final HTTPDemon protocolHandler = new HTTPDemon(sb);
final serverCore server = new serverCore(
timeout /*control socket timeout in milliseconds*/,
true /* block attacks (wrong protocol) */,
protocolHandler /*command class*/,
sb,
30000 /*command max length incl. GET args*/);
server.setName("httpd:"+port);
server.setPriority(Thread.MAX_PRIORITY);
server.setObeyIntermission(false);
>>>>>>>
// start jetty http server
HttpServer httpServer = new HttpServer((int)port);
httpServer.start();
//final HTTPDemon protocolHandler = new HTTPDemon(sb);
//final serverCore server = new serverCore(
// timeout /*control socket timeout in milliseconds*/,
// true /* block attacks (wrong protocol) */,
// protocolHandler /*command class*/,
// sb,
// 30000 /*command max length incl. GET args*/);
//server.setName("httpd:"+port);
//server.setPriority(Thread.MAX_PRIORITY);
//server.setObeyIntermission(false);
<<<<<<<
Browser.openBrowser((false?"https":"http") + "://localhost:" + port + "/" + browserPopUpPage);
=======
Browser.openBrowser((server.withSSL()?"https":"http") + "://localhost:" + serverCore.getPortNr(port) + "/" + browserPopUpPage);
} catch (final Throwable e) {
// cannot open browser. This may be normal in headless environments
//Log.logException(e);
>>>>>>>
Browser.openBrowser((false?"https":"http") + "://localhost:" + port + "/" + browserPopUpPage);
} catch (final Throwable e) {
// cannot open browser. This may be normal in headless environments
//Log.logException(e); |
<<<<<<<
=======
import net.yacy.cora.document.analysis.Classification;
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.federate.solr.responsewriter.OpensearchResponseWriter.ResHead;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.JSONObject;
import net.yacy.data.URLLicense;
import net.yacy.search.schema.CollectionSchema;
>>>>>>>
import net.yacy.cora.document.id.MultiProtocolURL;
import net.yacy.cora.federate.solr.responsewriter.OpensearchResponseWriter.ResHead;
import net.yacy.cora.protocol.HeaderFramework;
import net.yacy.cora.util.ConcurrentLog;
import net.yacy.cora.util.JSONObject;
import net.yacy.search.schema.CollectionSchema;
<<<<<<<
} catch (final Throwable ee) {
ConcurrentLog.fine("YJsonResponseWriter", "Document writing error : " + ee.getMessage());
}
=======
} catch (final Throwable ee) {
ConcurrentLog.logException(ee);
writer.write("\"description\":\"\"\n}\n");
if (i < responseCount - 1) {
writer.write(",\n".toCharArray());
}
}
>>>>>>>
} catch (final Throwable ee) {
ConcurrentLog.logException(ee);
writer.write("\"description\":\"\"\n}\n");
if (i < responseCount - 1) {
writer.write(",\n".toCharArray());
}
} |
<<<<<<<
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Vector;
=======
>>>>>>>
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Vector;
<<<<<<<
=======
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Vector;
import java.util.Set;
>>>>>>>
<<<<<<<
return Context.getEncounterService().filterEncountersByViewPermissions(
dao.getEncounters(query, null, null, null, includeVoided), null);
=======
return dao.getEncounters(query, null, null, null, includeVoided);
>>>>>>>
return Context.getEncounterService().filterEncountersByViewPermissions(
dao.getEncounters(query, null, null, null, includeVoided), null);
<<<<<<<
=======
Errors errors = new BindException(encounter, "encounter");
>>>>>>>
<<<<<<<
//make sure the user has not turned off encounter types editing
Context.getEncounterService().checkIfEncounterTypesAreLocked();
=======
//make sure the user has not turned off encounter types editing
checkIfEncounterTypesAreLocked();
>>>>>>>
//make sure the user has not turned off encounter types editing
Context.getEncounterService().checkIfEncounterTypesAreLocked();
<<<<<<<
Context.getEncounterService().checkIfEncounterTypesAreLocked();
=======
checkIfEncounterTypesAreLocked();
>>>>>>>
Context.getEncounterService().checkIfEncounterTypesAreLocked();
<<<<<<<
//make sure the user has not turned off encounter types editing
Context.getEncounterService().checkIfEncounterTypesAreLocked();
=======
//make sure the user has not turned off encounter types editing
checkIfEncounterTypesAreLocked();
>>>>>>>
//make sure the user has not turned off encounter types editing
Context.getEncounterService().checkIfEncounterTypesAreLocked();
<<<<<<<
return Context.getEncounterService().filterEncountersByViewPermissions(
dao.getEncounters(query, null, start, length, includeVoided), null);
}
/**
* @see org.openmrs.api.EncounterService#getEncounters(java.lang.String, java.lang.Integer,
* java.lang.Integer, java.lang.Integer, boolean)
*/
@Override
@Transactional(readOnly = true)
public List<Encounter> getEncounters(String query, Integer patientId, Integer start, Integer length,
boolean includeVoided) throws APIException {
return Context.getEncounterService().filterEncountersByViewPermissions(
dao.getEncounters(query, patientId, start, length, includeVoided), null);
=======
return dao.getEncounters(query, null, start, length, includeVoided);
}
/**
* @see org.openmrs.api.EncounterService#getEncounters(java.lang.String, java.lang.Integer,
* java.lang.Integer, java.lang.Integer, boolean)
*/
@Override
@Transactional(readOnly = true)
public List<Encounter> getEncounters(String query, Integer patientId, Integer start, Integer length,
boolean includeVoided) throws APIException {
return dao.getEncounters(query, patientId, start, length, includeVoided);
>>>>>>>
return Context.getEncounterService().filterEncountersByViewPermissions(
dao.getEncounters(query, null, start, length, includeVoided), null);
}
/**
* @see org.openmrs.api.EncounterService#getEncounters(java.lang.String, java.lang.Integer,
* java.lang.Integer, java.lang.Integer, boolean)
*/
@Override
@Transactional(readOnly = true)
public List<Encounter> getEncounters(String query, Integer patientId, Integer start, Integer length,
boolean includeVoided) throws APIException {
return Context.getEncounterService().filterEncountersByViewPermissions(
dao.getEncounters(query, patientId, start, length, includeVoided), null);
<<<<<<<
String handlerGlobalValue = Context.getAdministrationService().getGlobalProperty(
OpenmrsConstants.GP_VISIT_ASSIGNMENT_HANDLER, null);
if (StringUtils.isBlank(handlerGlobalValue)) {
=======
String handlerGlobalValue = Context.getAdministrationService().getGlobalProperty(
OpenmrsConstants.GP_VISIT_ASSIGNMENT_HANDLER, null);
if (StringUtils.isBlank(handlerGlobalValue))
>>>>>>>
String handlerGlobalValue = Context.getAdministrationService().getGlobalProperty(
OpenmrsConstants.GP_VISIT_ASSIGNMENT_HANDLER, null);
if (StringUtils.isBlank(handlerGlobalValue)) {
<<<<<<<
/**
* @see org.openmrs.api.EncounterService#filterEncountersByViewPermissions(java.util.List,
* org.openmrs.User)
*/
@Override
@Transactional(readOnly = true)
public List<Encounter> filterEncountersByViewPermissions(List<Encounter> encounters, User user) {
if (encounters != null) {
// if user is not specified then use authenticated user from context by default
if (user == null) {
user = Context.getAuthenticatedUser();
}
for (Iterator<Encounter> iterator = encounters.iterator(); iterator.hasNext();) {
Encounter encounter = iterator.next();
// determine whether it's need to include this encounter into result or not
// as it can be not accessed by current user due to permissions lack
EncounterType et = encounter.getEncounterType();
if (et != null && !userHasEncounterPrivilege(et.getViewPrivilege(), user)) {
// exclude this encounter from result
iterator.remove();
}
}
}
return encounters;
}
/**
* @see org.openmrs.api.EncounterService#canViewAllEncounterTypes(org.openmrs.User)
*/
@Override
@Transactional(readOnly = true)
public boolean canViewAllEncounterTypes(User subject) {
boolean canView = Boolean.TRUE;
for (EncounterType et : Context.getEncounterService().getAllEncounterTypes()) {
if (!userHasEncounterPrivilege(et.getViewPrivilege(), subject)) {
canView = Boolean.FALSE;
break;
}
}
return canView;
}
/**
* @see org.openmrs.api.EncounterService#canEditAllEncounterTypes(org.openmrs.User)
*/
@Override
@Transactional(readOnly = true)
public boolean canEditAllEncounterTypes(User subject) {
boolean canEdit = Boolean.TRUE;
for (EncounterType et : Context.getEncounterService().getAllEncounterTypes()) {
if (!userHasEncounterPrivilege(et.getEditPrivilege(), subject)) {
canEdit = Boolean.FALSE;
break;
}
}
return canEdit;
}
/**
* @see org.openmrs.api.EncounterService#canEditEncounter(org.openmrs.Encounter,
* org.openmrs.User)
*/
@Override
public boolean canEditEncounter(Encounter encounter, User user) {
// if passed in encounter is null raise an exception
if (encounter == null) {
throw new IllegalArgumentException("The encounter argument can not be null");
}
// since we restrict by encounter type, if it does not exist, then anyone is allowed to edit the encounter
if (encounter.getEncounterType() == null) {
return Boolean.TRUE;
}
// if user is not specified, then use authenticated user from context by default
if (user == null) {
user = Context.getAuthenticatedUser();
}
return userHasEncounterPrivilege(encounter.getEncounterType().getEditPrivilege(), user);
}
/**
* @see org.openmrs.api.EncounterService#canViewEncounter(org.openmrs.Encounter,
* org.openmrs.User)
*/
@Override
public boolean canViewEncounter(Encounter encounter, User user) {
// if passed in encounter is null raise an exception
if (encounter == null) {
throw new IllegalArgumentException("The encounter argument can not be null");
}
// since we restrict by encounter type, if it does not exist, then anyone is allowed to view the encounter
if (encounter.getEncounterType() == null) {
return Boolean.TRUE;
}
// if user is not specified, then use authenticated user from context by default
if (user == null) {
user = Context.getAuthenticatedUser();
}
return userHasEncounterPrivilege(encounter.getEncounterType().getViewPrivilege(), user);
}
/**
* Convenient method that safely checks if user has given encounter privilege
*
* @param privilege the privilege to test
* @param user the user instance to check if it has given privilege
* @return true if given user has specified privilege
*/
private boolean userHasEncounterPrivilege(Privilege privilege, User user) {
//If the encounter privilege is null, everyone can see and edit the encounter.
if (privilege == null) {
return true;
}
return user.hasPrivilege(privilege.getPrivilege());
}
/**
* @see org.openmrs.api.EncounterService#checkIfEncounterTypesAreLocked()
*/
@Transactional(readOnly = true)
public void checkIfEncounterTypesAreLocked() {
String locked = Context.getAdministrationService().getGlobalProperty(
OpenmrsConstants.GLOBAL_PROPERTY_ENCOUNTER_TYPES_LOCKED, "false");
if (locked.toLowerCase().equals("true")) {
throw new EncounterTypeLockedException();
}
}
/**
* @see org.openmrs.api.EncounterService#getEncounterRolesByName(String)
*/
@Override
public List<EncounterRole> getEncounterRolesByName(String name) {
return dao.getEncounterRolesByName(name);
}
=======
/**
* @see org.openmrs.api.EncounterService#checkIfEncounterTypesAreLocked()
*/
@Transactional(readOnly = true)
public void checkIfEncounterTypesAreLocked() {
String locked = Context.getAdministrationService().getGlobalProperty(
OpenmrsConstants.GLOBAL_PROPERTY_ENCOUNTER_TYPES_LOCKED, "false");
if (locked.toLowerCase().equals("true")) {
throw new EncounterTypeLockedException();
}
}
>>>>>>>
/**
* @see org.openmrs.api.EncounterService#filterEncountersByViewPermissions(java.util.List,
* org.openmrs.User)
*/
@Override
@Transactional(readOnly = true)
public List<Encounter> filterEncountersByViewPermissions(List<Encounter> encounters, User user) {
if (encounters != null) {
// if user is not specified then use authenticated user from context by default
if (user == null) {
user = Context.getAuthenticatedUser();
}
for (Iterator<Encounter> iterator = encounters.iterator(); iterator.hasNext();) {
Encounter encounter = iterator.next();
// determine whether it's need to include this encounter into result or not
// as it can be not accessed by current user due to permissions lack
EncounterType et = encounter.getEncounterType();
if (et != null && !userHasEncounterPrivilege(et.getViewPrivilege(), user)) {
// exclude this encounter from result
iterator.remove();
}
}
}
return encounters;
}
/**
* @see org.openmrs.api.EncounterService#canViewAllEncounterTypes(org.openmrs.User)
*/
@Override
@Transactional(readOnly = true)
public boolean canViewAllEncounterTypes(User subject) {
boolean canView = Boolean.TRUE;
for (EncounterType et : Context.getEncounterService().getAllEncounterTypes()) {
if (!userHasEncounterPrivilege(et.getViewPrivilege(), subject)) {
canView = Boolean.FALSE;
break;
}
}
return canView;
}
/**
* @see org.openmrs.api.EncounterService#canEditAllEncounterTypes(org.openmrs.User)
*/
@Override
@Transactional(readOnly = true)
public boolean canEditAllEncounterTypes(User subject) {
boolean canEdit = Boolean.TRUE;
for (EncounterType et : Context.getEncounterService().getAllEncounterTypes()) {
if (!userHasEncounterPrivilege(et.getEditPrivilege(), subject)) {
canEdit = Boolean.FALSE;
break;
}
}
return canEdit;
}
/**
* @see org.openmrs.api.EncounterService#canEditEncounter(org.openmrs.Encounter,
* org.openmrs.User)
*/
@Override
public boolean canEditEncounter(Encounter encounter, User user) {
// if passed in encounter is null raise an exception
if (encounter == null) {
throw new IllegalArgumentException("The encounter argument can not be null");
}
// since we restrict by encounter type, if it does not exist, then anyone is allowed to edit the encounter
if (encounter.getEncounterType() == null) {
return Boolean.TRUE;
}
// if user is not specified, then use authenticated user from context by default
if (user == null) {
user = Context.getAuthenticatedUser();
}
return userHasEncounterPrivilege(encounter.getEncounterType().getEditPrivilege(), user);
}
/**
* @see org.openmrs.api.EncounterService#canViewEncounter(org.openmrs.Encounter,
* org.openmrs.User)
*/
@Override
public boolean canViewEncounter(Encounter encounter, User user) {
// if passed in encounter is null raise an exception
if (encounter == null) {
throw new IllegalArgumentException("The encounter argument can not be null");
}
// since we restrict by encounter type, if it does not exist, then anyone is allowed to view the encounter
if (encounter.getEncounterType() == null) {
return Boolean.TRUE;
}
// if user is not specified, then use authenticated user from context by default
if (user == null) {
user = Context.getAuthenticatedUser();
}
return userHasEncounterPrivilege(encounter.getEncounterType().getViewPrivilege(), user);
}
/**
* Convenient method that safely checks if user has given encounter privilege
*
* @param privilege the privilege to test
* @param user the user instance to check if it has given privilege
* @return true if given user has specified privilege
*/
private boolean userHasEncounterPrivilege(Privilege privilege, User user) {
//If the encounter privilege is null, everyone can see and edit the encounter.
if (privilege == null) {
return true;
}
return user.hasPrivilege(privilege.getPrivilege());
}
/**
* @see org.openmrs.api.EncounterService#checkIfEncounterTypesAreLocked()
*/
@Transactional(readOnly = true)
public void checkIfEncounterTypesAreLocked() {
String locked = Context.getAdministrationService().getGlobalProperty(
OpenmrsConstants.GLOBAL_PROPERTY_ENCOUNTER_TYPES_LOCKED, "false");
if (locked.toLowerCase().equals("true")) {
throw new EncounterTypeLockedException();
}
}
/**
* @see org.openmrs.api.EncounterService#getEncounterRolesByName(String)
*/
@Override
public List<EncounterRole> getEncounterRolesByName(String name) {
return dao.getEncounterRolesByName(name);
} |
<<<<<<<
import org.hibernate.Criteria;
=======
import org.hibernate.Criteria;
import org.hibernate.Hibernate;
>>>>>>>
import org.hibernate.Criteria;
import org.hibernate.Hibernate;
<<<<<<<
import org.openmrs.Location;
import org.openmrs.attribute.AttributeType;
=======
import org.hibernate.proxy.HibernateProxy;
import org.openmrs.Location;
import org.openmrs.attribute.AttributeType;
>>>>>>>
import org.hibernate.proxy.HibernateProxy;
import org.openmrs.Location;
import org.openmrs.attribute.AttributeType;
<<<<<<<
/**
* Adds attribute value criteria to the given criteria query
* @param criteria the criteria
* @param serializedAttributeValues the serialized attribute values
* @param <AT> the attribute type
*/
public static <AT extends AttributeType> void addAttributeCriteria(Criteria criteria,
Map<AT, String> serializedAttributeValues) {
Conjunction conjunction = Restrictions.conjunction();
int a = 0;
for (Map.Entry<AT, String> entry : serializedAttributeValues.entrySet()) {
String alias = "attributes" + (a++);
DetachedCriteria detachedCriteria = DetachedCriteria.forClass(Location.class).setProjection(Projections.id());
detachedCriteria.createAlias("attributes", alias);
detachedCriteria.add(Restrictions.eq(alias + ".attributeType", entry.getKey()));
detachedCriteria.add(Restrictions.eq(alias + ".valueReference", entry.getValue()));
detachedCriteria.add(Restrictions.eq(alias + ".voided", false));
conjunction.add(Property.forName("id").in(detachedCriteria));
}
criteria.add(conjunction);
}
=======
/**
* Adds attribute value criteria to the given criteria query
*
* @param criteria the criteria
* @param serializedAttributeValues the serialized attribute values
* @param <AT> the attribute type
*/
public static <AT extends AttributeType> void addAttributeCriteria(Criteria criteria,
Map<AT, String> serializedAttributeValues) {
Conjunction conjunction = Restrictions.conjunction();
int a = 0;
for (Map.Entry<AT, String> entry : serializedAttributeValues.entrySet()) {
String alias = "attributes" + (a++);
DetachedCriteria detachedCriteria = DetachedCriteria.forClass(Location.class).setProjection(Projections.id());
detachedCriteria.createAlias("attributes", alias);
detachedCriteria.add(Restrictions.eq(alias + ".attributeType", entry.getKey()));
detachedCriteria.add(Restrictions.eq(alias + ".valueReference", entry.getValue()));
detachedCriteria.add(Restrictions.eq(alias + ".voided", false));
conjunction.add(Property.forName("id").in(detachedCriteria));
}
criteria.add(conjunction);
}
/**
* Gets an object as an instance of its persistent type if it is a hibernate proxy otherwise
* returns the same passed in object
*
* @param persistentObject the object to unproxy
* @return the unproxied object
* @since 1.10
*/
public static <T> T getRealObjectFromProxy(T persistentObject) {
if (persistentObject == null) {
return null;
}
if (persistentObject instanceof HibernateProxy) {
Hibernate.initialize(persistentObject);
persistentObject = (T) ((HibernateProxy) persistentObject).getHibernateLazyInitializer().getImplementation();
}
return persistentObject;
}
>>>>>>>
/**
* Adds attribute value criteria to the given criteria query
* @param criteria the criteria
* @param serializedAttributeValues the serialized attribute values
* @param <AT> the attribute type
*/
public static <AT extends AttributeType> void addAttributeCriteria(Criteria criteria,
Map<AT, String> serializedAttributeValues) {
Conjunction conjunction = Restrictions.conjunction();
int a = 0;
for (Map.Entry<AT, String> entry : serializedAttributeValues.entrySet()) {
String alias = "attributes" + (a++);
DetachedCriteria detachedCriteria = DetachedCriteria.forClass(Location.class).setProjection(Projections.id());
detachedCriteria.createAlias("attributes", alias);
detachedCriteria.add(Restrictions.eq(alias + ".attributeType", entry.getKey()));
detachedCriteria.add(Restrictions.eq(alias + ".valueReference", entry.getValue()));
detachedCriteria.add(Restrictions.eq(alias + ".voided", false));
conjunction.add(Property.forName("id").in(detachedCriteria));
}
criteria.add(conjunction);
}
/**
* Gets an object as an instance of its persistent type if it is a hibernate proxy otherwise
* returns the same passed in object
*
* @param persistentObject the object to unproxy
* @return the unproxied object
* @since 1.10
*/
public static <T> T getRealObjectFromProxy(T persistentObject) {
if (persistentObject == null) {
return null;
}
if (persistentObject instanceof HibernateProxy) {
Hibernate.initialize(persistentObject);
persistentObject = (T) ((HibernateProxy) persistentObject).getHibernateLazyInitializer().getImplementation();
}
return persistentObject;
} |
<<<<<<<
/**
* @see ConceptService#isConceptNameDuplicate(ConceptName)
*/
public boolean isConceptNameDuplicate(ConceptName name);
=======
/**
* @see ConceptService#getDrugs(String, java.util.Locale, boolean, boolean)
*/
public List<Drug> getDrugs(String searchPhrase, Locale locale, boolean exactLocale, boolean includeRetired);
/**
* @see org.openmrs.api.ConceptService#getDrugsByMapping(String, ConceptSource, Collection,
* boolean)
*/
public List<Drug> getDrugsByMapping(String code, ConceptSource conceptSource,
Collection<ConceptMapType> withAnyOfTheseTypes, boolean includeRetired) throws DAOException;
/**
* @see org.openmrs.api.ConceptService#getDrugByMapping(String, org.openmrs.ConceptSource, java.util.Collection
*/
Drug getDrugByMapping(String code, ConceptSource conceptSource,
Collection<ConceptMapType> withAnyOfTheseTypesOrOrderOfPreference) throws DAOException;
>>>>>>>
/**
* @see ConceptService#isConceptNameDuplicate(ConceptName)
*/
public boolean isConceptNameDuplicate(ConceptName name);
/**
* @see ConceptService#getDrugs(String, java.util.Locale, boolean, boolean)
*/
public List<Drug> getDrugs(String searchPhrase, Locale locale, boolean exactLocale, boolean includeRetired);
/**
* @see org.openmrs.api.ConceptService#getDrugsByMapping(String, ConceptSource, Collection,
* boolean)
*/
public List<Drug> getDrugsByMapping(String code, ConceptSource conceptSource,
Collection<ConceptMapType> withAnyOfTheseTypes, boolean includeRetired) throws DAOException;
/**
* @see org.openmrs.api.ConceptService#getDrugByMapping(String, org.openmrs.ConceptSource, java.util.Collection
*/
Drug getDrugByMapping(String code, ConceptSource conceptSource,
Collection<ConceptMapType> withAnyOfTheseTypesOrOrderOfPreference) throws DAOException; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.