conflict_resolution
stringlengths
27
16k
<<<<<<< ======= private KeyCombination setKeybinds(Properties prop, String propertyName, String defaultValue){ prop.setProperty(propertyName, defaultValue); KeyCombination keyCombination; try{ keyCombination = KeyCombination.keyCombination(defaultValue); System.out.println("key code zones: " + keyCombination.getName()); }catch(Exception e){ System.out.println(":key code zones not set:"); keyCombination = KeyCombination.NO_MATCH; } return keyCombination; } private KeyCombination loadKeybinds(Properties prop, String propertyName, String defaultValue){ //check if hotkey is null, on older versions String loadProp = prop.getProperty(propertyName); if(loadProp == null) loadProp = defaultValue; KeyCombination keyCombination; try{ keyCombination = KeyCombination.keyCombination(loadProp); System.out.println("key code : " + keyCombination.getName()); }catch(Exception e){ System.out.println(":incorect:"); keyCombination = KeyCombination.NO_MATCH; } return keyCombination; } >>>>>>> private KeyCombination setKeybinds(Properties prop, String propertyName, String defaultValue){ prop.setProperty(propertyName, defaultValue); KeyCombination keyCombination; try{ keyCombination = KeyCombination.keyCombination(defaultValue); System.out.println("key code zones: " + keyCombination.getName()); }catch(Exception e){ System.out.println(":key code zones not set:"); keyCombination = KeyCombination.NO_MATCH; } return keyCombination; } private KeyCombination loadKeybinds(Properties prop, String propertyName, String defaultValue){ //check if hotkey is null, on older versions String loadProp = prop.getProperty(propertyName); if(loadProp == null) loadProp = defaultValue; KeyCombination keyCombination; try{ keyCombination = KeyCombination.keyCombination(loadProp); System.out.println("key code : " + keyCombination.getName()); }catch(Exception e){ System.out.println(":incorect:"); keyCombination = KeyCombination.NO_MATCH; } return keyCombination; } <<<<<<< level_hotkey_remind = prop.getProperty("level-hotkey-remind"); recipe_hotkey_mark = prop.getProperty("recipe-hotkey-mark"); //check if recipe hotkey is null, on older versions if(recipe_hotkey_mark == null) recipe_hotkey_mark = "F6"; if(!(prop.getProperty("poe-dir")==null || prop.getProperty("poe-dir").equals(""))){ Preferences_Controller.poe_log_dir = prop.getProperty("poe-dir") + "\\logs\\Client.txt"; } //new changes ======= if(!(prop.getProperty("poe-dir")==null || prop.getProperty("poe-dir").equals(""))){ Preferences_Controller.poe_log_dir = prop.getProperty("poe-dir") + "\\logs\\Client.txt"; } //new changes to overlay positions persist >>>>>>> if(!(prop.getProperty("poe-dir")==null || prop.getProperty("poe-dir").equals(""))){ Preferences_Controller.poe_log_dir = prop.getProperty("poe-dir") + "\\logs\\Client.txt"; } //API Preferences_Controller.poe_account_name = prop.getProperty("poe-account-name", ""); //new changes to overlay positions persist <<<<<<< Preferences_Controller.poe_account_name = prop.getProperty("poe-account-name", ""); ======= Preferences_Controller.zones_hotkey_show_hide_key = loadKeybinds( prop ,"zones-hotkey-show_hide" ,hotkeyDefaults.get("zones-hotkey-show_hide") ); Preferences_Controller.level_hotkey_remind_key = loadKeybinds( prop ,"level-hotkey-remind" ,hotkeyDefaults.get("level-hotkey-remind") ); Preferences_Controller.recipe_hotkey_mark_key = loadKeybinds( prop ,"recipe-hotkey-mark" ,hotkeyDefaults.get("recipe-hotkey-mark") ); Preferences_Controller.recipe_hotkey_preview_key = loadKeybinds( prop ,"recipe-hotkey-preview" ,hotkeyDefaults.get("recipe-hotkey-preview") ); Preferences_Controller.level_hotkey_beta_next_key = loadKeybinds( prop ,"level-hotkey-beta-next" ,hotkeyDefaults.get("level-hotkey-beta-next") ); Preferences_Controller.level_hotkey_beta_previous_key = loadKeybinds( prop ,"level-hotkey-beta-previous" ,hotkeyDefaults.get("level-hotkey-beta-previous") ); >>>>>>> Preferences_Controller.zones_hotkey_show_hide_key = loadKeybinds( prop ,"zones-hotkey-show_hide" ,hotkeyDefaults.get("zones-hotkey-show_hide") ); Preferences_Controller.level_hotkey_remind_key = loadKeybinds( prop ,"level-hotkey-remind" ,hotkeyDefaults.get("level-hotkey-remind") ); Preferences_Controller.recipe_hotkey_mark_key = loadKeybinds( prop ,"recipe-hotkey-mark" ,hotkeyDefaults.get("recipe-hotkey-mark") ); Preferences_Controller.recipe_hotkey_preview_key = loadKeybinds( prop ,"recipe-hotkey-preview" ,hotkeyDefaults.get("recipe-hotkey-preview") ); Preferences_Controller.level_hotkey_beta_next_key = loadKeybinds( prop ,"level-hotkey-beta-next" ,hotkeyDefaults.get("level-hotkey-beta-next") ); Preferences_Controller.level_hotkey_beta_previous_key = loadKeybinds( prop ,"level-hotkey-beta-previous" ,hotkeyDefaults.get("level-hotkey-beta-previous") ); <<<<<<< ======= /* Platform.runLater(new Runnable(){ @Override public void run() { new Test(); } }); */ >>>>>>> <<<<<<< ======= >>>>>>>
<<<<<<< ======= @FXML private Label recipeMarkedLabel; >>>>>>> private Label recipeMarkedLabel; <<<<<<< } ======= } public void playRecipeAnimation(){ recipeMarkedLabel.setVisible(true); Timeline slideIn = new Timeline(); KeyFrame kf_slideIn = new KeyFrame(Duration.millis(5000)); slideIn.getKeyFrames().addAll(kf_slideIn); slideIn.setOnFinished(e -> Platform.runLater(() -> recipeMarkedLabel.setVisible(false))); slideIn.play(); } >>>>>>> } } public void playRecipeAnimation(){ recipeMarkedLabel.setVisible(true); Timeline slideIn = new Timeline(); KeyFrame kf_slideIn = new KeyFrame(Duration.millis(5000)); slideIn.getKeyFrames().addAll(kf_slideIn); slideIn.setOnFinished(e -> Platform.runLater(() -> recipeMarkedLabel.setVisible(false))); slideIn.play(); }
<<<<<<< @FXML private JFXTextField txtAccountName; ======= @FXML private JFXToggleButton betaGemUItoggle; @FXML private AnchorPane betaHotkey_pane; >>>>>>> @FXML private JFXToggleButton betaGemUItoggle; @FXML private AnchorPane betaHotkey_pane; <<<<<<< ======= public static boolean gem_UI_toggle; >>>>>>> public static boolean gem_UI_toggle; <<<<<<< ======= public static KeyCombination recipe_hotkey_preview_key; public static KeyCombination level_hotkey_beta_next_key; public static KeyCombination level_hotkey_beta_previous_key; >>>>>>> public static KeyCombination recipe_hotkey_preview_key; public static KeyCombination level_hotkey_beta_next_key; public static KeyCombination level_hotkey_beta_previous_key; <<<<<<< ======= public static KeyCombination recipe_hotkey_preview_key_tmp; public static KeyCombination level_hotkey_beta_next_key_tmp; public static KeyCombination level_hotkey_beta_previous_key_tmp; >>>>>>> public static KeyCombination recipe_hotkey_preview_key_tmp; public static KeyCombination level_hotkey_beta_next_key_tmp; public static KeyCombination level_hotkey_beta_previous_key_tmp; <<<<<<< ======= public static boolean gameModeOn; private HashMap<String,String> hotkeyDefaults; public Preferences_Controller() { } >>>>>>> public static boolean gameModeOn; private HashMap<String,String> hotkeyDefaults; public Preferences_Controller() { } <<<<<<< Properties prop = new Properties(); InputStream input = null; try { input = new FileInputStream(POELevelFx.directory + "\\Path of Leveling\\config.properties"); // load a properties file prop.load(input); zones_toggle = Boolean.parseBoolean(prop.getProperty("zones-toggle")); zones_text_toggle = Boolean.parseBoolean(prop.getProperty("zones-text-toggle")); zones_images_toggle = Boolean.parseBoolean(prop.getProperty("zones-images-toggle")); zones_passive_toggle = Boolean.parseBoolean(prop.getProperty("zones-passive-toggle")); String parseTrial = prop.getProperty("zones-trial-toggle"); if(parseTrial == null){ zones_trial_toggle = true; //default }else{ zones_trial_toggle = Boolean.parseBoolean(prop.getProperty("zones-trial-toggle")); } String parseRecipe = prop.getProperty("zones-recipe-toggle"); if(parseRecipe == null){ zones_recipe_toggle = true; //default }else{ zones_recipe_toggle = Boolean.parseBoolean(prop.getProperty("zones-recipe-toggle")); } zones_slider = Double.parseDouble(prop.getProperty("zones-slider")); zones_hotkey_show_hide = prop.getProperty("zones-hotkey-show_hide"); level_slider = Double.parseDouble(prop.getProperty("level-slider")); level_hotkey_remind = prop.getProperty("level-hotkey-remind"); recipe_hotkey_mark = prop.getProperty("recipe-hotkey-mark"); if(recipe_hotkey_mark == null) recipe_hotkey_mark = "F6"; directory = prop.getProperty("poe-dir"); if(!(directory==null || directory.equals(""))){ poe_log_dir = directory + "\\logs\\Client.txt"; poe_installation.setText(directory); } poe_account_name = prop.getProperty("poe-account-name", ""); try{ KeyCombination keyCombination = KeyCombination.keyCombination(zones_hotkey_show_hide); System.out.println("key code : " + keyCombination.getName()); zones_hotkey_show_hide_key = keyCombination; }catch(Exception e){ System.out.println(":incorect:"); zones_hotkey_show_hide_key = KeyCombination.NO_MATCH; } try{ KeyCombination keyCombination = KeyCombination.keyCombination(level_hotkey_remind); System.out.println("key code : " + keyCombination.getName()); level_hotkey_remind_key = keyCombination; }catch(Exception e){ System.out.println(":incorect:"); level_hotkey_remind_key = KeyCombination.NO_MATCH; } try{ KeyCombination keyCombination = KeyCombination.keyCombination(recipe_hotkey_mark); System.out.println("key code : " + keyCombination.getName()); recipe_hotkey_mark_key = keyCombination; }catch(Exception e){ System.out.println(":incorect:"); recipe_hotkey_mark_key = KeyCombination.NO_MATCH; } zones_hotkey_show_hide_key_tmp = zones_hotkey_show_hide_key; level_hotkey_remind_key_tmp = level_hotkey_remind_key; recipe_hotkey_mark_key_tmp = recipe_hotkey_mark_key; } catch (IOException ex) { ex.printStackTrace(); } finally { ======= Properties prop = new Properties(); InputStream input = null; try { input = new FileInputStream(POELevelFx.directory + "\\Path of Leveling\\config.properties"); // load a properties file prop.load(input); zones_toggle = Boolean.parseBoolean(prop.getProperty("zones-toggle")); zones_text_toggle = Boolean.parseBoolean(prop.getProperty("zones-text-toggle")); zones_images_toggle = Boolean.parseBoolean(prop.getProperty("zones-images-toggle")); zones_passive_toggle = Boolean.parseBoolean(prop.getProperty("zones-passive-toggle")); String parseTrial = prop.getProperty("zones-trial-toggle"); if(parseTrial == null){ zones_trial_toggle = true; //default }else{ zones_trial_toggle = Boolean.parseBoolean(prop.getProperty("zones-trial-toggle")); } String parseRecipe = prop.getProperty("zones-recipe-toggle"); if(parseRecipe == null){ zones_recipe_toggle = true; //default }else{ zones_recipe_toggle = Boolean.parseBoolean(prop.getProperty("zones-recipe-toggle")); } String parseGemUI = prop.getProperty("gem-beta-UI-toggle"); if(parseGemUI == null){ gem_UI_toggle = true; //default }else{ gem_UI_toggle = Boolean.parseBoolean(prop.getProperty("gem-beta-UI-toggle")); } zones_slider = Double.parseDouble(prop.getProperty("zones-slider")); level_slider = Double.parseDouble(prop.getProperty("level-slider")); directory = prop.getProperty("poe-dir"); if(!(directory==null || directory.equals(""))){ poe_log_dir = directory + "\\logs\\Client.txt"; poe_installation.setText(directory); } zones_hotkey_show_hide_key = loadKeybinds( prop ,"zones-hotkey-show_hide" ,show_hide_hotkey_zone ); zones_hotkey_show_hide_key_tmp = zones_hotkey_show_hide_key ; level_hotkey_remind_key = loadKeybinds( prop ,"level-hotkey-remind" ,remind_gems ); level_hotkey_remind_key_tmp = level_hotkey_remind_key; recipe_hotkey_mark_key = loadKeybinds( prop ,"recipe-hotkey-mark" ,mark_recipe_hotkey ); recipe_hotkey_mark_key_tmp = recipe_hotkey_mark_key; recipe_hotkey_preview_key = loadKeybinds( prop ,"recipe-hotkey-preview" ,recipe_preview_hotkey ); recipe_hotkey_preview_key_tmp = recipe_hotkey_preview_key; level_hotkey_beta_next_key = loadKeybinds( prop ,"level-hotkey-beta-next" ,next_gem_hotkey ); level_hotkey_beta_next_key_tmp = level_hotkey_beta_next_key; level_hotkey_beta_previous_key = loadKeybinds( prop ,"level-hotkey-beta-previous" ,previous_gem_hotkey ); level_hotkey_beta_previous_key_tmp = level_hotkey_beta_previous_key; } catch (IOException ex) { ex.printStackTrace(); } finally { >>>>>>> Properties prop = new Properties(); InputStream input = null; try { input = new FileInputStream(POELevelFx.directory + "\\Path of Leveling\\config.properties"); // load a properties file prop.load(input); zones_toggle = Boolean.parseBoolean(prop.getProperty("zones-toggle")); zones_text_toggle = Boolean.parseBoolean(prop.getProperty("zones-text-toggle")); zones_images_toggle = Boolean.parseBoolean(prop.getProperty("zones-images-toggle")); zones_passive_toggle = Boolean.parseBoolean(prop.getProperty("zones-passive-toggle")); String parseTrial = prop.getProperty("zones-trial-toggle"); if(parseTrial == null){ zones_trial_toggle = true; //default }else{ zones_trial_toggle = Boolean.parseBoolean(prop.getProperty("zones-trial-toggle")); } String parseRecipe = prop.getProperty("zones-recipe-toggle"); if(parseRecipe == null){ zones_recipe_toggle = true; //default }else{ zones_recipe_toggle = Boolean.parseBoolean(prop.getProperty("zones-recipe-toggle")); } String parseGemUI = prop.getProperty("gem-beta-UI-toggle"); if(parseGemUI == null){ gem_UI_toggle = true; //default }else{ gem_UI_toggle = Boolean.parseBoolean(prop.getProperty("gem-beta-UI-toggle")); } zones_slider = Double.parseDouble(prop.getProperty("zones-slider")); level_slider = Double.parseDouble(prop.getProperty("level-slider")); directory = prop.getProperty("poe-dir"); if(!(directory==null || directory.equals(""))){ poe_log_dir = directory + "\\logs\\Client.txt"; poe_installation.setText(directory); } //API poe_account_name = prop.getProperty("poe-account-name", ""); //API zones_hotkey_show_hide_key = loadKeybinds( prop ,"zones-hotkey-show_hide" ,show_hide_hotkey_zone ); zones_hotkey_show_hide_key_tmp = zones_hotkey_show_hide_key ; level_hotkey_remind_key = loadKeybinds( prop ,"level-hotkey-remind" ,remind_gems ); level_hotkey_remind_key_tmp = level_hotkey_remind_key; recipe_hotkey_mark_key = loadKeybinds( prop ,"recipe-hotkey-mark" ,mark_recipe_hotkey ); recipe_hotkey_mark_key_tmp = recipe_hotkey_mark_key; recipe_hotkey_preview_key = loadKeybinds( prop ,"recipe-hotkey-preview" ,recipe_preview_hotkey ); recipe_hotkey_preview_key_tmp = recipe_hotkey_preview_key; level_hotkey_beta_next_key = loadKeybinds( prop ,"level-hotkey-beta-next" ,next_gem_hotkey ); level_hotkey_beta_next_key_tmp = level_hotkey_beta_next_key; level_hotkey_beta_previous_key = loadKeybinds( prop ,"level-hotkey-beta-previous" ,previous_gem_hotkey ); level_hotkey_beta_previous_key_tmp = level_hotkey_beta_previous_key; } catch (IOException ex) { ex.printStackTrace(); } finally { <<<<<<< if(event.isAltDown()){ key_bind = "Alt+"; if(event.getCode().getName().equals("Alt")){ key_bind = "Alt"; }else{ key_bind += event.getCode().getName(); } }else if(event.isControlDown()){ key_bind = "Ctrl+"; if(event.getCode().getName().equals("Ctrl")){ key_bind = "Ctrl"; }else{ key_bind += event.getCode().getName(); } }else if(event.isShiftDown()){ key_bind = "Shift+"; if(event.getCode().getName().equals("Shift")){ key_bind = "Shift"; }else{ key_bind += event.getCode().getName(); } }else{ key_bind += event.getCode().getName(); } try{ zones_hotkey_show_hide_key_tmp = KeyCombination.keyCombination(key_bind); isBeingUsed(zones_hotkey_show_hide_key_tmp,0); show_hide_hotkey_zone.setText(key_bind); System.out.println("key code : " + zones_hotkey_show_hide_key_tmp.getName()); //zones_hotkey_show_hide_key = keyCombination; }catch(IllegalArgumentException e){ show_hide_hotkey_zone.setText(""); System.out.println(":incorect:"); //zones_hotkey_show_hide_key = KeyCombination.NO_MATCH; }finally{ key_bind = ""; } ======= zones_hotkey_show_hide_key_tmp = handleKeybindEdit( event ,show_hide_hotkey_zone ,0 ); } }); >>>>>>> zones_hotkey_show_hide_key_tmp = handleKeybindEdit( event ,show_hide_hotkey_zone ,0 ); } }); <<<<<<< ======= @FXML private void betaGemUItoggle_action(){ if(betaGemUItoggle.isSelected()){ gem_UI_toggle = true; betaHotkey_pane.setVisible(true); }else{ gem_UI_toggle = false; betaHotkey_pane.setVisible(false); } } >>>>>>> @FXML private void betaGemUItoggle_action(){ if(betaGemUItoggle.isSelected()){ gem_UI_toggle = true; betaHotkey_pane.setVisible(true); }else{ gem_UI_toggle = false; betaHotkey_pane.setVisible(false); } }
<<<<<<< import android.annotation.SuppressLint; import android.content.ComponentName; import android.content.Context; import android.content.Intent; import android.content.ServiceConnection; import android.os.Bundle; import android.os.IBinder; import android.os.StrictMode; ======= import android.app.AlertDialog; import android.content.*; import android.os.*; >>>>>>> import android.app.AlertDialog; import android.content.*; import android.os.*; <<<<<<< import android.support.v4.app.FragmentActivity; import android.support.v4.app.FragmentTransaction; import android.util.Log; import android.view.Menu; import android.view.MenuItem; ======= import android.util.Log; >>>>>>> import android.support.v4.app.FragmentActivity; import android.util.Log; <<<<<<< ======= import android.widget.ListView; >>>>>>> import android.widget.ListView; <<<<<<< public class WeechatActivity extends FragmentActivity implements BufferListFragment.OnBufferSelectedListener, OnItemClickListener, RelayConnectionHandler { private static final String TAG = "WeechatActivity"; ======= public class WeechatActivity extends SherlockActivity implements OnItemClickListener, RelayConnectionHandler { private static final String TAG = "WeeChatActivity"; >>>>>>> public class WeechatActivity extends SherlockFragmentActivity implements BufferListFragment.OnBufferSelectedListener, OnItemClickListener, RelayConnectionHandler { private static final String TAG = "WeechatActivity"; <<<<<<< //private ListView bufferlist; //private BufferListFragment bufferlistFragment; //private BufferListAdapter m_adapter; /** Called when the activity is first created. */ @SuppressLint("NewApi") @Override ======= private ListView bufferlist; private BufferListAdapter m_adapter; private HotlistListAdapter hotlistListAdapter; private static final boolean DEVELOPER_MODE = true; // todo: maven to configure this variable private SocketToggleConnection taskToggleConnection; /** Called when the activity is first created. */ @Override >>>>>>> /*private ListView bufferlist; private BufferListAdapter m_adapter; private HotlistListAdapter hotlistListAdapter;*/ private static final boolean DEVELOPER_MODE = true; // todo: maven to configure this variable private SocketToggleConnection taskToggleConnection; /** Called when the activity is first created. */ @Override <<<<<<< // Check whether the activity is using the layout version with // the fragment_container FrameLayout. If so, we must add the first fragment if (findViewById(R.id.fragment_container) != null) { // However, if we're being restored from a previous state, // then we don't need to do anything and should return or else // we could end up with overlapping fragments. // FIXME if (savedInstanceState != null) { return; } BufferListFragment bufferlistFragment = new BufferListFragment(); // In case this activity was started with special instructions from an Intent, // pass the Intent's extras to the fragment as arguments bufferlistFragment.setArguments(getIntent().getExtras()); // Add the fragment to the 'fragment_container' FrameLayout getSupportFragmentManager().beginTransaction() .add(R.id.fragment_container, bufferlistFragment).commit(); } //Log.d(TAG, "onCreate() bflf" + bufferlistFragment); ======= bufferlist = (ListView) this.findViewById(R.id.bufferlist_list); bufferlist.setOnItemClickListener(this); // See also code in the onDisconnect handler(its a copy/paste) String[] message = {"Press Menu->Connect to get started"}; bufferlist.setAdapter(new ArrayAdapter<String>(WeechatActivity.this, R.layout.tips_list_item, message)); // Start the service(if necessary) startService(new Intent(this, RelayService.class)); >>>>>>> // Check whether the activity is using the layout version with // the fragment_container FrameLayout. If so, we must add the first fragment if (findViewById(R.id.fragment_container) != null) { // However, if we're being restored from a previous state, // then we don't need to do anything and should return or else // we could end up with overlapping fragments. // FIXME if (savedInstanceState != null) { return; } BufferListFragment bufferlistFragment = new BufferListFragment(); // In case this activity was started with special instructions from an Intent, // pass the Intent's extras to the fragment as arguments bufferlistFragment.setArguments(getIntent().getExtras()); // Add the fragment to the 'fragment_container' FrameLayout getSupportFragmentManager().beginTransaction() .add(R.id.fragment_container, bufferlistFragment).commit(); } //Log.d(TAG, "onCreate() bflf" + bufferlistFragment); <<<<<<< @Override // Build the options menu public boolean onPrepareOptionsMenu(Menu menu) { menu.clear(); if (getRsb() != null && getRsb().isConnected()) menu.add("Disconnect"); else menu.add("Connect"); menu.add("Preferences"); menu.add("About"); menu.add("Quit"); return super.onPrepareOptionsMenu(menu); } @Override // Handle the options when the user presses the Menu key public boolean onOptionsItemSelected(MenuItem item) { String s = (String) item.getTitle(); if (s.equals("Quit")) { if (getRsb() != null)getRsb().shutdown(); unbindService(mConnection); mBound = false; stopService(new Intent(this, RelayService.class)); finish(); } else if (s.equals("Disconnect")) { if (getRsb() != null)getRsb().shutdown(); } else if (s.equals("Connect")) { if (getRsb() != null)getRsb().connect(); } else if (s.equals("About")) { Intent i = new Intent(this, WeechatAboutActivity.class); startActivity(i); } else if (s.equals("Preferences")) { Intent i = new Intent(this, WeechatPreferencesActivity.class); startActivity(i); } return true; } ======= >>>>>>> <<<<<<< runOnUiThread(new Runnable() { @Override public void run() { BufferListAdapter m_adapter = new BufferListAdapter(WeechatActivity.this, getRsb()); Log.d(TAG, "onConnect m_adapter:" + m_adapter); Log.d(TAG, "onConnect bfl:" + bfl); //bfl.getListAdapter().onBuffersChanged(); // In porttrait mode FIXME this should probably live somewhere else if(bfl==null) { BufferListFragment bflnew = new BufferListFragment(); bflnew.setListAdapter(m_adapter); }else { bfl.setListAdapter(m_adapter); } m_adapter.onBuffersChanged(); } }); ======= m_adapter = new BufferListAdapter(WeechatActivity.this, rsb); // Create and update the hotlist hotlistListAdapter = new HotlistListAdapter(WeechatActivity.this, rsb); this.runOnUiThread(new Runnable() { @Override public void run() { bufferlist.setAdapter(m_adapter); m_adapter.onBuffersChanged(); /*hotlistManager = rsb.getHotlistManager(); hotlistManager.onChanged(WeechatActivity.this);*/ } }); >>>>>>> runOnUiThread(new Runnable() { @Override public void run() { BufferListAdapter m_adapter = new BufferListAdapter(WeechatActivity.this, getRsb()); /*// Create and update the hotlist hotlistListAdapter = new HotlistListAdapter(WeechatActivity.this, rsb);*/ Log.d(TAG, "onConnect m_adapter:" + m_adapter); Log.d(TAG, "onConnect bfl:" + bfl); //bfl.getListAdapter().onBuffersChanged(); // In porttrait mode FIXME this should probably live somewhere else if(bfl==null) { BufferListFragment bflnew = new BufferListFragment(); bflnew.setListAdapter(m_adapter); }else { bfl.setListAdapter(m_adapter); } m_adapter.onBuffersChanged(); } }); <<<<<<< ======= m_adapter = null; hotlistListAdapter = null; >>>>>>> <<<<<<< public RelayServiceBinder getRServiceB() { return getRsb(); } public void onBufferSelected(int position, Buffer buffer) { // The user selected the buffer from the BufferlistFragment Log.d(TAG, "onBufferSelected() position:" + position + " buffer:" + buffer ); // Capture the buffer fragment from the activity layout BufferFragment bufferFrag = (BufferFragment) getSupportFragmentManager().findFragmentById(R.id.buffer_fragment); if (bufferFrag != null) { // If buffer frag is available, we're in two-pane layout... // Call a method in the BufferFragment to update its content bufferFrag.updateBufferView(position, buffer.getFullName()); } else { // If the frag is not available, we're in the one-pane layout and must swap frags... // Create fragment and give it an argument for the selected article BufferFragment newFragment = new BufferFragment(); Bundle args = new Bundle(); args.putInt(BufferFragment.ARG_POSITION, position); args.putString("buffer", buffer.getFullName()); newFragment.setArguments(args); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); // Replace whatever is in the fragment_container view with this fragment, // and add the transaction to the back stack so the user can navigate back transaction.replace(R.id.fragment_container, newFragment); transaction.addToBackStack(null); // Commit the transaction transaction.commit(); } } /** * getter for the service binder, used by the BufferFragment * @return rsb */ public RelayServiceBinder getRsb() { return rsb; } public void setRsb(RelayServiceBinder rsb) { this.rsb = rsb; } ======= protected class SocketToggleConnection extends AsyncTask<Void, Void, Boolean> { @Override protected Boolean doInBackground(Void... voids) { if (rsb.isConnected()) rsb.shutdown(); else return rsb.connect(); return false; } @Override protected void onPostExecute(Boolean success) { supportInvalidateOptionsMenu(); } } >>>>>>> protected class SocketToggleConnection extends AsyncTask<Void, Void, Boolean> { @Override protected Boolean doInBackground(Void... voids) { if (rsb.isConnected()) rsb.shutdown(); else return rsb.connect(); return false; } @Override protected void onPostExecute(Boolean success) { supportInvalidateOptionsMenu(); } }
<<<<<<< clusterCommands.createCluster("cluster1", null, "samples/cluster_hadoop.spec", null, null, null, false, false, false); ======= clusterCommands.createCluster("cluster1", null, "HADOOP", "hadoop_cluster.json", null, null, null, false, false, false); } @Test public void testCreateHbaseClusterBySpecFile() throws Exception { NetworkRead[] networks = new NetworkRead[1]; NetworkRead network = new NetworkRead(); network.setName("dhcp"); network.setDhcp(true); network.setPortGroup("pg1"); networks[0] = network; ObjectMapper mapper = new ObjectMapper(); buildReqRespWithoutReqBody("http://127.0.0.1:8080/serengeti/api/networks", HttpMethod.GET, HttpStatus.OK, mapper.writeValueAsString(networks)); DistroRead distro = new DistroRead(); distro.setName(Constants.DEFAULT_DISTRO); List<String> roles = new ArrayList<String>(); roles.add("hadoop"); roles.add("hadoop_namenode"); roles.add("hadoop_jobtracker"); roles.add("hbase_master"); roles.add("hadoop_worker"); roles.add("hadoop_datanode"); roles.add("hadoop_tasktracker"); roles.add("hbase_regionserver"); roles.add("hadoop_client"); roles.add("hive"); roles.add("hive_server"); roles.add("pig"); roles.add("hbase_client"); roles.add("zookeeper"); distro.setRoles(roles); buildReqRespWithoutReqBody("http://127.0.0.1:8080/serengeti/api/distro/" + Constants.DEFAULT_DISTRO, HttpMethod.GET, HttpStatus.OK, mapper.writeValueAsString(distro)); buildReqRespWithoutReqBody("http://127.0.0.1:8080/serengeti/api/clusters", HttpMethod.POST, HttpStatus.NO_CONTENT, ""); clusterCommands.createCluster("cluster1", null, "HADOOP", "hadoop_cluster.json", null, null, null, false, false, false); >>>>>>> clusterCommands.createCluster("cluster1", null, "hadoop_cluster.json", null, null, null, false, false, false); } @Test public void testCreateHbaseClusterBySpecFile() throws Exception { NetworkRead[] networks = new NetworkRead[1]; NetworkRead network = new NetworkRead(); network.setName("dhcp"); network.setDhcp(true); network.setPortGroup("pg1"); networks[0] = network; ObjectMapper mapper = new ObjectMapper(); buildReqRespWithoutReqBody("http://127.0.0.1:8080/serengeti/api/networks", HttpMethod.GET, HttpStatus.OK, mapper.writeValueAsString(networks)); DistroRead distro = new DistroRead(); distro.setName(Constants.DEFAULT_DISTRO); List<String> roles = new ArrayList<String>(); roles.add("hadoop"); roles.add("hadoop_namenode"); roles.add("hadoop_jobtracker"); roles.add("hbase_master"); roles.add("hadoop_worker"); roles.add("hadoop_datanode"); roles.add("hadoop_tasktracker"); roles.add("hbase_regionserver"); roles.add("hadoop_client"); roles.add("hive"); roles.add("hive_server"); roles.add("pig"); roles.add("hbase_client"); roles.add("zookeeper"); distro.setRoles(roles); buildReqRespWithoutReqBody("http://127.0.0.1:8080/serengeti/api/distro/" + Constants.DEFAULT_DISTRO, HttpMethod.GET, HttpStatus.OK, mapper.writeValueAsString(distro)); buildReqRespWithoutReqBody("http://127.0.0.1:8080/serengeti/api/clusters", HttpMethod.POST, HttpStatus.NO_CONTENT, ""); clusterCommands.createCluster("cluster1", null, "hadoop_cluster.json", null, null, null, false, false, false);
<<<<<<< public void validateNodeGroupNames() { if (nodeGroups != null && nodeGroups.length > 0) { StringBuffer invalidNodeGroupNames = new StringBuffer(); for (NodeGroupCreate nodeGroup : nodeGroups) { if (CommonUtil.isBlank(nodeGroup.getName()) || !CommonUtil.validateNodeGroupName(nodeGroup.getName())) { invalidNodeGroupNames.append("'").append(nodeGroup.getName()) .append("'").append(","); } } if (invalidNodeGroupNames.length() > 0) { invalidNodeGroupNames.delete(invalidNodeGroupNames.length() - 1, invalidNodeGroupNames.length()); throw ClusterConfigException .NODE_GROUP_NAME_IS_INVALID(invalidNodeGroupNames.toString()); } } else { throw ClusterConfigException.NODE_GROUP_NOT_EXISTING(); } } ======= public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } >>>>>>> public void validateNodeGroupNames() { if (nodeGroups != null && nodeGroups.length > 0) { StringBuffer invalidNodeGroupNames = new StringBuffer(); for (NodeGroupCreate nodeGroup : nodeGroups) { if (CommonUtil.isBlank(nodeGroup.getName()) || !CommonUtil.validateNodeGroupName(nodeGroup.getName())) { invalidNodeGroupNames.append("'").append(nodeGroup.getName()) .append("'").append(","); } } if (invalidNodeGroupNames.length() > 0) { invalidNodeGroupNames.delete(invalidNodeGroupNames.length() - 1, invalidNodeGroupNames.length()); throw ClusterConfigException .NODE_GROUP_NAME_IS_INVALID(invalidNodeGroupNames.toString()); } } else { throw ClusterConfigException.NODE_GROUP_NOT_EXISTING(); } } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; }
<<<<<<< public static <ApiType extends KubernetesObject> KubectlDelete<ApiType> delete( Class<ApiType> clazz) { return new KubectlDelete<ApiType>(clazz); } ======= public static <ApiType extends KubernetesObject> KubectlReplace<ApiType> replace( Class<ApiType> clazz) { return new KubectlReplace<ApiType>(clazz); } >>>>>>> public static <ApiType extends KubernetesObject> KubectlDelete<ApiType> delete( Class<ApiType> clazz) { return new KubectlDelete<ApiType>(clazz); } public static <ApiType extends KubernetesObject> KubectlReplace<ApiType> replace( Class<ApiType> clazz) { return new KubectlReplace<ApiType>(clazz); }
<<<<<<< import android.graphics.PointF; import android.util.Log; ======= import android.util.Log; >>>>>>> import android.graphics.PointF; import android.util.Log; <<<<<<< ======= >>>>>>> <<<<<<< float x = 0; float y = 0; boolean success = false; try { y = event.getY(mActivePointerId); x = event.getX(mActivePointerId); success = true; } catch (IllegalArgumentException e) { Log.e(getClass().getSimpleName(), "Exception in onTouch(view, event) : " + mActivePointerId); ======= float x = 0; float y = 0; boolean success = false; try { x = event.getX(mActivePointerId); y = event.getY(mActivePointerId); success = true; } catch (IllegalArgumentException e) { Log.e(TAG, "Exception in onTouch(view, event) : "+mActivePointerId, e); >>>>>>> float x = 0; float y = 0; boolean success = false; try { x = event.getX(mActivePointerId); y = event.getY(mActivePointerId); success = true; } catch (IllegalArgumentException e) { Log.w(TAG, "Exception in onTouch(view, event) : " + mActivePointerId, e); <<<<<<< if (success) { // Remember where we started aDownTouchX = x; aDownTouchY = y; //to prevent an initial jump of the magnifier, aposX and aPosY must //have the values from the magnifier frame if (aPosX == 0) { aPosX = frame.getX(); } if (aPosY == 0) { aPosY = frame.getY(); } if (y < objectH / 2) { touchPosition = TOUCH_ABOVE; } else { touchPosition = TOUCH_BELOW; } ======= if (y < objectH / 2) { touchPosition = TOUCH_ABOVE; } else { touchPosition = TOUCH_BELOW; } >>>>>>> if (y < objectH / 2) { touchPosition = TOUCH_ABOVE; } else { touchPosition = TOUCH_BELOW; }
<<<<<<< import com.sandbox.runtime.models.RuntimeResponse; import com.sandbox.runtime.models.http.HTTPRequest; import com.sandbox.runtime.models.http.HTTPRouteDetails; import com.sandbox.runtime.models.http.HttpRuntimeRequest; import com.sandbox.runtime.models.http.HttpRuntimeResponse; ======= >>>>>>> import com.sandbox.runtime.models.RuntimeResponse; import com.sandbox.runtime.models.http.HTTPRequest; import com.sandbox.runtime.models.http.HTTPRouteDetails; import com.sandbox.runtime.models.http.HttpRuntimeRequest; import com.sandbox.runtime.models.http.HttpRuntimeResponse; <<<<<<< HTTPRequest runtimeRequest = serviceConverter.fromInstanceHttpRequest(runtimeService.getSandboxScriptEngine().getEngine(), instanceRequest); RuntimeResponse runtimeResponse = runtimeService.handleRequest(sandboxId, sandboxId, runtimeRequest); ======= HTTPRequest httpRequest = serviceConverter.fromInstanceHttpRequest(runtimeService.getSandboxScriptEngine().getEngine(), runtimeRequest); HttpRuntimeResponse runtimeResponse = null; if("options".equalsIgnoreCase(httpRequest.getMethod())){ //if options request, send back CORS headers runtimeResponse = new HttpRuntimeResponse("", 200, new HashMap<>(), new ArrayList<>()); runtimeResponse.getHeaders().put("Access-Control-Allow-Methods", "GET,POST,PUT,DELETE,OPTIONS"); runtimeResponse.getHeaders().put("Access-Control-Allow-Origin", httpRequest.getHeaders().getOrDefault("Origin", "*")); runtimeResponse.getHeaders().put("Access-Control-Allow-Headers", httpRequest.getHeaders().getOrDefault("Access-Control-Request-Headers", "Content-Type")); runtimeResponse.getHeaders().put("Access-Control-Allow-Credentials", "true"); }else{ //otherwise process normally runtimeResponse = runtimeService.handleRequest(sandboxId, sandboxId, httpRequest); } >>>>>>> HTTPRequest httpRequest = serviceConverter.fromInstanceHttpRequest(runtimeService.getSandboxScriptEngine().getEngine(), runtimeRequest); HttpRuntimeResponse runtimeResponse = null; if("options".equalsIgnoreCase(httpRequest.method())){ //if options request, send back CORS headers runtimeResponse = new HttpRuntimeResponse("", 200, new HashMap<>(), new ArrayList<>()); runtimeResponse.getHeaders().put("Access-Control-Allow-Methods", "GET,POST,PUT,DELETE,OPTIONS"); runtimeResponse.getHeaders().put("Access-Control-Allow-Origin", httpRequest.getHeaders().getOrDefault("Origin", "*")); runtimeResponse.getHeaders().put("Access-Control-Allow-Headers", httpRequest.getHeaders().getOrDefault("Access-Control-Request-Headers", "Content-Type")); runtimeResponse.getHeaders().put("Access-Control-Allow-Credentials", "true"); }else{ //otherwise process normally runtimeResponse = (HttpRuntimeResponse) runtimeService.handleRequest(sandboxId, sandboxId, httpRequest); }
<<<<<<< EngineRequest req; EngineResponse res; ======= HTTPRequest req; HTTPResponse res; SandboxScriptObject scriptObject = new SandboxScriptObject(); NashornUtils nashornUtils; private boolean initialized = false; >>>>>>> EngineRequest req; EngineResponse res; SandboxScriptObject scriptObject = new SandboxScriptObject(); NashornUtils nashornUtils; private boolean initialized = false; <<<<<<< public List<RuntimeResponse> handleRequest(String sandboxId, String fullSandboxId, EngineRequest req) { this.sandboxId = sandboxId; this.fullSandboxId = fullSandboxId; ======= public NashornUtils getNashornUtils() { return nashornUtils; } public void initialize() throws Exception { if(initialized) return; initialized = true; loadContext(); setState(); loadService(); } public HttpRuntimeResponse handleRequest(HTTPRequest req) { >>>>>>> public NashornUtils getNashornUtils() { return nashornUtils; } public void initialize() throws Exception { if(initialized) return; initialized = true; loadContext(); setState(); loadService(); } public List<RuntimeResponse> handleRequest(HTTPRequest req) { <<<<<<< logger.info("Engine: " + sandboxScriptEngine.hashCode() + " - Exception handling the request: " + e.getMessage(), e); return Arrays.asList(req._getErrorResponse(error)); ======= logger.info("Exception handling the request: " + e.getMessage(), e); return new HttpRuntimeResponse(error); >>>>>>> logger.info("Exception handling the request: " + e.getMessage(), e); return Arrays.asList(req._getErrorResponse(error)); <<<<<<< private List<RuntimeResponse> postProcessContext(Sandbox sandbox, NashornUtils nashornUtils) throws Exception { // verify match was found if (!sandbox.isMatched()) { // the requested path and method. throw req._getNoRouteDefinitionException(); } ======= private HttpRuntimeResponse postProcessContext() throws Exception { >>>>>>> private List<RuntimeResponse> postProcessContext() throws Exception { <<<<<<< ======= locals.put("res", templateLocals); locals.put("req", req); locals.put("data", templateLocals); locals.put("__nashornUtils", getNashornUtils()); >>>>>>>
<<<<<<< ======= public String getMethod() { return method == null ? "" : method; } public void setMethod(String method) { this.method = method; } public String getPath() { return path == null ? "" : path; } public void setPath(String path) { this.path = path; } >>>>>>> public String getMethod() { return method == null ? "" : method; } public void setMethod(String method) { this.method = method; } public String getPath() { return path == null ? "" : path; } public void setPath(String path) { this.path = path; } <<<<<<< public abstract boolean matchesRoute(RouteDetails otherRoute); ======= //if paths are exactly the same then match if (getPath().equals(url)) return true; >>>>>>> public abstract boolean matchesRoute(RouteDetails otherRoute);
<<<<<<< HTTPRouteDetails routeMatch = findMatchedRoute(runtimeRequest, routingTable); ======= MatchedRouteDetails routeMatch = findMatchedRoute(runtimeRequest, routingTable); //if no route match for given request, then log message and send error response. if(routeMatch == null){ logger.warn("** Error processing request for {} {} - Invalid route", runtimeRequest.getMethod(), runtimeRequest.getPath() == null ? request.getRequestURI() : runtimeRequest.getPath()); response.setStatus(500); response.setHeader("Content-Type","application/json"); response.getWriter().write(convertExceptionMessageToResponse("Invalid route")); return; } >>>>>>> HTTPRouteDetails routeMatch = findMatchedRoute(runtimeRequest, routingTable); //if no route match for given request, then log message and send error response. if(routeMatch == null){ logger.warn("** Error processing request for {} {} - Invalid route", runtimeRequest.getMethod(), runtimeRequest.getPath() == null ? request.getRequestURI() : runtimeRequest.getPath()); response.setStatus(500); response.setHeader("Content-Type","application/json"); response.getWriter().write(convertExceptionMessageToResponse("Invalid route")); return; } <<<<<<< private HTTPRouteDetails findMatchedRoute(HttpRuntimeRequest request, RoutingTable table) throws Exception { HTTPRouteDetails match = (HTTPRouteDetails) table.findMatch(request); if(match == null){ throw new Exception("Invalid route"); } ======= private MatchedRouteDetails findMatchedRoute(HttpRuntimeRequest request, RoutingTable table) throws Exception { MatchedRouteDetails match = table.findMatch(request.getMethod(), request.getUrl(), request.getHeaders()); if(match == null) return null; >>>>>>> private HTTPRouteDetails findMatchedRoute(HttpRuntimeRequest request, RoutingTable table) throws Exception { HTTPRouteDetails match = (HTTPRouteDetails) table.findMatch(request); if(match == null) return null;
<<<<<<< import com.sandbox.runtime.models.MetadataService; import com.sandbox.runtime.models.RuntimeVersion; ======= >>>>>>> import com.sandbox.runtime.models.MetadataService; import com.sandbox.runtime.models.RuntimeVersion;
<<<<<<< import com.sandbox.runtime.models.ActivityMessage; import com.sandbox.runtime.models.ActivityMessageTypeEnum; import com.sandbox.runtime.models.Cache; ======= >>>>>>> import com.sandbox.runtime.models.ActivityMessage; import com.sandbox.runtime.models.ActivityMessageTypeEnum;
<<<<<<< private List<RuntimeResponse> postProcessContext(Sandbox sandbox) throws Exception { ======= private HttpRuntimeResponse postProcessContext(Sandbox sandbox, INashornUtils nashornUtils) throws Exception { >>>>>>> private List<RuntimeResponse> postProcessContext(Sandbox sandbox, INashornUtils nashornUtils) throws Exception {
<<<<<<< import com.cf.client.wss.handler.LoggerMessageHandler; ======= import com.cf.client.wss.handler.OrderBookMessageHandler; >>>>>>> <<<<<<< public static void main(String[] args) { try { new PoloniexWSSClientExample().run(); } catch (InterruptedException ex) { LOG.info(ex.getMessage()); System.exit(0); } catch (Exception ex) { ======= public static void main(String[] args) { try { new PoloniexWSSClientExample().subscribe(); } catch (InterruptedException ex) { LOG.info(ex.getMessage()); System.exit(0); } catch (Exception ex) { >>>>>>> public static void main(String[] args) { try { new PoloniexWSSClientExample().subscribe(); } catch (InterruptedException ex) { LOG.info(ex.getMessage()); System.exit(0); } catch (Exception ex) { { LOG.info(ex.getMessage()); System.exit(0); } <<<<<<< public void run() throws Exception { try (WSSClient wssClient = new WSSClient(ENDPOINT_URL)) { wssClient.addSubscription(PoloniexWSSSubscription.USDT_ETH, new LoggerMessageHandler()); ======= public void subscribe() throws Exception { try (WSSClient wssClient = new WSSClient(ENDPOINT_URL)) { wssClient.addSubscription(PoloniexWSSSubscription.USDT_ETH, new OrderBookMessageHandler()); >>>>>>> public void subscribe() throws Exception { try (WSSClient wssClient = new WSSClient(ENDPOINT_URL)) {
<<<<<<< import org.jdom.Attribute; import org.jdom.Document; ======= import org.jdom2.Attribute; import org.jdom2.Document; import org.jdom2.input.SAXBuilder; >>>>>>> import org.jdom2.Attribute; import org.jdom2.Document;
<<<<<<< import org.jdom.Document; import org.jdom.Element; import org.jdom.Namespace; ======= import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.Namespace; import org.jdom2.input.SAXBuilder; >>>>>>> import org.jdom2.Document; import org.jdom2.Element; import org.jdom2.Namespace;
<<<<<<< import java.util.concurrent.*; ======= import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; >>>>>>> import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import org.apache.commons.configuration.BaseConfiguration; import org.apache.commons.configuration.Configuration; import org.junit.After; import org.junit.Assert; import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.collect.ImmutableList; import com.thinkaurelius.titan.diskstorage.idmanagement.ConsistentKeyIDManager; import com.thinkaurelius.titan.diskstorage.idmanagement.TransactionalIDManager; import com.thinkaurelius.titan.diskstorage.keycolumnvalue.ConsistencyLevel; import com.thinkaurelius.titan.diskstorage.keycolumnvalue.Entry; import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KCVSUtil; import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStore; import com.thinkaurelius.titan.diskstorage.keycolumnvalue.KeyColumnValueStoreManager; import com.thinkaurelius.titan.diskstorage.keycolumnvalue.StaticBufferEntry; import com.thinkaurelius.titan.diskstorage.keycolumnvalue.StoreFeatures; import com.thinkaurelius.titan.diskstorage.keycolumnvalue.StoreTransaction; import com.thinkaurelius.titan.diskstorage.locking.LockingException; import com.thinkaurelius.titan.diskstorage.locking.PermanentLockingException; import com.thinkaurelius.titan.diskstorage.locking.consistentkey.ConsistentKeyLockConfiguration; import com.thinkaurelius.titan.diskstorage.locking.consistentkey.ConsistentKeyLockStore; import com.thinkaurelius.titan.diskstorage.locking.consistentkey.ConsistentKeyLockTransaction; import com.thinkaurelius.titan.diskstorage.locking.consistentkey.LocalLockMediators; import com.thinkaurelius.titan.diskstorage.locking.transactional.TransactionalLockStore; import com.thinkaurelius.titan.graphdb.configuration.GraphDatabaseConfiguration; <<<<<<< ======= private final String concreteClassName; private static final Logger log = LoggerFactory.getLogger(LockKeyColumnValueStoreTest.class); public LockKeyColumnValueStoreTest() { concreteClassName = getClass().getSimpleName(); } >>>>>>> private final String concreteClassName; public LockKeyColumnValueStoreTest() { concreteClassName = getClass().getSimpleName(); } <<<<<<< for (int i = 0; i < CONCURRENCY; i++) { if (MANAGERS[i] == null) continue; MANAGERS[i].clearStorage(); reopenIDAuthority(i); } k = KeyValueStoreUtil.getBuffer("key"); ======= openStorageManager(0).clearStorage(); for (int i = 0; i < concurrency; i++) { LocalLockMediators.INSTANCE.clear(concreteClassName + i); } open(); k = KeyValueStoreUtil.getBuffer("key"); >>>>>>> openStorageManager(0).clearStorage(); for (int i = 0; i < CONCURRENCY; i++) { LocalLockMediators.INSTANCE.clear(concreteClassName + i); } open(); k = KeyValueStoreUtil.getBuffer("key"); <<<<<<< for (int i = 0; i < CONCURRENCY; i++) { ls[i] = new LockStressor(getManager(i), getStore(i), stressComplete, lockOperationsPerThread, KeyColumnValueStoreUtil.longToByteBuffer(i)); ======= for (int i = 0; i < concurrency; i++) { ls[i] = new LockStressor(manager[i], store[i], stressComplete, lockOperationsPerThread, KeyColumnValueStoreUtil.longToByteBuffer(i)); >>>>>>> for (int i = 0; i < CONCURRENCY; i++) { ls[i] = new LockStressor(manager[i], store[i], stressComplete, lockOperationsPerThread, KeyColumnValueStoreUtil.longToByteBuffer(i)); <<<<<<< // Catch & log exceptions, then pass to the starter thread ======= // Catch & log exceptions >>>>>>> // Catch & log exceptions <<<<<<< logger.error("Unexpected locking-related exception", t); ======= log.error("Unexpected locking-related exception on iteration " + (opIndex + 1) + "/" + opCount, t); >>>>>>> log.error("Unexpected locking-related exception on iteration " + (opIndex + 1) + "/" + opCount, t);
<<<<<<< "left join fetch page.relatedToPosts relatedToPosts " + "left join fetch page.relatedByPosts relatedByPosts "; ======= "left join fetch page.comments comment " + "left join fetch page.relatedPosts relatedPost "; >>>>>>> "left join fetch page.relatedToPosts relatedToPosts " + "left join fetch page.relatedByPosts relatedByPosts "; "left join fetch page.comments comment " + "left join fetch page.relatedPosts relatedPost ";
<<<<<<< case TIMESTAMP: return element.getColumn().getTimestamp(); case TTL: return Long.valueOf(element.getColumn().getTtl()); default: throw new UnsupportedOperationException("Unsupported meta data: " + meta); ======= case TIMESTAMP: return element.getColumn().getTimestamp(); case TTL: return (long) element.getColumn().getTtl(); default: return null; >>>>>>> case TIMESTAMP: return element.getColumn().getTimestamp(); case TTL: return (long) element.getColumn().getTtl(); default: throw new UnsupportedOperationException("Unsupported meta data: " + meta);
<<<<<<< DataSetBuilder<String, LocalDate> dataSetBuilder = new DataSetBuilder<String, LocalDate>(); // Modified by Aditi Rajawat, changed according to big decimal coverage type instead of float ======= DataSetBuilder<String, LocalDate> dataSetBuilder = new DataSetBuilder<>(); >>>>>>> DataSetBuilder<String, LocalDate> dataSetBuilder = new DataSetBuilder<>(); // Modified by Aditi Rajawat, changed according to big decimal coverage type instead of float
<<<<<<< // Test perform with build over build feature turned ON @Test public void testPerformWithBuildOverBuild() throws IOException, InterruptedException { // expect final Run run = PowerMock.createNiceMock(Run.class); final Job job = PowerMock.createNiceMock(Job.class); expect(run.getResult()).andReturn(Result.SUCCESS).anyTimes(); expect(run.getEnvironment(taskListener)).andReturn(new EnvVars()).anyTimes(); Action action = anyObject(); run.addAction(action); final AtomicReference<JacocoBuildAction> buildAction = new AtomicReference<JacocoBuildAction>(); expectLastCall().andAnswer(new IAnswer<Void>() { @Override public Void answer() throws Throwable { buildAction.set((JacocoBuildAction) getCurrentArguments()[0]); buildAction.get().onAttached(run); return null; } }); File dir = File.createTempFile("JaCoCoPublisherTest", ".tst"); assertTrue(dir.delete()); assertTrue(dir.mkdirs()); assertTrue(new File(dir, "jacoco/classes").mkdirs()); FilePath filePath = new FilePath(dir); expect(run.getRootDir()).andReturn(dir).anyTimes(); expect(run.getParent()).andReturn(job).anyTimes(); expect(job.getLastSuccessfulBuild()).andReturn(run).anyTimes(); PowerMock.replay(taskListener, run, job); // execute JacocoPublisher publisher = new JacocoPublisher("**/**.exec", "**/classes", "**/src/main/java", "", "", "0", "0" , "0", "0", "0", "0", "0", "0" , "0", "0", "0", "0", false, "10.564", "5.65", "9.995", "11.4529", "9.346", "5.237", true); publisher.perform(run, filePath, launcher, taskListener); assertNotNull(buildAction.get()); assertEquals("Build over build result", "SUCCESS", publisher.checkBuildOverBuildResult(run, taskListener.getLogger()).toString()); // verify PowerMock.verify(taskListener, run, job); } ======= @Test public void testSkipCopyOfSrcFilesTrue() throws IOException, InterruptedException{ final Run run = mock(Run.class); expect(run.getEnvironment(taskListener)).andReturn(new EnvVars()).anyTimes(); expect(run.getResult()).andReturn(Result.SUCCESS).anyTimes(); expect(run.getParent()).andReturn(null).anyTimes(); // create a test build directory File rootDir = File.createTempFile("BuildTest", ".tst"); assertTrue(rootDir.delete()); assertTrue(rootDir.mkdirs()); FilePath root = new FilePath(rootDir); expect(run.getRootDir()).andReturn(rootDir).anyTimes(); Action action = anyObject(); run.addAction(action); final AtomicReference<JacocoBuildAction> buildAction = new AtomicReference<>(); expectLastCall().andAnswer(new IAnswer<Void>() { @Override public Void answer() throws Throwable { buildAction.set((JacocoBuildAction) getCurrentArguments()[0]); buildAction.get().onAttached(run); return null; } }); replay(taskListener, run); // create a test workspace of Jenkins job File wksp = File.createTempFile("workspace", ".tst"); assertTrue(wksp.delete()); assertTrue(wksp.mkdir()); wksp.deleteOnExit(); FilePath workspace = new FilePath(wksp); // create class and source files directory inside the test workspace File d1 = new File(workspace.child("classes").getRemote()); assertTrue(d1.mkdir()); d1.deleteOnExit(); File testClass = File.createTempFile("Test", ".class", d1); assertTrue(testClass.delete()); assertTrue(testClass.mkdir()); testClass.deleteOnExit(); File d2 = new File(workspace.child("java").getRemote()); assertTrue(d2.mkdir()); d2.deleteOnExit(); File testSrc = File.createTempFile("Test", ".java", d2); assertTrue(testSrc.delete()); assertTrue(testSrc.mkdir()); testSrc.deleteOnExit(); // set skip copy of src files as true JacocoPublisher publisher = new JacocoPublisher("**/**.exec", "**/classes", "**/java", null, null, true, null, null , null, null, null, null, null, null , null, null, null, null, false); publisher.perform(run, workspace, launcher, taskListener); // verify if jacoco/sources doesn't exists File jacocoSrc = new File(rootDir, "jacoco/sources"); Assert.assertFalse(jacocoSrc.exists() && jacocoSrc.isDirectory()); verify(taskListener, run); } @Test public void testSkipCopyOfSrcFilesFalse() throws IOException, InterruptedException{ final Run run = mock(Run.class); expect(run.getEnvironment(taskListener)).andReturn(new EnvVars()).anyTimes(); expect(run.getResult()).andReturn(Result.SUCCESS).anyTimes(); expect(run.getParent()).andReturn(null).anyTimes(); // create a test build directory File rootDir = File.createTempFile("BuildTest", ".tst"); assertTrue(rootDir.delete()); assertTrue(rootDir.mkdirs()); FilePath root = new FilePath(rootDir); expect(run.getRootDir()).andReturn(rootDir).anyTimes(); Action action = anyObject(); run.addAction(action); final AtomicReference<JacocoBuildAction> buildAction = new AtomicReference<>(); expectLastCall().andAnswer(new IAnswer<Void>() { @Override public Void answer() throws Throwable { buildAction.set((JacocoBuildAction) getCurrentArguments()[0]); buildAction.get().onAttached(run); return null; } }); replay(taskListener, run); // create a test workspace of Jenkins job File wksp = File.createTempFile("workspace", ".tst"); assertTrue(wksp.delete()); assertTrue(wksp.mkdir()); wksp.deleteOnExit(); FilePath workspace = new FilePath(wksp); // create class and source files directory inside the test workspace File d1 = new File(workspace.child("classes").getRemote()); assertTrue(d1.mkdir()); d1.deleteOnExit(); File testClass = File.createTempFile("Test", ".class", d1); assertTrue(testClass.delete()); assertTrue(testClass.mkdir()); testClass.deleteOnExit(); File d2 = new File(workspace.child("java").getRemote()); assertTrue(d2.mkdir()); d2.deleteOnExit(); File testSrc = File.createTempFile("Test", ".java", d2); assertTrue(testSrc.delete()); assertTrue(testSrc.mkdir()); testSrc.deleteOnExit(); // set skip copy of src files as false JacocoPublisher publisher = new JacocoPublisher("**/**.exec", "**/classes", "**/java", null, null, false, null, null , null, null, null, null, null, null , null, null, null, null, false); publisher.perform(run, workspace, launcher, taskListener); // verify if jacoco/sources exists File jacocoSrc = new File(rootDir, "jacoco/sources"); assertTrue(jacocoSrc.exists() && jacocoSrc.isDirectory()); verify(taskListener, run); } >>>>>>> @Test public void testSkipCopyOfSrcFilesTrue() throws IOException, InterruptedException{ final Run run = mock(Run.class); expect(run.getEnvironment(taskListener)).andReturn(new EnvVars()).anyTimes(); expect(run.getResult()).andReturn(Result.SUCCESS).anyTimes(); expect(run.getParent()).andReturn(null).anyTimes(); // create a test build directory File rootDir = File.createTempFile("BuildTest", ".tst"); assertTrue(rootDir.delete()); assertTrue(rootDir.mkdirs()); FilePath root = new FilePath(rootDir); expect(run.getRootDir()).andReturn(rootDir).anyTimes(); Action action = anyObject(); run.addAction(action); final AtomicReference<JacocoBuildAction> buildAction = new AtomicReference<>(); expectLastCall().andAnswer(new IAnswer<Void>() { @Override public Void answer() throws Throwable { buildAction.set((JacocoBuildAction) getCurrentArguments()[0]); buildAction.get().onAttached(run); return null; } }); replay(taskListener, run); // create a test workspace of Jenkins job File wksp = File.createTempFile("workspace", ".tst"); assertTrue(wksp.delete()); assertTrue(wksp.mkdir()); wksp.deleteOnExit(); FilePath workspace = new FilePath(wksp); // create class and source files directory inside the test workspace File d1 = new File(workspace.child("classes").getRemote()); assertTrue(d1.mkdir()); d1.deleteOnExit(); File testClass = File.createTempFile("Test", ".class", d1); assertTrue(testClass.delete()); assertTrue(testClass.mkdir()); testClass.deleteOnExit(); File d2 = new File(workspace.child("java").getRemote()); assertTrue(d2.mkdir()); d2.deleteOnExit(); File testSrc = File.createTempFile("Test", ".java", d2); assertTrue(testSrc.delete()); assertTrue(testSrc.mkdir()); testSrc.deleteOnExit(); // set skip copy of src files as true JacocoPublisher publisher = new JacocoPublisher("**/**.exec", "**/classes", "**/java", null, null, true, null, null , null, null, null, null, null, null , null, null, null, null, false , null, null, null, null, null, null, false); publisher.perform(run, workspace, launcher, taskListener); // verify if jacoco/sources doesn't exists File jacocoSrc = new File(rootDir, "jacoco/sources"); Assert.assertFalse(jacocoSrc.exists() && jacocoSrc.isDirectory()); verify(taskListener, run); } @Test public void testSkipCopyOfSrcFilesFalse() throws IOException, InterruptedException{ final Run run = mock(Run.class); expect(run.getEnvironment(taskListener)).andReturn(new EnvVars()).anyTimes(); expect(run.getResult()).andReturn(Result.SUCCESS).anyTimes(); expect(run.getParent()).andReturn(null).anyTimes(); // create a test build directory File rootDir = File.createTempFile("BuildTest", ".tst"); assertTrue(rootDir.delete()); assertTrue(rootDir.mkdirs()); FilePath root = new FilePath(rootDir); expect(run.getRootDir()).andReturn(rootDir).anyTimes(); Action action = anyObject(); run.addAction(action); final AtomicReference<JacocoBuildAction> buildAction = new AtomicReference<>(); expectLastCall().andAnswer(new IAnswer<Void>() { @Override public Void answer() throws Throwable { buildAction.set((JacocoBuildAction) getCurrentArguments()[0]); buildAction.get().onAttached(run); return null; } }); replay(taskListener, run); // create a test workspace of Jenkins job File wksp = File.createTempFile("workspace", ".tst"); assertTrue(wksp.delete()); assertTrue(wksp.mkdir()); wksp.deleteOnExit(); FilePath workspace = new FilePath(wksp); // create class and source files directory inside the test workspace File d1 = new File(workspace.child("classes").getRemote()); assertTrue(d1.mkdir()); d1.deleteOnExit(); File testClass = File.createTempFile("Test", ".class", d1); assertTrue(testClass.delete()); assertTrue(testClass.mkdir()); testClass.deleteOnExit(); File d2 = new File(workspace.child("java").getRemote()); assertTrue(d2.mkdir()); d2.deleteOnExit(); File testSrc = File.createTempFile("Test", ".java", d2); assertTrue(testSrc.delete()); assertTrue(testSrc.mkdir()); testSrc.deleteOnExit(); // set skip copy of src files as false JacocoPublisher publisher = new JacocoPublisher("**/**.exec", "**/classes", "**/java", null, null, false, null, null , null, null, null, null, null, null , null, null, null, null, false , null, null, null, null, null, null, false); publisher.perform(run, workspace, launcher, taskListener); // verify if jacoco/sources exists File jacocoSrc = new File(rootDir, "jacoco/sources"); assertTrue(jacocoSrc.exists() && jacocoSrc.isDirectory()); verify(taskListener, run); } // Test perform with build over build feature turned ON @Test public void testPerformWithBuildOverBuild() throws IOException, InterruptedException { // expect final Run run = PowerMock.createNiceMock(Run.class); final Job job = PowerMock.createNiceMock(Job.class); expect(run.getResult()).andReturn(Result.SUCCESS).anyTimes(); expect(run.getEnvironment(taskListener)).andReturn(new EnvVars()).anyTimes(); Action action = anyObject(); run.addAction(action); final AtomicReference<JacocoBuildAction> buildAction = new AtomicReference<JacocoBuildAction>(); expectLastCall().andAnswer(new IAnswer<Void>() { @Override public Void answer() throws Throwable { buildAction.set((JacocoBuildAction) getCurrentArguments()[0]); buildAction.get().onAttached(run); return null; } }); File dir = File.createTempFile("JaCoCoPublisherTest", ".tst"); assertTrue(dir.delete()); assertTrue(dir.mkdirs()); assertTrue(new File(dir, "jacoco/classes").mkdirs()); FilePath filePath = new FilePath(dir); expect(run.getRootDir()).andReturn(dir).anyTimes(); expect(run.getParent()).andReturn(job).anyTimes(); expect(job.getLastSuccessfulBuild()).andReturn(run).anyTimes(); PowerMock.replay(taskListener, run, job); // execute JacocoPublisher publisher = new JacocoPublisher("**/**.exec", "**/classes", "**/src/main/java", "", "", false, "0", "0" , "0", "0", "0", "0", "0", "0" , "0", "0", "0", "0", false, "10.564", "5.65", "9.995", "11.4529", "9.346", "5.237", true); publisher.perform(run, filePath, launcher, taskListener); assertNotNull(buildAction.get()); assertEquals("Build over build result", "SUCCESS", publisher.checkBuildOverBuildResult(run, taskListener.getLogger()).toString()); // verify PowerMock.verify(taskListener, run, job); }
<<<<<<< int maxEnergyStored = tileEntity.getMaxEnergyStored(); energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(10, 6, 9, 59)).setShowText(false); ======= int maxEnergyStored = tileEntity.getMaxEnergyStored(EnumFacing.DOWN); energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(10, 6, 8, 59)).setShowText(false); >>>>>>> int maxEnergyStored = tileEntity.getMaxEnergyStored(); energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(10, 6, 9, 59)).setShowText(false); int maxEnergyStored = tileEntity.getMaxEnergyStored(EnumFacing.DOWN); energyBar = new EnergyBar(mc, this).setVertical().setMaxValue(maxEnergyStored).setLayoutHint(new PositionalLayout.PositionalHint(10, 6, 8, 59)).setShowText(false);
<<<<<<< private void renderFaces(Tessellator tessellator, final BufferBuilder buffer, ======= // private void renderFacesVBO(Tessellator tessellator, final VertexBuffer buffer, // ItemStack stack, boolean showMat) { // if (vboBuffer == null) { // vboBuffer = new VertexBuffer(2097152); // } // buffer // } // private void renderFaces(Tessellator tessellator, final VertexBuffer buffer, >>>>>>> // private void renderFacesVBO(Tessellator tessellator, final VertexBuffer buffer, // ItemStack stack, boolean showMat) { // if (vboBuffer == null) { // vboBuffer = new VertexBuffer(2097152); // } // buffer // } // private void renderFaces(Tessellator tessellator, final VertexBuffer buffer, private void renderFaces(Tessellator tessellator, final BufferBuilder buffer,
<<<<<<< import mcjty.lib.network.PacketUpdateNBTItem; ======= import mcjty.lib.network.PacketUpdateNBTItemInventory; import mcjty.lib.tools.ItemStackTools; import mcjty.lib.tools.MinecraftTools; import mcjty.rftools.blocks.shaper.GuiComposer; import mcjty.rftools.blocks.shaper.ComposerTileEntity; import mcjty.rftools.network.PacketOpenGui; >>>>>>> import mcjty.lib.network.PacketUpdateNBTItem; import mcjty.lib.network.PacketUpdateNBTItemInventory; import mcjty.lib.tools.ItemStackTools; import mcjty.lib.tools.MinecraftTools; import mcjty.rftools.blocks.shaper.GuiComposer; import mcjty.rftools.blocks.shaper.ComposerTileEntity; import mcjty.rftools.network.PacketOpenGui; <<<<<<< shapeLabel = new ChoiceLabel(mc, this).setDesiredWidth(100).setDesiredHeight(16).addChoices( ShapeCardItem.Shape.SHAPE_BOX.getDescription(), ShapeCardItem.Shape.SHAPE_TOPDOME.getDescription(), ShapeCardItem.Shape.SHAPE_BOTTOMDOME.getDescription(), ShapeCardItem.Shape.SHAPE_SPHERE.getDescription(), ShapeCardItem.Shape.SHAPE_CYLINDER.getDescription(), ShapeCardItem.Shape.SHAPE_CAPPEDCYLINDER.getDescription(), ShapeCardItem.Shape.SHAPE_PRISM.getDescription(), ShapeCardItem.Shape.SHAPE_TORUS.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDBOX.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDSPHERE.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDCYLINDER.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDTORUS.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDTOPDOME.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDBOTTOMDOME.getDescription()).addChoiceEvent((parent, newChoice) -> updateSettings()); ItemStack heldItem = mc.player.getHeldItem(EnumHand.MAIN_HAND); if (heldItem.isEmpty()) { ======= this.guiLeft = (this.width - this.xSize) / 2; this.guiTop = (this.height - this.ySize) / 2; ShapeRenderer.shapeCount = 0; ItemStack heldItem = getStackToEdit(); if (ItemStackTools.isEmpty(heldItem)) { >>>>>>> shapeLabel = new ChoiceLabel(mc, this).setDesiredWidth(100).setDesiredHeight(16).addChoices( ShapeCardItem.Shape.SHAPE_BOX.getDescription(), ShapeCardItem.Shape.SHAPE_TOPDOME.getDescription(), ShapeCardItem.Shape.SHAPE_BOTTOMDOME.getDescription(), ShapeCardItem.Shape.SHAPE_SPHERE.getDescription(), ShapeCardItem.Shape.SHAPE_CYLINDER.getDescription(), ShapeCardItem.Shape.SHAPE_CAPPEDCYLINDER.getDescription(), ShapeCardItem.Shape.SHAPE_PRISM.getDescription(), ShapeCardItem.Shape.SHAPE_TORUS.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDBOX.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDSPHERE.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDCYLINDER.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDTORUS.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDTOPDOME.getDescription(), ShapeCardItem.Shape.SHAPE_SOLIDBOTTOMDOME.getDescription()).addChoiceEvent((parent, newChoice) -> updateSettings()); ItemStack heldItem = mc.player.getHeldItem(EnumHand.MAIN_HAND); if (heldItem.isEmpty()) { this.guiLeft = (this.width - this.xSize) / 2; this.guiTop = (this.height - this.ySize) / 2; ShapeRenderer.shapeCount = 0; ItemStack heldItem = getStackToEdit(); if (ItemStackTools.isEmpty(heldItem)) {
<<<<<<< // Slot slot = inventorySlots.getSlot(ScannerContainer.SLOT_OUT); // if (slot.getHasStack()) { // ItemStack stack = slot.getStack(); if (!stack.isEmpty()) { int cnt = countFilters(); if (cnt != filterCnt) { filterCnt = cnt; move(0, 0, 0); } shapeRenderer.renderShape(this, stack, guiLeft, guiTop, showAxis.isPressed(), showOuter.isPressed(), showMat.isPressed()); // } ======= if (ItemStackTools.isValid(stack)) { int cnt = countFilters(); if (cnt != filterCnt) { filterCnt = cnt; move(0, 0, 0); } getShapeRenderer().setShapeID(getShapeID()); getShapeRenderer().renderShape(this, stack, guiLeft, guiTop, showAxis.isPressed(), showOuter.isPressed(), showScan.isPressed(), false); >>>>>>> if (!stack.isEmpty()) { int cnt = countFilters(); if (cnt != filterCnt) { filterCnt = cnt; move(0, 0, 0); } getShapeRenderer().setShapeID(getShapeID()); getShapeRenderer().renderShape(this, stack, guiLeft, guiTop, showAxis.isPressed(), showOuter.isPressed(), showScan.isPressed(), false);
<<<<<<< public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { ======= public void clAddInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) { super.clAddInformation(stack, playerIn, tooltip, advanced); tooltip.add("RFTools basic manual"); } @Override protected ActionResult<ItemStack> clOnItemRightClick(World world, EntityPlayer player, EnumHand hand) { >>>>>>> public void clAddInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) { super.clAddInformation(stack, playerIn, tooltip, advanced); tooltip.add("RFTools basic manual"); } @Override public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) {
<<<<<<< column.setTimestamp(timestamp.getAdditionTime(times.getUnit())); if (null != ent.getTtl() && ent.getTtl() > 0) { column.setTtl(ent.getTtl()); } ======= column.setTimestamp(commitTime.getAdditionTime(times.getUnit())); >>>>>>> column.setTimestamp(commitTime.getAdditionTime(times.getUnit())); if (null != ent.getTtl() && ent.getTtl() > 0) { column.setTtl(ent.getTtl()); }
<<<<<<< scan.save(getWorld(), getScanId()); if (renderStack.isEmpty()) { ======= scan.save(getScanId()); if (ItemStackTools.isEmpty(renderStack)) { >>>>>>> scan.save(getWorld(), getScanId()); if (renderStack.isEmpty()) { scan.save(getScanId()); if (ItemStackTools.isEmpty(renderStack)) {
<<<<<<< import mcjty.rftools.blocks.shaper.ScannerConfiguration; ======= import mcjty.lib.tools.ItemStackTools; import mcjty.rftools.blocks.shaper.ScannerConfiguration; >>>>>>> import mcjty.rftools.blocks.shaper.ScannerConfiguration; import mcjty.lib.tools.ItemStackTools; import mcjty.rftools.blocks.shaper.ScannerConfiguration; <<<<<<< BufferBuilder buffer = tessellator.getBuffer(); boolean doSound = renderFaces(tessellator, buffer, stack, scan); ======= VertexBuffer buffer = tessellator.getBuffer(); boolean doSound = renderFaces(tessellator, buffer, stack, scan, shape.isGrayscale(), shape.getScanId()); >>>>>>> BufferBuilder buffer = tessellator.getBuffer(); boolean doSound = renderFaces(tessellator, buffer, stack, scan); VertexBuffer buffer = tessellator.getBuffer(); boolean doSound = renderFaces(tessellator, buffer, stack, scan, shape.isGrayscale(), shape.getScanId()); <<<<<<< private boolean renderFaces(Tessellator tessellator, final BufferBuilder buffer, ItemStack stack, boolean showScan) { ======= private boolean renderFaces(Tessellator tessellator, final VertexBuffer buffer, ItemStack stack, boolean showScan, boolean grayscale, int scanId) { >>>>>>> private boolean renderFaces(Tessellator tessellator, final BufferBuilder buffer, ItemStack stack, boolean showScan) { private boolean renderFaces(Tessellator tessellator, final VertexBuffer buffer, ItemStack stack, boolean showScan, boolean grayscale, int scanId) { <<<<<<< private void createRenderData(Tessellator tessellator, BufferBuilder buffer, RenderData.RenderPlane plane, RenderData data) { ======= private void createRenderData(Tessellator tessellator, VertexBuffer buffer, RenderData.RenderPlane plane, RenderData data, boolean grayscale) { >>>>>>> private void createRenderData(Tessellator tessellator, BufferBuilder buffer, RenderData.RenderPlane plane, RenderData data) { private void createRenderData(Tessellator tessellator, VertexBuffer buffer, RenderData.RenderPlane plane, RenderData data, boolean grayscale) { <<<<<<< ======= public static void addSideD(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(l, l, l).color(r, g, b, a).endVertex(); buffer.pos(h, l, l).color(r, g, b, a).endVertex(); buffer.pos(h, l, h).color(r, g, b, a).endVertex(); buffer.pos(l, l, h).color(r, g, b, a).endVertex(); } public static void addSideU(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(l, h, h).color(r, g, b, a).endVertex(); buffer.pos(h, h, h).color(r, g, b, a).endVertex(); buffer.pos(h, h, l).color(r, g, b, a).endVertex(); buffer.pos(l, h, l).color(r, g, b, a).endVertex(); } public static void addSideE(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, l, l).color(r, g, b, a).endVertex(); buffer.pos(h, h, l).color(r, g, b, a).endVertex(); buffer.pos(h, h, h).color(r, g, b, a).endVertex(); buffer.pos(h, l, h).color(r, g, b, a).endVertex(); } public static void addSideW(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(l, l, h).color(r, g, b, a).endVertex(); buffer.pos(l, h, h).color(r, g, b, a).endVertex(); buffer.pos(l, h, l).color(r, g, b, a).endVertex(); buffer.pos(l, l, l).color(r, g, b, a).endVertex(); } public static void addSideN(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, h, l).color(r, g, b, a).endVertex(); buffer.pos(h, l, l).color(r, g, b, a).endVertex(); buffer.pos(l, l, l).color(r, g, b, a).endVertex(); buffer.pos(l, h, l).color(r, g, b, a).endVertex(); } public static void addSideS(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, l, h).color(r, g, b, a).endVertex(); buffer.pos(h, h, h).color(r, g, b, a).endVertex(); buffer.pos(l, h, h).color(r, g, b, a).endVertex(); buffer.pos(l, l, h).color(r, g, b, a).endVertex(); } public static void addSideE(VertexBuffer buffer, float r, float g, float b, float size, float height) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, 0, l).color(r, g, b, a).endVertex(); buffer.pos(h, height, l).color(r, g, b, a).endVertex(); buffer.pos(h, height, h).color(r, g, b, a).endVertex(); buffer.pos(h, 0, h).color(r, g, b, a).endVertex(); } public static void addSideW(VertexBuffer buffer, float r, float g, float b, float size, float height) { float a = 0.5f; float l = -size; float h = size; buffer.pos(l, 0, h).color(r, g, b, a).endVertex(); buffer.pos(l, height, h).color(r, g, b, a).endVertex(); buffer.pos(l, height, l).color(r, g, b, a).endVertex(); buffer.pos(l, 0, l).color(r, g, b, a).endVertex(); } public static void addSideN(VertexBuffer buffer, float r, float g, float b, float size, float height) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, height, l).color(r, g, b, a).endVertex(); buffer.pos(h, 0, l).color(r, g, b, a).endVertex(); buffer.pos(l, 0, l).color(r, g, b, a).endVertex(); buffer.pos(l, height, l).color(r, g, b, a).endVertex(); } public static void addSideS(VertexBuffer buffer, float r, float g, float b, float size, float height) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, 0, h).color(r, g, b, a).endVertex(); buffer.pos(h, height, h).color(r, g, b, a).endVertex(); buffer.pos(l, height, h).color(r, g, b, a).endVertex(); buffer.pos(l, 0, h).color(r, g, b, a).endVertex(); } >>>>>>> public static void addSideD(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(l, l, l).color(r, g, b, a).endVertex(); buffer.pos(h, l, l).color(r, g, b, a).endVertex(); buffer.pos(h, l, h).color(r, g, b, a).endVertex(); buffer.pos(l, l, h).color(r, g, b, a).endVertex(); } public static void addSideU(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(l, h, h).color(r, g, b, a).endVertex(); buffer.pos(h, h, h).color(r, g, b, a).endVertex(); buffer.pos(h, h, l).color(r, g, b, a).endVertex(); buffer.pos(l, h, l).color(r, g, b, a).endVertex(); } public static void addSideE(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, l, l).color(r, g, b, a).endVertex(); buffer.pos(h, h, l).color(r, g, b, a).endVertex(); buffer.pos(h, h, h).color(r, g, b, a).endVertex(); buffer.pos(h, l, h).color(r, g, b, a).endVertex(); } public static void addSideW(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(l, l, h).color(r, g, b, a).endVertex(); buffer.pos(l, h, h).color(r, g, b, a).endVertex(); buffer.pos(l, h, l).color(r, g, b, a).endVertex(); buffer.pos(l, l, l).color(r, g, b, a).endVertex(); } public static void addSideN(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, h, l).color(r, g, b, a).endVertex(); buffer.pos(h, l, l).color(r, g, b, a).endVertex(); buffer.pos(l, l, l).color(r, g, b, a).endVertex(); buffer.pos(l, h, l).color(r, g, b, a).endVertex(); } public static void addSideS(VertexBuffer buffer, float r, float g, float b, float size) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, l, h).color(r, g, b, a).endVertex(); buffer.pos(h, h, h).color(r, g, b, a).endVertex(); buffer.pos(l, h, h).color(r, g, b, a).endVertex(); buffer.pos(l, l, h).color(r, g, b, a).endVertex(); } public static void addSideE(VertexBuffer buffer, float r, float g, float b, float size, float height) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, 0, l).color(r, g, b, a).endVertex(); buffer.pos(h, height, l).color(r, g, b, a).endVertex(); buffer.pos(h, height, h).color(r, g, b, a).endVertex(); buffer.pos(h, 0, h).color(r, g, b, a).endVertex(); } public static void addSideW(VertexBuffer buffer, float r, float g, float b, float size, float height) { float a = 0.5f; float l = -size; float h = size; buffer.pos(l, 0, h).color(r, g, b, a).endVertex(); buffer.pos(l, height, h).color(r, g, b, a).endVertex(); buffer.pos(l, height, l).color(r, g, b, a).endVertex(); buffer.pos(l, 0, l).color(r, g, b, a).endVertex(); } public static void addSideN(VertexBuffer buffer, float r, float g, float b, float size, float height) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, height, l).color(r, g, b, a).endVertex(); buffer.pos(h, 0, l).color(r, g, b, a).endVertex(); buffer.pos(l, 0, l).color(r, g, b, a).endVertex(); buffer.pos(l, height, l).color(r, g, b, a).endVertex(); } public static void addSideS(VertexBuffer buffer, float r, float g, float b, float size, float height) { float a = 0.5f; float l = -size; float h = size; buffer.pos(h, 0, h).color(r, g, b, a).endVertex(); buffer.pos(h, height, h).color(r, g, b, a).endVertex(); buffer.pos(l, height, h).color(r, g, b, a).endVertex(); buffer.pos(l, 0, h).color(r, g, b, a).endVertex(); }
<<<<<<< ======= ModItems.initClient(); ModBlocks.initClient(); ElevatorSounds.init(); ProjectorSounds.init(); >>>>>>>
<<<<<<< import mcjty.rftools.varia.ItemStackTools; ======= import mcjty.rftools.varia.Check32; >>>>>>> import mcjty.rftools.varia.ItemStackTools; import mcjty.rftools.varia.Check32; <<<<<<< GlobalCoordinate scannerPos = ShapeCardItem.getData(compound); if (scannerPos == null) { player.sendStatusMessage(new TextComponentString(TextFormatting.RED + "This card is not linked to a scanner!"), false); return; } World world = DimensionManager.getWorld(scannerPos.getDimension()); if (world == null || !world.isBlockLoaded(scannerPos.getCoordinate())) { player.sendStatusMessage(new TextComponentString(TextFormatting.RED + "The scanner is out of reach or not chunkloaded!"), false); return; } TileEntity te = world.getTileEntity(scannerPos.getCoordinate()); if (!(te instanceof ScannerTileEntity)) { player.sendStatusMessage(new TextComponentString(TextFormatting.RED + "Not a valid scanner!"), false); ======= int scanId = ShapeCardItem.getData(compound); if (scanId == 0) { ChatTools.addChatMessage(player, new TextComponentString(TextFormatting.RED + "This card is not linked to scan data!")); >>>>>>> int scanId = ShapeCardItem.getData(compound); if (scanId == 0) { ChatTools.addChatMessage(player, new TextComponentString(TextFormatting.RED + "This card is not linked to scan data!"));
<<<<<<< import mcjty.rftools.blocks.shaper.LocatorBlock; import mcjty.rftools.blocks.shaper.ProjectorBlock; import mcjty.rftools.blocks.shaper.ScannerBlock; import mcjty.rftools.blocks.shaper.ComposerBlock; import mcjty.rftools.blocks.shaper.ScannerBlock; ======= import mcjty.rftools.blocks.shaper.*; import mcjty.rftools.crafting.PreservingShapedOreRecipe; import mcjty.rftools.crafting.PreservingShapedRecipe; import mcjty.rftools.items.ModItems; >>>>>>> import mcjty.rftools.blocks.shaper.LocatorBlock; import mcjty.rftools.blocks.shaper.ProjectorBlock; import mcjty.rftools.blocks.shaper.ScannerBlock; import mcjty.rftools.blocks.shaper.ComposerBlock; import mcjty.rftools.blocks.shaper.ScannerBlock; import mcjty.rftools.blocks.shaper.*; import mcjty.rftools.crafting.PreservingShapedOreRecipe; import mcjty.rftools.crafting.PreservingShapedRecipe; import mcjty.rftools.items.ModItems; <<<<<<< ======= public static void initCrafting() { Block redstoneTorch = Blocks.REDSTONE_TORCH; GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(spaceChamberBlock), "lgl", "gMg", "lgl", 'M', ModBlocks.machineFrame, 'g', Blocks.GLASS, 'l', "dyeBlue")); GameRegistry.addRecipe(new ItemStack(spaceChamberControllerBlock), " e ", "tMt", " e ", 'M', spaceChamberBlock, 't', redstoneTorch, 'e', Items.ENDER_PEARL); if (GeneralConfiguration.enableBuilderRecipe) { GameRegistry.addRecipe(new ItemStack(builderBlock), "beb", "rMr", "brb", 'M', ModBlocks.machineFrame, 'e', Items.ENDER_PEARL, 'r', Items.REDSTONE, 'b', Blocks.BRICK_BLOCK); } GameRegistry.addRecipe(new ItemStack(composerBlock), "pbp", "bMb", "pbp", 'M', ModBlocks.machineFrame, 'p', Items.PAPER, 'b', Items.BRICK); GameRegistry.addRecipe(new ItemStack(scannerBlock), "beb", "qMq", "brb", 'M', ModBlocks.machineFrame, 'r', Items.REDSTONE, 'b', ModItems.infusedDiamond, 'e', Items.ENDER_PEARL, 'q', Items.QUARTZ); GameRegistry.addRecipe(new ItemStack(remoteScannerBlock), "iii", "iMi", "iii", 'M', scannerBlock, 'i', ModItems.infusedEnderpearl); GameRegistry.addRecipe(new ItemStack(locatorBlock), "heh", "qMq", "brb", 'M', ModBlocks.machineFrame, 'r', Items.REDSTONE, 'b', ModItems.infusedDiamond, 'e', Items.ENDER_PEARL, 'q', Items.QUARTZ, 'h', Items.COMPARATOR); GameRegistry.addRecipe(new ItemStack(projectorBlock), "beb", "qMq", "brb", 'M', ModBlocks.machineFrame, 'r', Items.REDSTONE, 'b', ModItems.infusedDiamond, 'e', Blocks.GLASS, 'q', Items.GLOWSTONE_DUST); GameRegistry.addRecipe(new ItemStack(spaceChamberCardItem), " b ", "rir", " b ", 'r', Items.REDSTONE, 'i', Items.IRON_INGOT, 'b', Items.BRICK); if (BuilderConfiguration.shapeCardAllowed) { GameRegistry.addRecipe(new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_SHAPE), "pbp", "rir", "pbp", 'r', Items.REDSTONE, 'i', Items.IRON_INGOT, 'b', Items.BRICK, 'p', Items.PAPER); if (BuilderConfiguration.quarryAllowed) { GameRegistry.addRecipe(new PreservingShapedOreRecipe( new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_VOID), 4, "ioi", "omo", "ioi", 'i', "dyeBlack", 'o', Blocks.OBSIDIAN, 'm', new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_SHAPE))); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(Items.REDSTONE), new ItemStack(Items.WATER_BUCKET), new ItemStack(Items.REDSTONE), new ItemStack(Items.BUCKET), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_SHAPE), new ItemStack(Items.BUCKET), new ItemStack(Items.REDSTONE), new ItemStack(Items.LAVA_BUCKET), new ItemStack(Items.REDSTONE) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_PUMP), 4)); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(Items.REDSTONE), new ItemStack(Items.WATER_BUCKET), new ItemStack(Items.REDSTONE), new ItemStack(Items.IRON_INGOT), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_SHAPE), new ItemStack(Items.IRON_INGOT), new ItemStack(Items.REDSTONE), new ItemStack(Items.LAVA_BUCKET), new ItemStack(Items.REDSTONE) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_PUMP_LIQUID), 4)); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(Items.REDSTONE), new ItemStack(Items.DIAMOND_PICKAXE), new ItemStack(Items.REDSTONE), new ItemStack(Items.IRON_INGOT), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_SHAPE), new ItemStack(Items.IRON_INGOT), new ItemStack(Items.REDSTONE), new ItemStack(Items.DIAMOND_SHOVEL), new ItemStack(Items.REDSTONE) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY), 4)); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(ModItems.dimensionalShardItem), new ItemStack(Items.NETHER_STAR), new ItemStack(ModItems.dimensionalShardItem), new ItemStack(Items.DIAMOND), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY), new ItemStack(Items.DIAMOND), new ItemStack(ModItems.dimensionalShardItem), new ItemStack(Items.DIAMOND), new ItemStack(ModItems.dimensionalShardItem) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_SILK), 4)); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(ModItems.dimensionalShardItem), new ItemStack(Items.GHAST_TEAR), new ItemStack(ModItems.dimensionalShardItem), new ItemStack(Items.EMERALD), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY), new ItemStack(Items.DIAMOND), new ItemStack(ModItems.dimensionalShardItem), new ItemStack(Items.REDSTONE), new ItemStack(ModItems.dimensionalShardItem) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_FORTUNE), 4)); if (BuilderConfiguration.clearingQuarryAllowed) { GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_CLEAR), 4)); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_SILK), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_CLEAR_SILK), 4)); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_FORTUNE), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_CLEAR_FORTUNE), 4)); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_PUMP), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS), new ItemStack(Blocks.GLASS) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_PUMP_CLEAR), 4)); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_CLEAR), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY), 4)); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_CLEAR_SILK), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_SILK), 4)); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_CLEAR_FORTUNE), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_QUARRY_FORTUNE), 4)); GameRegistry.addRecipe(new PreservingShapedRecipe(3, 3, new ItemStack[]{ new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_PUMP_CLEAR), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT), new ItemStack(Blocks.DIRT) }, new ItemStack(shapeCardItem, 1, ShapeCardItem.CARD_PUMP), 4)); } } } } >>>>>>>
<<<<<<< import com.google.common.collect.AbstractIterator; import mcjty.lib.crafting.INBTPreservingIngredient; ======= import mcjty.lib.tools.ChatTools; import mcjty.lib.tools.ItemStackTools; >>>>>>> import com.google.common.collect.AbstractIterator; import mcjty.lib.crafting.INBTPreservingIngredient; import mcjty.lib.tools.ChatTools; import mcjty.lib.tools.ItemStackTools; <<<<<<< import mcjty.rftools.varia.ItemStackTools; ======= import mcjty.rftools.shapes.*; import mcjty.rftools.varia.RLE; >>>>>>> import mcjty.rftools.varia.ItemStackTools; import mcjty.rftools.shapes.*; import mcjty.rftools.varia.RLE; <<<<<<< public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { if (this.isInCreativeTab(tab)) { for (int i = 0; i <= 9; i++) { items.add(new ItemStack(this, 1, i)); } ======= protected void clGetSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { for (int i = 0 ; i <= 10 ; i++) { subItems.add(new ItemStack(this, 1, i)); >>>>>>> protected void clGetSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) { for (int i = 0 ; i <= 10 ; i++) { subItems.add(new ItemStack(this, 1, i)); public void getSubItems(CreativeTabs tab, NonNullList<ItemStack> items) { if (this.isInCreativeTab(tab)) { for (int i = 0; i <= 9; i++) { items.add(new ItemStack(this, 1, i)); }
<<<<<<< Slot slot = inventorySlots.getSlot(ScannerContainer.SLOT_OUT); if (slot.getHasStack()) { ItemStack stack = slot.getStack(); if (!stack.isEmpty()) { BlockPos offset = tileEntity.getDataOffset(); int offsetX = offset.getX() + x; int offsetY = offset.getY() + y; int offsetZ = offset.getZ() + z; sendServerCommand(network, ScannerTileEntity.CMD_SCAN, new Argument("offsetX", offsetX), new Argument("offsetY", offsetY), new Argument("offsetZ", offsetZ)); } } ======= BlockPos offset = tileEntity.getDataOffset(); int offsetX = offset.getX() + x; int offsetY = offset.getY() + y; int offsetZ = offset.getZ() + z; sendServerCommand(network, ScannerTileEntity.CMD_SETOFFSET, new Argument("offsetX", offsetX), new Argument("offsetY", offsetY), new Argument("offsetZ", offsetZ)); >>>>>>> Slot slot = inventorySlots.getSlot(ScannerContainer.SLOT_OUT); if (slot.getHasStack()) { ItemStack stack = slot.getStack(); if (!stack.isEmpty()) { BlockPos offset = tileEntity.getDataOffset(); int offsetX = offset.getX() + x; int offsetY = offset.getY() + y; int offsetZ = offset.getZ() + z; sendServerCommand(network, ScannerTileEntity.CMD_SCAN, new Argument("offsetX", offsetX), new Argument("offsetY", offsetY), new Argument("offsetZ", offsetZ)); } } BlockPos offset = tileEntity.getDataOffset(); int offsetX = offset.getX() + x; int offsetY = offset.getY() + y; int offsetZ = offset.getZ() + z; sendServerCommand(network, ScannerTileEntity.CMD_SETOFFSET, new Argument("offsetX", offsetX), new Argument("offsetY", offsetY), new Argument("offsetZ", offsetZ));
<<<<<<< private ItemStack renderStack = ItemStack.EMPTY; ======= // Transient data that is used during the scan. private ScanProgress progress = null; // Client side indication if there is a scan in progress private int progressBusy = -1; >>>>>>> // Transient data that is used during the scan. private ScanProgress progress = null; // Client side indication if there is a scan in progress private int progressBusy = -1; private ItemStack renderStack = ItemStack.EMPTY; <<<<<<< @Override public boolean isEmpty() { return false; } public byte[] getData() { return data; ======= public int getScanId() { if (scanId == 0) { scanId = ScanDataManager.getScans().newScan(getWorld()); markDirtyQuick(); } return scanId; >>>>>>> @Override public boolean isEmpty() { return false; } public byte[] getData() { return data; public int getScanId() { if (scanId == 0) { scanId = ScanDataManager.getScans().newScan(getWorld()); markDirtyQuick(); } return scanId; <<<<<<< if (data != null && !cardOut.isEmpty()) { ======= if (ItemStackTools.isValid(cardOut)) { >>>>>>> if (!cardOut.isEmpty()) { <<<<<<< if (getStackInSlot(ScannerContainer.SLOT_IN).isEmpty()) { // Cannot scan. No input card ======= if (progress != null) { >>>>>>> if (progress != null) {
<<<<<<< if (stack.isEmpty() || stack.getItem() == null) { ======= if (ItemStackTools.isValid(stack) && stack.getItem() == null) { >>>>>>> if (stack.isEmpty() || stack.getItem() == null) { if (ItemStackTools.isValid(stack) && stack.getItem() == null) {
<<<<<<< ======= import mcjty.lib.tools.ItemStackTools; import mcjty.lib.varia.RedstoneMode; import mcjty.rftools.blocks.builder.BuilderConfiguration; >>>>>>> import mcjty.lib.tools.ItemStackTools; import mcjty.lib.varia.RedstoneMode; import mcjty.rftools.blocks.builder.BuilderConfiguration; <<<<<<< if (!stack.isEmpty()) { scan(dataOffset.getX(), dataOffset.getY(), dataOffset.getZ()); ======= if (ItemStackTools.isValid(stack)) { updateScanCard(stack); } } if (index == ScannerContainer.SLOT_IN) { if (ItemStackTools.isValid(stack)) { dataDim = ShapeCardItem.getDimension(stack); >>>>>>> if (!stack.isEmpty()) { scan(dataOffset.getX(), dataOffset.getY(), dataOffset.getZ()); if (ItemStackTools.isValid(stack)) { updateScanCard(stack); } } if (index == ScannerContainer.SLOT_IN) { if (ItemStackTools.isValid(stack)) { dataDim = ShapeCardItem.getDimension(stack); <<<<<<< return ItemStack.EMPTY; ======= updateScanCard(renderStack); return renderStack; >>>>>>> return ItemStack.EMPTY; updateScanCard(renderStack); return renderStack; <<<<<<< if (!cardOut.isEmpty()) { if (locked) { ShapeCardItem.setDimension(cardOut, dataDim.getX(), dataDim.getY(), dataDim.getZ()); ShapeCardItem.setData(tagOut, getWorld().provider.getDimension(), getPos()); } else { dataOffset = new BlockPos(offsetX, offsetY, offsetZ); BlockPos dim = ShapeCardItem.getDimension(cardOut); int dimX = dim.getX(); int dimY = dim.getY(); int dimZ = dim.getZ(); scanArea(tagOut, getPos().add(offsetX, offsetY, offsetZ), dimX, dimY, dimZ); } ======= private void scan() { if (ItemStackTools.isEmpty(getStackInSlot(ScannerContainer.SLOT_IN))) { // Cannot scan. No input card return; >>>>>>> private void scan() { if (ItemStackTools.isEmpty(getStackInSlot(ScannerContainer.SLOT_IN))) { // Cannot scan. No input card return;
<<<<<<< ======= ModelLoaderRegistry.registerLoader(new BakedModelLoader()); ModItems.initClient(); ModBlocks.initClient(); ElevatorSounds.init(); >>>>>>> ModelLoaderRegistry.registerLoader(new BakedModelLoader());
<<<<<<< private CuratorFramework cf; @Inject private TestingServer ts; @Inject ======= private RequestHistoryHelper requestHistoryHelper; @Inject >>>>>>> <<<<<<< @Before public void setup() { Injector i = Guice.createInjector(new SingularityTestModule()); i.injectMembers(this); } @After public void teardown() throws Exception { cf.close(); ts.close(); } @SuppressWarnings("unchecked") ======= >>>>>>> @SuppressWarnings("unchecked")
<<<<<<< LOG.error("Caught throwable while saving health check result {}, will re-enqueue", result, t); exceptionNotifier.notify(t, ImmutableMap.of("taskId", task.getTaskId().toString())); ======= LOG.error("Caught throwable while saving health check result for {}, will re-enqueue", task.getTaskId(), t); exceptionNotifier.notify(t); >>>>>>> LOG.error("Caught throwable while saving health check result for {}, will re-enqueue", task.getTaskId(), t); exceptionNotifier.notify(t, ImmutableMap.of("taskId", task.getTaskId().toString())); <<<<<<< private void reEnqueueOrAbort(SingularityTask task) { try { healthchecker.enqueueHealthcheck(task); } catch (Throwable t) { LOG.error("Caught throwable while re-enqueuing health check for {}, aborting", task.getTaskId(), t); exceptionNotifier.notify(t, ImmutableMap.of("taskId", task.getTaskId().toString())); abort.abort(AbortReason.UNRECOVERABLE_ERROR, Optional.of(t)); } } ======= >>>>>>>
<<<<<<< ======= import java.io.IOException; import java.net.MalformedURLException; import java.util.Arrays; >>>>>>> import java.util.Arrays; <<<<<<< import org.apache.commons.lang3.tuple.Pair; ======= import javax.inject.Provider; >>>>>>> import javax.inject.Provider; import org.apache.commons.lang3.tuple.Pair; <<<<<<< public SingularityClient(@Named(SingularityClientModule.CONTEXT_PATH) String contextPath, @Named(SingularityClientModule.HTTP_CLIENT_NAME) HttpClient httpClient, @Named(SingularityClientModule.HOSTS_PROPERTY_NAME) String hosts) { ======= @Deprecated public SingularityClient(@Named(SingularityClientModule.CONTEXT_PATH) String contextPath, @Named(SingularityClientModule.HTTP_CLIENT_NAME) AsyncHttpClient httpClient, @Named(SingularityClientModule.OBJECT_MAPPER_NAME) ObjectMapper objectMapper, @Named(SingularityClientModule.HOSTS_PROPERTY_NAME) String hosts) { this(contextPath, httpClient, objectMapper, Arrays.asList(hosts.split(","))); } public SingularityClient(String contextPath, AsyncHttpClient httpClient, ObjectMapper objectMapper, List<String> hosts) { this(contextPath, httpClient, objectMapper, ProviderUtils.<List<String>>of(ImmutableList.copyOf(hosts))); } public SingularityClient(String contextPath, AsyncHttpClient httpClient, ObjectMapper objectMapper, Provider<List<String>> hostsProvider) { >>>>>>> @Deprecated public SingularityClient(@Named(SingularityClientModule.CONTEXT_PATH) String contextPath, @Named(SingularityClientModule.HTTP_CLIENT_NAME) HttpClient httpClient, @Named(SingularityClientModule.HOSTS_PROPERTY_NAME) String hosts) { this(contextPath, httpClient, Arrays.asList(hosts.split(","))); } public SingularityClient(String contextPath, HttpClient httpClient, List<String> hosts) { this(contextPath, httpClient, ProviderUtils.<List<String>>of(ImmutableList.copyOf(hosts))); } public SingularityClient(String contextPath, HttpClient httpClient, Provider<List<String>> hostsProvider) { <<<<<<< this.hosts = hosts.split(","); random = new Random(); ======= this.hostsProvider = hostsProvider; this.random = new Random(); >>>>>>> this.hostsProvider = hostsProvider; this.random = new Random();
<<<<<<< private final SlaveManager slaveManager; ======= private final DisasterManager disasterManager; >>>>>>> private final SlaveManager slaveManager; private final DisasterManager disasterManager; <<<<<<< SingularityAuthorizationHelper authorizationHelper, Optional<SingularityUser> user, RequestHelper requestHelper, SlaveManager slaveManager) { ======= SingularityAuthorizationHelper authorizationHelper, Optional<SingularityUser> user, RequestHelper requestHelper, DisasterManager disasterManager) { >>>>>>> SingularityAuthorizationHelper authorizationHelper, Optional<SingularityUser> user, RequestHelper requestHelper, DisasterManager disasterManager, SlaveManager slaveManager) { <<<<<<< this.slaveManager = slaveManager; ======= this.disasterManager = disasterManager; >>>>>>> this.slaveManager = slaveManager; this.disasterManager = disasterManager;
<<<<<<< public int getDefaultHealthcheckMaxRetries() { return defaultHealthcheckMaxRetries; } public void setDefaultHealthcheckMaxRetries(int defaultHealthcheckMaxRetries) { this.defaultHealthcheckMaxRetries = defaultHealthcheckMaxRetries; } ======= public Optional<Long> getMaxServiceLogSizeMb() { return maxServiceLogSizeMb; } public void setMaxServiceLogSizeMb(Optional<Long> maxServiceLogSizeMb) { this.maxServiceLogSizeMb = maxServiceLogSizeMb; } >>>>>>> public int getDefaultHealthcheckMaxRetries() { return defaultHealthcheckMaxRetries; } public void setDefaultHealthcheckMaxRetries(int defaultHealthcheckMaxRetries) { this.defaultHealthcheckMaxRetries = defaultHealthcheckMaxRetries; public Optional<Long> getMaxServiceLogSizeMb() { return maxServiceLogSizeMb; } public void setMaxServiceLogSizeMb(Optional<Long> maxServiceLogSizeMb) { this.maxServiceLogSizeMb = maxServiceLogSizeMb; }
<<<<<<< import org.apache.mesos.v1.Protos.AgentID; import org.apache.mesos.v1.Protos.Offer; import org.apache.mesos.v1.Protos.TaskID; import org.apache.mesos.v1.Protos.TaskState; import org.apache.mesos.v1.Protos.TaskStatus; ======= import org.apache.mesos.Protos.Offer; import org.apache.mesos.Protos.SlaveID; import org.apache.mesos.Protos.TaskID; import org.apache.mesos.Protos.TaskState; import org.apache.mesos.Protos.TaskStatus; import org.assertj.core.api.Assertions; >>>>>>> import org.apache.mesos.v1.Protos.AgentID; import org.apache.mesos.v1.Protos.Offer; import org.apache.mesos.v1.Protos.TaskID; import org.apache.mesos.v1.Protos.TaskState; import org.apache.mesos.v1.Protos.TaskStatus; import org.assertj.core.api.Assertions;
<<<<<<< Assert.assertTrue(requestResource.getActiveRequests(false, false, false, 10).isEmpty()); ======= Assert.assertTrue(requestResource.getActiveRequests(singularityUser, false).isEmpty()); >>>>>>> Assert.assertTrue(requestResource.getActiveRequests(singularityUser, false, false, false, 10).isEmpty()); <<<<<<< Assert.assertTrue(!requestResource.getActiveRequests(false, false, false, 10).isEmpty()); ======= Assert.assertTrue(!requestResource.getActiveRequests(singularityUser, false).isEmpty()); >>>>>>> Assert.assertTrue(!requestResource.getActiveRequests(singularityUser, false, false, false, 10).isEmpty());
<<<<<<< private Optional<Integer> expectedRacksCount = Optional.empty(); ======= @JsonProperty("crashLoop") private CrashLoopConfiguration crashLoopConfiguration = new CrashLoopConfiguration(); >>>>>>> private Optional<Integer> expectedRacksCount = Optional.empty(); @JsonProperty("crashLoop") private CrashLoopConfiguration crashLoopConfiguration = new CrashLoopConfiguration(); <<<<<<< public Optional<Integer> getExpectedRacksCount() { return expectedRacksCount; } public void setExpectedRacksCount(Optional<Integer> expectedRacksCount) { this.expectedRacksCount = expectedRacksCount; } ======= public CrashLoopConfiguration getCrashLoopConfiguration() { return crashLoopConfiguration; } public void setCrashLoopConfiguration(CrashLoopConfiguration crashLoopConfiguration) { this.crashLoopConfiguration = crashLoopConfiguration; } >>>>>>> public Optional<Integer> getExpectedRacksCount() { return expectedRacksCount; } public void setExpectedRacksCount(Optional<Integer> expectedRacksCount) { this.expectedRacksCount = expectedRacksCount; } public CrashLoopConfiguration getCrashLoopConfiguration() { return crashLoopConfiguration; } public void setCrashLoopConfiguration(CrashLoopConfiguration crashLoopConfiguration) { this.crashLoopConfiguration = crashLoopConfiguration; }
<<<<<<< import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.base.Function; ======= >>>>>>> import com.google.common.base.Function; <<<<<<< public static Function<SingularityRequestWithState, String> REQUEST_STATE_TO_REQUEST_ID = new Function<SingularityRequestWithState, String>() { @Override public String apply(SingularityRequestWithState input) { return input.getRequest().getId(); } }; public static SingularityRequestWithState fromBytes(byte[] bytes, ObjectMapper objectMapper) { try { return objectMapper.readValue(bytes, SingularityRequestWithState.class); } catch (IOException e) { throw new SingularityJsonException(e); } } ======= private final long timestamp; >>>>>>> private final long timestamp; public static Function<SingularityRequestWithState, String> REQUEST_STATE_TO_REQUEST_ID = new Function<SingularityRequestWithState, String>() { @Override public String apply(SingularityRequestWithState input) { return input.getRequest().getId(); } };
<<<<<<< @JsonProperty("slavePlacement") Optional<SlavePlacement> slavePlacement, @JsonProperty("scheduledExpectedRuntimeMillis") Optional<Long> scheduledExpectedRuntimeMillis, @JsonProperty("waitAtLeastMillisAfterTaskFinishesForReschedule") Optional<Long> waitAtLeastMillisAfterTaskFinishesForReschedule, @JsonProperty("group") Optional<String> group, @JsonProperty("readOnlyGroups") Optional<Set<String>> readOnlyGroups, @JsonProperty("skipHealthchecks") Optional<Boolean> skipHealthchecks) { ======= @JsonProperty("slavePlacement") Optional<SlavePlacement> slavePlacement, @JsonProperty("requiredSlaveAttributes") Optional<Map<String, String>> requiredSlaveAttributes, @JsonProperty("allowedSlaveAttributes") Optional<Map<String, String>> allowedSlaveAttributes, @JsonProperty("scheduledExpectedRuntimeMillis") Optional<Long> scheduledExpectedRuntimeMillis, @JsonProperty("waitAtLeastMillisAfterTaskFinishesForReschedule") Optional<Long> waitAtLeastMillisAfterTaskFinishesForReschedule, @JsonProperty("group") Optional<String> group, @JsonProperty("readOnlyGroups") Optional<Set<String>> readOnlyGroups, @JsonProperty("bounceAfterScale") Optional<Boolean> bounceAfterScale) { >>>>>>> @JsonProperty("slavePlacement") Optional<SlavePlacement> slavePlacement, @JsonProperty("scheduledExpectedRuntimeMillis") Optional<Long> scheduledExpectedRuntimeMillis, @JsonProperty("waitAtLeastMillisAfterTaskFinishesForReschedule") Optional<Long> waitAtLeastMillisAfterTaskFinishesForReschedule, @JsonProperty("group") Optional<String> group, @JsonProperty("readOnlyGroups") Optional<Set<String>> readOnlyGroups, @JsonProperty("bounceAfterScale") Optional<Boolean> bounceAfterScale, @JsonProperty("skipHealthchecks") Optional<Boolean> skipHealthchecks) { <<<<<<< this.skipHealthchecks = skipHealthchecks; ======= this.bounceAfterScale = bounceAfterScale; >>>>>>> this.bounceAfterScale = bounceAfterScale; this.skipHealthchecks = skipHealthchecks; <<<<<<< .setReadOnlyGroups(readOnlyGroups) .setSkipHealthchecks(skipHealthchecks); ======= .setReadOnlyGroups(readOnlyGroups) .setBounceAfterScale(bounceAfterScale); >>>>>>> .setReadOnlyGroups(readOnlyGroups) .setBounceAfterScale(bounceAfterScale) .setSkipHealthchecks(skipHealthchecks); <<<<<<< public Optional<Boolean> getSkipHealthchecks() { return skipHealthchecks; } ======= public Optional<Boolean> getBounceAfterScale() { return bounceAfterScale; } >>>>>>> public Optional<Boolean> getBounceAfterScale() { return bounceAfterScale; } public Optional<Boolean> getSkipHealthchecks() { return skipHealthchecks; }
<<<<<<< import com.hubspot.jackson.jaxrs.PropertyFilteringMessageBodyWriter; import com.hubspot.mesos.client.SingularityMesosClientModule; ======= >>>>>>> import com.hubspot.mesos.client.SingularityMesosClientModule; <<<<<<< public void initialize(Bootstrap<SingularityConfiguration> bootstrap) { GuiceBundle<SingularityConfiguration> guiceBundle = GuiceBundle.<SingularityConfiguration>newBuilder() .addModule(new SingularityServiceModule()) .addModule(new SingularityMesosClientModule()) .enableAutoConfig(getClass().getPackage().getName()) .setConfigClass(SingularityConfiguration.class) .build(Stage.DEVELOPMENT); ======= public void initialize(final Bootstrap<SingularityConfiguration> bootstrap) { final GuiceBundle<SingularityConfiguration> guiceBundle = GuiceBundle.defaultBuilder(SingularityConfiguration.class) .modules(new SingularityServiceModule()) .build(); >>>>>>> public void initialize(final Bootstrap<SingularityConfiguration> bootstrap) { final GuiceBundle<SingularityConfiguration> guiceBundle = GuiceBundle.defaultBuilder(SingularityConfiguration.class) .modules(new SingularityServiceModule(), new SingularityMesosClientModule()) .build();
<<<<<<< rackAffinity, slavePlacement, requiredSlaveAttributes, allowedSlaveAttributes, scheduledExpectedRuntimeMillis, waitAtLeastMillisAfterTaskFinishesForReschedule, group, readWriteGroups, readOnlyGroups, bounceAfterScale, skipHealthchecks, emailConfigurationOverrides, Optional.<Boolean>absent(), hideEvenNumberAcrossRacksHint, taskLogErrorRegex, taskLogErrorRegexCaseSensitive); ======= rackAffinity, slavePlacement, requiredSlaveAttributes, allowedSlaveAttributes, scheduledExpectedRuntimeMillis, waitAtLeastMillisAfterTaskFinishesForReschedule, group, readOnlyGroups, bounceAfterScale, skipHealthchecks, emailConfigurationOverrides, Optional.<Boolean>absent(), hideEvenNumberAcrossRacksHint, taskLogErrorRegex, taskLogErrorRegexCaseSensitive, taskPriorityLevel); >>>>>>> rackAffinity, slavePlacement, requiredSlaveAttributes, allowedSlaveAttributes, scheduledExpectedRuntimeMillis, waitAtLeastMillisAfterTaskFinishesForReschedule, group, readWriteGroups, readOnlyGroups, bounceAfterScale, skipHealthchecks, emailConfigurationOverrides, Optional.<Boolean>absent(), hideEvenNumberAcrossRacksHint, taskLogErrorRegex, taskLogErrorRegexCaseSensitive, taskPriorityLevel); <<<<<<< requiredSlaveAttributes, allowedSlaveAttributes, loadBalanced, group, readOnlyGroups, readWriteGroups, bounceAfterScale, skipHealthchecks, emailConfigurationOverrides, hideEvenNumberAcrossRacksHint, taskLogErrorRegex, taskLogErrorRegexCaseSensitive); ======= requiredSlaveAttributes, allowedSlaveAttributes, loadBalanced, group, readOnlyGroups, bounceAfterScale, skipHealthchecks, emailConfigurationOverrides, hideEvenNumberAcrossRacksHint, taskLogErrorRegex, taskLogErrorRegexCaseSensitive, taskPriorityLevel); >>>>>>> requiredSlaveAttributes, allowedSlaveAttributes, loadBalanced, group, readOnlyGroups, readWriteGroups, bounceAfterScale, skipHealthchecks, emailConfigurationOverrides, hideEvenNumberAcrossRacksHint, taskLogErrorRegex, taskLogErrorRegexCaseSensitive, taskPriorityLevel);
<<<<<<< SingularityDeployMarker deployMarker = new SingularityDeployMarker(requestId, deploy.getId(), now, deployUser); Optional<SingularityDeployProgress> deployProgress = Optional.absent(); if (request.isLongRunning()) { deployProgress = Optional.of(new SingularityDeployProgress( Math.min(deploy.getDeployRate().or(request.getInstancesSafe()), request.getInstancesSafe()), deploy.getDeployRate().or(request.getInstancesSafe()), deploy.getDeployStepWaitTimeSeconds().or(DEFAULT_DEPLOY_STEP_WAIT_TIME_SECONDS), false, System.currentTimeMillis())); } SingularityPendingDeploy pendingDeployObj = new SingularityPendingDeploy(deployMarker, Optional.<SingularityLoadBalancerUpdate> absent(), DeployState.WAITING, deployProgress); ======= SingularityDeployMarker deployMarker = new SingularityDeployMarker(requestId, deploy.getId(), now, deployUser, deployRequest.getMessage()); SingularityPendingDeploy pendingDeployObj = new SingularityPendingDeploy(deployMarker, Optional.<SingularityLoadBalancerUpdate> absent(), DeployState.WAITING); >>>>>>> SingularityDeployMarker deployMarker = new SingularityDeployMarker(requestId, deploy.getId(), now, deployUser, deployRequest.getMessage()); Optional<SingularityDeployProgress> deployProgress = Optional.absent(); if (request.isLongRunning()) { deployProgress = Optional.of(new SingularityDeployProgress( Math.min(deploy.getDeployRate().or(request.getInstancesSafe()), request.getInstancesSafe()), deploy.getDeployRate().or(request.getInstancesSafe()), deploy.getDeployStepWaitTimeSeconds().or(DEFAULT_DEPLOY_STEP_WAIT_TIME_SECONDS), false, System.currentTimeMillis())); } SingularityPendingDeploy pendingDeployObj = new SingularityPendingDeploy(deployMarker, Optional.<SingularityLoadBalancerUpdate> absent(), DeployState.WAITING, deployProgress);
<<<<<<< private final Optional<Boolean> preserveTaskSandboxAfterFinish; ======= private final Optional<String> loggingS3Bucket; >>>>>>> private final Optional<Boolean> preserveTaskSandboxAfterFinish; private final Optional<String> loggingS3Bucket; <<<<<<< @JsonProperty("maxTaskThreads") Optional<Integer> maxTaskThreads, @JsonProperty("preserveTaskSandboxAfterFinish") Optional<Boolean> preserveTaskSandboxAfterFinish) { ======= @JsonProperty("maxTaskThreads") Optional<Integer> maxTaskThreads, @JsonProperty("loggingS3Bucket") Optional<String> loggingS3Bucket) { >>>>>>> @JsonProperty("maxTaskThreads") Optional<Integer> maxTaskThreads, @JsonProperty("preserveTaskSandboxAfterFinish") Optional<Boolean> preserveTaskSandboxAfterFinish, @JsonProperty("loggingS3Bucket") Optional<String> loggingS3Bucket) { <<<<<<< this.preserveTaskSandboxAfterFinish = preserveTaskSandboxAfterFinish; ======= this.loggingS3Bucket = loggingS3Bucket; >>>>>>> this.preserveTaskSandboxAfterFinish = preserveTaskSandboxAfterFinish; this.loggingS3Bucket = loggingS3Bucket; <<<<<<< return new ExecutorDataBuilder(cmd, embeddedArtifacts, externalArtifacts, s3Artifacts, successfulExitCodes, runningSentinel, user, extraCmdLineArgs, loggingTag, loggingExtraFields, sigKillProcessesAfterMillis, maxTaskThreads, preserveTaskSandboxAfterFinish); ======= return new ExecutorDataBuilder(cmd, embeddedArtifacts, externalArtifacts, s3Artifacts, successfulExitCodes, runningSentinel, user, extraCmdLineArgs, loggingTag, loggingExtraFields, sigKillProcessesAfterMillis, maxTaskThreads, loggingS3Bucket); >>>>>>> return new ExecutorDataBuilder(cmd, embeddedArtifacts, externalArtifacts, s3Artifacts, successfulExitCodes, runningSentinel, user, extraCmdLineArgs, loggingTag, loggingExtraFields, sigKillProcessesAfterMillis, maxTaskThreads, preserveTaskSandboxAfterFinish, loggingS3Bucket); <<<<<<< public Optional<Boolean> getPreserveTaskSandboxAfterFinish() { return preserveTaskSandboxAfterFinish; } ======= public Optional<String> getLoggingS3Bucket() { return loggingS3Bucket; } >>>>>>> public Optional<Boolean> getPreserveTaskSandboxAfterFinish() { return preserveTaskSandboxAfterFinish; } public Optional<String> getLoggingS3Bucket() { return loggingS3Bucket; } <<<<<<< return "ExecutorData [cmd=" + cmd + ", embeddedArtifacts=" + embeddedArtifacts + ", externalArtifacts=" + externalArtifacts + ", s3Artifacts=" + s3Artifacts + ", successfulExitCodes=" + successfulExitCodes + ", runningSentinel=" + runningSentinel + ", user=" + user + ", extraCmdLineArgs=" + extraCmdLineArgs + ", loggingTag=" + loggingTag + ", loggingExtraFields=" + loggingExtraFields + ", sigKillProcessesAfterMillis=" + sigKillProcessesAfterMillis + ", maxTaskThreads=" + maxTaskThreads + ", preserveTaskSandboxAfterFinish=" + preserveTaskSandboxAfterFinish + "]"; ======= return "ExecutorData[" + "cmd='" + cmd + '\'' + ", embeddedArtifacts=" + embeddedArtifacts + ", externalArtifacts=" + externalArtifacts + ", s3Artifacts=" + s3Artifacts + ", successfulExitCodes=" + successfulExitCodes + ", runningSentinel=" + runningSentinel + ", user=" + user + ", extraCmdLineArgs=" + extraCmdLineArgs + ", loggingTag=" + loggingTag + ", loggingExtraFields=" + loggingExtraFields + ", sigKillProcessesAfterMillis=" + sigKillProcessesAfterMillis + ", maxTaskThreads=" + maxTaskThreads + ", loggingS3Bucket=" + loggingS3Bucket + ']'; >>>>>>> return "ExecutorData[" + "cmd='" + cmd + '\'' + ", embeddedArtifacts=" + embeddedArtifacts + ", externalArtifacts=" + externalArtifacts + ", s3Artifacts=" + s3Artifacts + ", successfulExitCodes=" + successfulExitCodes + ", runningSentinel=" + runningSentinel + ", user=" + user + ", extraCmdLineArgs=" + extraCmdLineArgs + ", loggingTag=" + loggingTag + ", loggingExtraFields=" + loggingExtraFields + ", sigKillProcessesAfterMillis=" + sigKillProcessesAfterMillis + ", maxTaskThreads=" + maxTaskThreads + ", preserveTaskSandboxAfterFinish=" + preserveTaskSandboxAfterFinish + ", loggingS3Bucket=" + loggingS3Bucket + ']';
<<<<<<< AsyncHttpClient httpClient, ObjectMapper objectMapper, RequestHelper requestHelper, RequestHistoryHelper requestHistoryHelper) { super(requestManager, deployManager, user, validator, authorizationHelper, httpClient, leaderLatch, objectMapper, requestHelper, requestHistoryHelper); ======= AsyncHttpClient httpClient, ObjectMapper objectMapper) { super(requestManager, deployManager, validator, authorizationHelper, httpClient, leaderLatch, objectMapper); >>>>>>> AsyncHttpClient httpClient, ObjectMapper objectMapper, RequestHelper requestHelper, RequestHistoryHelper requestHistoryHelper) { super(requestManager, deployManager, validator, authorizationHelper, httpClient, leaderLatch, objectMapper, requestHelper, requestHistoryHelper);
<<<<<<< SingularityConfiguration configuration, SingularitySchedulerLock lock) { ======= SingularityConfiguration configuration, @Named(SingularityMesosModule.SCHEDULER_LOCK_NAME) final Lock lock, DisasterManager disasterManager) { >>>>>>> SingularityConfiguration configuration, SingularitySchedulerLock lock, DisasterManager disasterManager) {
<<<<<<< scheduler.drainPendingQueue(stateCacheProvider.get()); sms.resourceOffers(Arrays.asList(createOffer(20, 20000, "slave1", "host1"))); ======= scheduler.drainPendingQueue(); sms.resourceOffers(driver, Arrays.asList(createOffer(20, 20000, "slave1", "host1"))); >>>>>>> scheduler.drainPendingQueue(); sms.resourceOffers(Arrays.asList(createOffer(20, 20000, "slave1", "host1"))); <<<<<<< scheduler.drainPendingQueue(stateCacheProvider.get()); sms.resourceOffers(Arrays.asList(createOffer(20, 20000, "slave1", "host1"))); ======= scheduler.drainPendingQueue(); sms.resourceOffers(driver, Arrays.asList(createOffer(20, 20000, "slave1", "host1"))); >>>>>>> scheduler.drainPendingQueue(); sms.resourceOffers(Arrays.asList(createOffer(20, 20000, "slave1", "host1")));
<<<<<<< public SingularityMesosStatusUpdateHandler(TaskManager taskManager, DeployManager deployManager, RequestManager requestManager, IdTranscoder<SingularityTaskId> taskIdTranscoder, SingularityExceptionNotifier exceptionNotifier, SingularityHealthchecker healthchecker, SingularityNewTaskChecker newTaskChecker, SingularitySlaveAndRackManager slaveAndRackManager, SingularityMesosExecutorInfoSupport logSupport, SingularityScheduler scheduler, Provider<SingularitySchedulerStateCache> stateCacheProvider, @Named(SingularityMainModule.SERVER_ID_PROPERTY) String serverId, SingularityMesosSchedulerClient schedulerClient, SingularitySchedulerLock schedulerLock, SingularityConfiguration configuration, @Named(SingularityMesosModule.TASK_LOST_REASONS_COUNTER) Multiset<Protos.TaskStatus.Reason> taskLostReasons, @Named(SingularityMainModule.LOST_TASKS_METER) Meter lostTasksMeter, @Named(SingularityMainModule.STATUS_UPDATE_DELTAS) ConcurrentHashMap<Long, Long> statusUpdateDeltas) { ======= public SingularityMesosStatusUpdateHandler(TaskManager taskManager, DeployManager deployManager, RequestManager requestManager, IdTranscoder<SingularityTaskId> taskIdTranscoder, SingularityExceptionNotifier exceptionNotifier, SingularityHealthchecker healthchecker, SingularityNewTaskChecker newTaskChecker, SingularitySlaveAndRackManager slaveAndRackManager, SingularityMesosExecutorInfoSupport logSupport, SingularityScheduler scheduler, SingularityLeaderCache leaderCache, @Named(SingularityMainModule.SERVER_ID_PROPERTY) String serverId, SchedulerDriverSupplier schedulerDriverSupplier, SingularitySchedulerLock schedulerLock, SingularityConfiguration configuration, @Named(SingularityMesosModule.TASK_LOST_REASONS_COUNTER) Multiset<Protos.TaskStatus.Reason> taskLostReasons, @Named(SingularityMainModule.LOST_TASKS_METER) Meter lostTasksMeter, @Named(SingularityMainModule.STATUS_UPDATE_DELTAS) ConcurrentHashMap<Long, Long> statusUpdateDeltas) { >>>>>>> public SingularityMesosStatusUpdateHandler(TaskManager taskManager, DeployManager deployManager, RequestManager requestManager, IdTranscoder<SingularityTaskId> taskIdTranscoder, SingularityExceptionNotifier exceptionNotifier, SingularityHealthchecker healthchecker, SingularityNewTaskChecker newTaskChecker, SingularitySlaveAndRackManager slaveAndRackManager, SingularityMesosExecutorInfoSupport logSupport, SingularityScheduler scheduler, @Named(SingularityMainModule.SERVER_ID_PROPERTY) String serverId, SingularityMesosSchedulerClient schedulerClient, SingularitySchedulerLock schedulerLock, SingularityConfiguration configuration, SingularityLeaderCache leaderCache, @Named(SingularityMesosModule.TASK_LOST_REASONS_COUNTER) Multiset<Protos.TaskStatus.Reason> taskLostReasons, @Named(SingularityMainModule.LOST_TASKS_METER) Meter lostTasksMeter, @Named(SingularityMainModule.STATUS_UPDATE_DELTAS) ConcurrentHashMap<Long, Long> statusUpdateDeltas) { <<<<<<< slaveAndRackManager.checkStateAfterFinishedTask(taskIdObj, status.getAgentId().getValue(), stateCache); scheduler.handleCompletedTask(task, taskIdObj, isActiveTask, timestamp, taskState, taskHistoryUpdateCreateResult, stateCache, status); ======= scheduler.handleCompletedTask(task, taskIdObj, isActiveTask, timestamp, taskState, taskHistoryUpdateCreateResult, status); >>>>>>> scheduler.handleCompletedTask(task, taskIdObj, isActiveTask, timestamp, taskState, taskHistoryUpdateCreateResult, status);
<<<<<<< @JsonProperty("taskPriorityLevel") Optional<Double> taskPriorityLevel, @JsonProperty("maxTasksPerOffer") Optional<Integer> maxTasksPerOffer) { ======= @JsonProperty("taskPriorityLevel") Optional<Double> taskPriorityLevel, @JsonProperty("allowBounceToSameHost") Optional<Boolean> allowBounceToSameHost) { >>>>>>> @JsonProperty("taskPriorityLevel") Optional<Double> taskPriorityLevel, @JsonProperty("maxTasksPerOffer") Optional<Integer> maxTasksPerOffer, @JsonProperty("allowBounceToSameHost") Optional<Boolean> allowBounceToSameHost) { <<<<<<< this.maxTasksPerOffer = maxTasksPerOffer; ======= this.allowBounceToSameHost = allowBounceToSameHost; >>>>>>> this.maxTasksPerOffer = maxTasksPerOffer; this.allowBounceToSameHost = allowBounceToSameHost; <<<<<<< .setTaskPriorityLevel(taskPriorityLevel) .setMaxTasksPerOffer(maxTasksPerOffer); ======= .setTaskPriorityLevel(taskPriorityLevel) .setAllowBounceToSameHost(allowBounceToSameHost); >>>>>>> .setTaskPriorityLevel(taskPriorityLevel) .setMaxTasksPerOffer(maxTasksPerOffer) .setAllowBounceToSameHost(allowBounceToSameHost); <<<<<<< @ApiModelProperty(required=false, value="Do not schedule more than this many tasks using a single offer from a single mesos slave") public Optional<Integer> getMaxTasksPerOffer() { return maxTasksPerOffer; } ======= @ApiModelProperty(required=false, value="If set to true, allow tasks to be scheduled on the same host as an existing active task when bouncing") public Optional<Boolean> getAllowBounceToSameHost() { return allowBounceToSameHost; } >>>>>>> @ApiModelProperty(required=false, value="Do not schedule more than this many tasks using a single offer from a single mesos slave") public Optional<Integer> getMaxTasksPerOffer() { return maxTasksPerOffer; } @ApiModelProperty(required=false, value="If set to true, allow tasks to be scheduled on the same host as an existing active task when bouncing") public Optional<Boolean> getAllowBounceToSameHost() { return allowBounceToSameHost; } <<<<<<< .add("maxTasksPerOffer", maxTasksPerOffer) ======= .add("allowBounceToSameHost", allowBounceToSameHost) >>>>>>> .add("maxTasksPerOffer", maxTasksPerOffer) .add("allowBounceToSameHost", allowBounceToSameHost) <<<<<<< Objects.equals(taskPriorityLevel, request.taskPriorityLevel) && Objects.equals(maxTasksPerOffer, request.maxTasksPerOffer); ======= Objects.equals(taskPriorityLevel, request.taskPriorityLevel) && Objects.equals(allowBounceToSameHost, request.allowBounceToSameHost); >>>>>>> Objects.equals(taskPriorityLevel, request.taskPriorityLevel) && Objects.equals(maxTasksPerOffer, request.maxTasksPerOffer) && Objects.equals(allowBounceToSameHost, request.allowBounceToSameHost); <<<<<<< return Objects.hash(id, requestType, owners, numRetriesOnFailure, schedule, quartzSchedule, scheduleTimeZone, scheduleType, killOldNonLongRunningTasksAfterMillis, taskExecutionTimeLimitMillis, scheduledExpectedRuntimeMillis, waitAtLeastMillisAfterTaskFinishesForReschedule, instances, rackSensitive, rackAffinity, slavePlacement, requiredSlaveAttributes, allowedSlaveAttributes, loadBalanced, group, readWriteGroups, readOnlyGroups, bounceAfterScale, emailConfigurationOverrides, hideEvenNumberAcrossRacksHint, taskLogErrorRegex, taskLogErrorRegexCaseSensitive, taskPriorityLevel, maxTasksPerOffer); ======= return Objects.hash(id, requestType, owners, numRetriesOnFailure, schedule, quartzSchedule, scheduleTimeZone, scheduleType, killOldNonLongRunningTasksAfterMillis, taskExecutionTimeLimitMillis, scheduledExpectedRuntimeMillis, waitAtLeastMillisAfterTaskFinishesForReschedule, instances, rackSensitive, rackAffinity, slavePlacement, requiredSlaveAttributes, allowedSlaveAttributes, loadBalanced, group, readWriteGroups, readOnlyGroups, bounceAfterScale, emailConfigurationOverrides, hideEvenNumberAcrossRacksHint, taskLogErrorRegex, taskLogErrorRegexCaseSensitive, taskPriorityLevel, allowBounceToSameHost); >>>>>>> return Objects.hash(id, requestType, owners, numRetriesOnFailure, schedule, quartzSchedule, scheduleTimeZone, scheduleType, killOldNonLongRunningTasksAfterMillis, taskExecutionTimeLimitMillis, scheduledExpectedRuntimeMillis, waitAtLeastMillisAfterTaskFinishesForReschedule, instances, rackSensitive, rackAffinity, slavePlacement, requiredSlaveAttributes, allowedSlaveAttributes, loadBalanced, group, readWriteGroups, readOnlyGroups, bounceAfterScale, emailConfigurationOverrides, hideEvenNumberAcrossRacksHint, taskLogErrorRegex, taskLogErrorRegexCaseSensitive, taskPriorityLevel, maxTasksPerOffer, allowBounceToSameHost);
<<<<<<< private long maxMissedMesosMasterHeartbeats = 5; ======= private long checkUpstreamsEverySeconds = 600; private long maxMissedMesosMasterHeartbeats = 3; >>>>>>> private long checkUpstreamsEverySeconds = 600; private long maxMissedMesosMasterHeartbeats = 5;
<<<<<<< if (hasLoadedRelations(query)) { SortedSet<Entry> results = state.relationCache.subSet(StaticBufferEntry.of(query.getSliceStart(), null),StaticBufferEntry.of(query.getSliceEnd(),null)); ======= if (queryCache.isCovered(query)) { SortedSet<Entry> results = relationCache.subSet(StaticBufferEntry.of(query.getSliceStart(), null),StaticBufferEntry.of(query.getSliceEnd(),null)); >>>>>>> if (hasLoadedRelations(query)) { SortedSet<Entry> results = relationCache.subSet(StaticBufferEntry.of(query.getSliceStart(), null),StaticBufferEntry.of(query.getSliceEnd(),null)); <<<<<<< @Override public boolean hasLoadedRelations(final SliceQuery query) { return state!=null && state.queryCache.isCovered(query); } private static class State { private SortedSet<Entry> relationCache; private QueryCache queryCache; private State() { relationCache = new ConcurrentSkipListSet<Entry>(); queryCache = new ConcurrentQueryCache(); } } ======= >>>>>>> @Override public boolean hasLoadedRelations(final SliceQuery query) { return queryCache!=null && queryCache.isCovered(query); }
<<<<<<< @JsonProperty("slavePlacement") Optional<SlavePlacement> slavePlacement, @JsonProperty("requiredSlaveAttributes") Optional<Map<String, String>> requiredSlaveAttributes, @JsonProperty("allowedSlaveAttributes") Optional<Map<String, String>> allowedSlaveAttributes, @JsonProperty("scheduledExpectedRuntimeMillis") Optional<Long> scheduledExpectedRuntimeMillis, @JsonProperty("waitAtLeastMillisAfterTaskFinishesForReschedule") Optional<Long> waitAtLeastMillisAfterTaskFinishesForReschedule, @JsonProperty("group") Optional<String> group, @JsonProperty("readOnlyGroups") Optional<Set<String>> readOnlyGroups, @JsonProperty("bounceAfterScale") Optional<Boolean> bounceAfterScale, @JsonProperty("skipHealthchecks") Optional<Boolean> skipHealthchecks) { ======= @JsonProperty("slavePlacement") Optional<SlavePlacement> slavePlacement, @JsonProperty("requiredSlaveAttributes") Optional<Map<String, String>> requiredSlaveAttributes, @JsonProperty("allowedSlaveAttributes") Optional<Map<String, String>> allowedSlaveAttributes, @JsonProperty("scheduledExpectedRuntimeMillis") Optional<Long> scheduledExpectedRuntimeMillis, @JsonProperty("waitAtLeastMillisAfterTaskFinishesForReschedule") Optional<Long> waitAtLeastMillisAfterTaskFinishesForReschedule, @JsonProperty("group") Optional<String> group, @JsonProperty("readOnlyGroups") Optional<Set<String>> readOnlyGroups, @JsonProperty("bounceAfterScale") Optional<Boolean> bounceAfterScale, @JsonProperty("emailConfigurationOverrides") Optional<Map<SingularityEmailType, List<SingularityEmailDestination>>> emailConfigurationOverrides) { >>>>>>> @JsonProperty("slavePlacement") Optional<SlavePlacement> slavePlacement, @JsonProperty("requiredSlaveAttributes") Optional<Map<String, String>> requiredSlaveAttributes, @JsonProperty("allowedSlaveAttributes") Optional<Map<String, String>> allowedSlaveAttributes, @JsonProperty("scheduledExpectedRuntimeMillis") Optional<Long> scheduledExpectedRuntimeMillis, @JsonProperty("waitAtLeastMillisAfterTaskFinishesForReschedule") Optional<Long> waitAtLeastMillisAfterTaskFinishesForReschedule, @JsonProperty("group") Optional<String> group, @JsonProperty("readOnlyGroups") Optional<Set<String>> readOnlyGroups, @JsonProperty("bounceAfterScale") Optional<Boolean> bounceAfterScale, @JsonProperty("emailConfigurationOverrides") Optional<Map<SingularityEmailType, List<SingularityEmailDestination>>> emailConfigurationOverrides) { @JsonProperty("skipHealthchecks") Optional<Boolean> skipHealthchecks) { <<<<<<< this.skipHealthchecks = skipHealthchecks; ======= this.emailConfigurationOverrides = emailConfigurationOverrides; >>>>>>> this.emailConfigurationOverrides = emailConfigurationOverrides; this.skipHealthchecks = skipHealthchecks; <<<<<<< .setBounceAfterScale(bounceAfterScale) .setSkipHealthchecks(skipHealthchecks); ======= .setBounceAfterScale(bounceAfterScale) .setEmailConfigurationOverrides(emailConfigurationOverrides); >>>>>>> .setBounceAfterScale(bounceAfterScale) .setEmailConfigurationOverrides(emailConfigurationOverrides); .setSkipHealthchecks(skipHealthchecks); <<<<<<< public Optional<Boolean> getSkipHealthchecks() { return skipHealthchecks; } ======= public Optional<Map<SingularityEmailType, List<SingularityEmailDestination>>> getEmailConfigurationOverrides() { return emailConfigurationOverrides; } >>>>>>> public Optional<Map<SingularityEmailType, List<SingularityEmailDestination>>> getEmailConfigurationOverrides() { return emailConfigurationOverrides; } public Optional<Boolean> getSkipHealthchecks() { return skipHealthchecks; }
<<<<<<< this.exceptionNotifier = exceptionNotifier; ======= this.configuration = configuration; >>>>>>> this.exceptionNotifier = exceptionNotifier; this.configuration = configuration;
<<<<<<< import java.util.Map; ======= import java.util.Objects; >>>>>>> import java.util.Map; import java.util.Objects; <<<<<<< private final Map<String, String> envOverrides; ======= private final List<SingularityMesosArtifact> extraArtifacts; >>>>>>> private final Map<String, String> envOverrides; private final List<SingularityMesosArtifact> extraArtifacts; <<<<<<< @JsonProperty("envOverrides") Map<String, String> envOverrides, ======= @JsonProperty("extraArtifacts") List<SingularityMesosArtifact> extraArtifacts, >>>>>>> @JsonProperty("envOverrides") Map<String, String> envOverrides, @JsonProperty("extraArtifacts") List<SingularityMesosArtifact> extraArtifacts, <<<<<<< this.envOverrides = envOverrides == null ? Collections.emptyMap() : envOverrides; ======= if (Objects.nonNull(extraArtifacts)) { this.extraArtifacts = extraArtifacts; } else { this.extraArtifacts = Collections.emptyList(); } >>>>>>> if (Objects.nonNull(envOverrides)) { this.envOverrides = envOverrides; } else { this.envOverrides = Collections.emptyMap(); } if (Objects.nonNull(extraArtifacts)) { this.extraArtifacts = extraArtifacts; } else { this.extraArtifacts = Collections.emptyList(); } <<<<<<< @ApiModelProperty(required=false, value="Override the environment variables for launched tasks") public Map<String, String> getEnvOverrides() { return envOverrides; } ======= @ApiModelProperty(required=false, value="Additional artifacts to download for this run") public List<SingularityMesosArtifact> getExtraArtifacts() { return extraArtifacts; } >>>>>>> @ApiModelProperty(required=false, value="Override the environment variables for launched tasks") public Map<String, String> getEnvOverrides() { return envOverrides; } @ApiModelProperty(required=false, value="Additional artifacts to download for this run") public List<SingularityMesosArtifact> getExtraArtifacts() { return extraArtifacts; } <<<<<<< ", envOverrides=" + envOverrides + ======= ", extraArtifacts=" + extraArtifacts + >>>>>>> ", envOverrides=" + envOverrides + ", extraArtifacts=" + extraArtifacts +
<<<<<<< @Override public Integer getTtl() { return null; } ======= @Override public boolean hasMetaData() { verifyAccess(); return !metadata.isEmpty(); } @Override public Map<EntryMetaData,Object> getMetaData() { verifyAccess(); return metadata; } >>>>>>> @Override public Integer getTtl() { return null; } public boolean hasMetaData() { verifyAccess(); return !metadata.isEmpty(); } @Override public Map<EntryMetaData,Object> getMetaData() { verifyAccess(); return metadata; }
<<<<<<< import com.google.common.base.Predicate; ======= import com.google.common.collect.ImmutableList; >>>>>>> import com.google.common.collect.ImmutableList; import com.google.common.base.Predicate; <<<<<<< import com.hubspot.singularity.SingularityTaskShellCommandRequest; import com.hubspot.singularity.WebExceptions; import com.hubspot.singularity.config.UIConfiguration; import com.hubspot.singularity.config.shell.ShellCommandDescriptor; import com.hubspot.singularity.config.shell.ShellCommandOptionDescriptor; ======= import com.hubspot.singularity.SingularityTransformHelpers; import com.hubspot.singularity.SingularityUser; import com.hubspot.singularity.auth.SingularityAuthorizationHelper; >>>>>>> import com.hubspot.singularity.SingularityTransformHelpers; import com.hubspot.singularity.SingularityUser; import com.hubspot.singularity.auth.SingularityAuthorizationHelper; import com.hubspot.singularity.SingularityTaskShellCommandRequest; import com.hubspot.singularity.WebExceptions; import com.hubspot.singularity.config.UIConfiguration; import com.hubspot.singularity.config.shell.ShellCommandDescriptor; import com.hubspot.singularity.config.shell.ShellCommandOptionDescriptor; <<<<<<< private final UIConfiguration uiConfiguration; ======= private final MesosClient mesosClient; private final SingularityAuthorizationHelper authorizationHelper; private final Optional<SingularityUser> user; >>>>>>> private final MesosClient mesosClient; private final SingularityAuthorizationHelper authorizationHelper; private final Optional<SingularityUser> user; private final UIConfiguration uiConfiguration; <<<<<<< public TaskResource(TaskRequestManager taskRequestManager, TaskManager taskManager, SlaveManager slaveManager, MesosClient mesosClient, UIConfiguration uiConfiguration) { ======= public TaskResource(TaskRequestManager taskRequestManager, TaskManager taskManager, SlaveManager slaveManager, MesosClient mesosClient, SingularityAuthorizationHelper authorizationHelper, Optional<SingularityUser> user) { >>>>>>> public TaskResource(TaskRequestManager taskRequestManager, TaskManager taskManager, SlaveManager slaveManager, MesosClient mesosClient, UIConfiguration uiConfiguration, SingularityAuthorizationHelper authorizationHelper, Optional<SingularityUser> user) { <<<<<<< ======= @PropertyFiltering @Path("/active") @ApiOperation("Retrieve the list of active tasks.") public Iterable<SingularityTask> getActiveTasks() { return authorizationHelper.filterByAuthorizedRequests(user, taskManager.getActiveTasks(), SingularityTransformHelpers.TASK_TO_REQUEST_ID); } @GET @PropertyFiltering @Path("/cleaning") @ApiOperation("Retrieve the list of cleaning tasks.") public Iterable<SingularityTaskCleanup> getCleaningTasks() { return authorizationHelper.filterByAuthorizedRequests(user, taskManager.getCleanupTasks(), SingularityTransformHelpers.TASK_CLEANUP_TO_REQUEST_ID); } @GET @PropertyFiltering @Path("/lbcleanup") @ApiOperation("Retrieve the list of tasks being cleaned from load balancers.") public Iterable<SingularityTaskId> getLbCleanupTasks() { return authorizationHelper.filterByAuthorizedRequests(user, taskManager.getLBCleanupTasks(), SingularityTransformHelpers.TASK_ID_TO_REQUEST_ID); } private SingularityTask checkActiveTask(String taskId) { SingularityTaskId taskIdObj = getTaskIdFromStr(taskId); Optional<SingularityTask> task = taskManager.getTask(taskIdObj); checkNotFound(task.isPresent() && taskManager.isActiveTask(taskId), "No active task with id %s", taskId); if (task.isPresent()) { authorizationHelper.checkForAuthorizationByRequestId(task.get().getTaskId().getRequestId(), user); } return task.get(); } @GET @Path("/task/{taskId}") @ApiOperation("Retrieve information about a specific active task.") public SingularityTask getActiveTask(@PathParam("taskId") String taskId) { return checkActiveTask(taskId); } @GET >>>>>>> @PropertyFiltering @Path("/active") @ApiOperation("Retrieve the list of active tasks.") public Iterable<SingularityTask> getActiveTasks() { return authorizationHelper.filterByAuthorizedRequests(user, taskManager.getActiveTasks(), SingularityTransformHelpers.TASK_TO_REQUEST_ID); } @GET @PropertyFiltering @Path("/cleaning") @ApiOperation("Retrieve the list of cleaning tasks.") public Iterable<SingularityTaskCleanup> getCleaningTasks() { return authorizationHelper.filterByAuthorizedRequests(user, taskManager.getCleanupTasks(), SingularityTransformHelpers.TASK_CLEANUP_TO_REQUEST_ID); } @GET @PropertyFiltering @Path("/lbcleanup") @ApiOperation("Retrieve the list of tasks being cleaned from load balancers.") public Iterable<SingularityTaskId> getLbCleanupTasks() { return authorizationHelper.filterByAuthorizedRequests(user, taskManager.getLBCleanupTasks(), SingularityTransformHelpers.TASK_ID_TO_REQUEST_ID); } private SingularityTask checkActiveTask(String taskId) { SingularityTaskId taskIdObj = getTaskIdFromStr(taskId); Optional<SingularityTask> task = taskManager.getTask(taskIdObj); checkNotFound(task.isPresent() && taskManager.isActiveTask(taskId), "No active task with id %s", taskId); if (task.isPresent()) { authorizationHelper.checkForAuthorizationByRequestId(task.get().getTaskId().getRequestId(), user); } return task.get(); } @GET @Path("/task/{taskId}") @ApiOperation("Retrieve information about a specific active task.") public SingularityTask getActiveTask(@PathParam("taskId") String taskId) { return checkActiveTask(taskId); } @GET <<<<<<< @Path("/commands/queued") @ApiOperation(value="Retrieve a list of all the shell commands queued for execution") public List<SingularityTaskShellCommandRequest> getQueuedShellCommands() { return taskManager.getAllQueuedTaskShellCommandRequests(); } @POST @Path("/task/{taskId}/command") @ApiOperation(value="Run a configured shell command against the given task") @ApiResponses({ @ApiResponse(code=400, message="Given shell command option doesn't exist"), @ApiResponse(code=403, message="Given shell command doesn't exist") }) @Consumes({ MediaType.APPLICATION_JSON }) public SingularityTaskShellCommandRequest runShellCommand(@PathParam("taskId") String taskId, @QueryParam("user") Optional<String> user, final SingularityShellCommand shellCommand) { SingularityTaskId taskIdObj = getTaskIdFromStr(taskId); if (!taskManager.isActiveTask(taskId)) { throw WebExceptions.badRequest("%s is not an active task, can't run %s on it", taskId, shellCommand.getName()); } Optional<ShellCommandDescriptor> commandDescriptor = Iterables.tryFind(uiConfiguration.getShellCommands(), new Predicate<ShellCommandDescriptor>() { @Override public boolean apply(ShellCommandDescriptor input) { return input.getName().equals(shellCommand.getName()); } }); if (!commandDescriptor.isPresent()) { throw WebExceptions.forbidden("Shell command %s not in %s", shellCommand.getName(), uiConfiguration.getShellCommands()); } Set<String> options = Sets.newHashSetWithExpectedSize(commandDescriptor.get().getOptions().size()); for (ShellCommandOptionDescriptor option : commandDescriptor.get().getOptions()) { options.add(option.getName()); } for (String option : shellCommand.getOptions()) { if (!options.contains(option)) { throw WebExceptions.badRequest("Shell command %s does not have option %s (%s)", shellCommand.getName(), option, options); } } SingularityTaskShellCommandRequest shellRequest = new SingularityTaskShellCommandRequest(taskIdObj, user, System.currentTimeMillis(), shellCommand); taskManager.saveTaskShellCommandRequestToQueue(shellRequest); return shellRequest; ======= @Path("/task/{taskId}/cleanup") @ApiOperation("Get the cleanup object for the task, if it exists") public Optional<SingularityTaskCleanup> getTaskCleanup(@PathParam("taskId") String taskId) { authorizationHelper.checkForAuthorizationByTaskId(taskId, user); return taskManager.getTaskCleanup(taskId); >>>>>>> @Path("/task/{taskId}/cleanup") @ApiOperation("Get the cleanup object for the task, if it exists") public Optional<SingularityTaskCleanup> getTaskCleanup(@PathParam("taskId") String taskId) { authorizationHelper.checkForAuthorizationByTaskId(taskId, user); } @Path("/commands/queued") @ApiOperation(value="Retrieve a list of all the shell commands queued for execution") public List<SingularityTaskShellCommandRequest> getQueuedShellCommands() { return taskManager.getAllQueuedTaskShellCommandRequests(); } @POST @Path("/task/{taskId}/command") @ApiOperation(value="Run a configured shell command against the given task") @ApiResponses({ @ApiResponse(code=400, message="Given shell command option doesn't exist"), @ApiResponse(code=403, message="Given shell command doesn't exist") }) @Consumes({ MediaType.APPLICATION_JSON }) public SingularityTaskShellCommandRequest runShellCommand(@PathParam("taskId") String taskId, @QueryParam("user") Optional<String> user, final SingularityShellCommand shellCommand) { SingularityTaskId taskIdObj = getTaskIdFromStr(taskId); if (!taskManager.isActiveTask(taskId)) { throw WebExceptions.badRequest("%s is not an active task, can't run %s on it", taskId, shellCommand.getName()); } Optional<ShellCommandDescriptor> commandDescriptor = Iterables.tryFind(uiConfiguration.getShellCommands(), new Predicate<ShellCommandDescriptor>() { @Override public boolean apply(ShellCommandDescriptor input) { return input.getName().equals(shellCommand.getName()); } }); if (!commandDescriptor.isPresent()) { throw WebExceptions.forbidden("Shell command %s not in %s", shellCommand.getName(), uiConfiguration.getShellCommands()); } Set<String> options = Sets.newHashSetWithExpectedSize(commandDescriptor.get().getOptions().size()); for (ShellCommandOptionDescriptor option : commandDescriptor.get().getOptions()) { options.add(option.getName()); } for (String option : shellCommand.getOptions()) { if (!options.contains(option)) { throw WebExceptions.badRequest("Shell command %s does not have option %s (%s)", shellCommand.getName(), option, options); } } SingularityTaskShellCommandRequest shellRequest = new SingularityTaskShellCommandRequest(taskIdObj, user, System.currentTimeMillis(), shellCommand); taskManager.saveTaskShellCommandRequestToQueue(shellRequest); return shellRequest;
<<<<<<< final LoadBalancerRequestId loadBalancerRequestId = new LoadBalancerRequestId(task.getTaskId().getId(), LoadBalancerRequestType.ADD, Optional.absent()); ======= final LoadBalancerRequestId loadBalancerRequestId = new LoadBalancerRequestId(task.getTaskId().getId(), LoadBalancerRequestType.ADD, Optional.<Integer> absent()); boolean taskCleaning = taskManager.getCleanupTaskIds().contains(task.getTaskId()); >>>>>>> final LoadBalancerRequestId loadBalancerRequestId = new LoadBalancerRequestId(task.getTaskId().getId(), LoadBalancerRequestType.ADD, Optional.absent()); boolean taskCleaning = taskManager.getCleanupTaskIds().contains(task.getTaskId()); <<<<<<< private boolean isTaskOverdue(SingularityTask task) { final long taskDuration = System.currentTimeMillis() - task.getTaskId().getStartedAt(); final boolean isOverdue = taskDuration > getKillAfterTaskNotRunningMillis(); if (isOverdue) { LOG.debug("Task {} is overdue (duration: {}), allowed limit {}", task.getTaskId(), JavaUtils.durationFromMillis(taskDuration), JavaUtils.durationFromMillis(getKillAfterTaskNotRunningMillis())); } return isOverdue; } ======= private boolean unknownNotRemoving(SingularityLoadBalancerUpdate update) { return update.getLoadBalancerState() == BaragonRequestState.UNKNOWN && update.getLoadBalancerRequestId().getRequestType() != LoadBalancerRequestType.REMOVE; } >>>>>>> private boolean isTaskOverdue(SingularityTask task) { final long taskDuration = System.currentTimeMillis() - task.getTaskId().getStartedAt(); final boolean isOverdue = taskDuration > getKillAfterTaskNotRunningMillis(); if (isOverdue) { LOG.debug("Task {} is overdue (duration: {}), allowed limit {}", task.getTaskId(), JavaUtils.durationFromMillis(taskDuration), JavaUtils.durationFromMillis(getKillAfterTaskNotRunningMillis())); } return isOverdue; } private boolean unknownNotRemoving(SingularityLoadBalancerUpdate update) { return update.getLoadBalancerState() == BaragonRequestState.UNKNOWN && update.getLoadBalancerRequestId().getRequestType() != LoadBalancerRequestType.REMOVE; }
<<<<<<< private Optional<SingularityExecutorDockerAuthConfig> dockerAuthConfig = Optional.absent(); @JsonProperty ======= private int maxDockerPullAttempts = 2; @JsonProperty >>>>>>> private int maxDockerPullAttempts = 2; @JsonProperty private Optional<SingularityExecutorDockerAuthConfig> dockerAuthConfig = Optional.absent(); @JsonProperty <<<<<<< public Optional<SingularityExecutorDockerAuthConfig> getDockerAuthConfig() { return dockerAuthConfig; } public void setDockerAuthConfig(Optional<SingularityExecutorDockerAuthConfig> dockerAuthConfig) { this.dockerAuthConfig = dockerAuthConfig; } ======= public int getMaxDockerPullAttempts() { return maxDockerPullAttempts; } public void setMaxDockerPullAttempts(int maxDockerPullAttempts) { this.maxDockerPullAttempts = maxDockerPullAttempts; } >>>>>>> public int getMaxDockerPullAttempts() { return maxDockerPullAttempts; } public void setMaxDockerPullAttempts(int maxDockerPullAttempts) { this.maxDockerPullAttempts = maxDockerPullAttempts; } public Optional<SingularityExecutorDockerAuthConfig> getDockerAuthConfig() { return dockerAuthConfig; } public void setDockerAuthConfig(Optional<SingularityExecutorDockerAuthConfig> dockerAuthConfig) { this.dockerAuthConfig = dockerAuthConfig; }
<<<<<<< ======= import com.google.inject.name.Named; import com.hubspot.singularity.SingularityAction; >>>>>>> <<<<<<< import com.hubspot.singularity.mesos.SingularitySchedulerLock; ======= import com.hubspot.singularity.data.DisasterManager; import com.hubspot.singularity.mesos.SingularityMesosModule; >>>>>>> import com.hubspot.singularity.mesos.SingularitySchedulerLock; import com.hubspot.singularity.SingularityAction; import com.hubspot.singularity.data.DisasterManager; <<<<<<< SingularityCleanupPoller(SingularityConfiguration configuration, SingularityCleaner cleaner, SingularitySchedulerLock lock) { ======= SingularityCleanupPoller(SingularityConfiguration configuration, SingularityCleaner cleaner, @Named(SingularityMesosModule.SCHEDULER_LOCK_NAME) final Lock lock, DisasterManager disasterManager) { >>>>>>> SingularityCleanupPoller(SingularityConfiguration configuration, SingularityCleaner cleaner, SingularitySchedulerLock lock, DisasterManager disasterManager) {
<<<<<<< import java.util.Collections; ======= import static com.hubspot.singularity.WebExceptions.badRequest; import static com.hubspot.singularity.WebExceptions.checkBadRequest; import static com.hubspot.singularity.WebExceptions.checkConflict; import static com.hubspot.singularity.WebExceptions.checkNotNullBadRequest; >>>>>>> import java.util.Collections; import static com.hubspot.singularity.WebExceptions.badRequest; import static com.hubspot.singularity.WebExceptions.checkBadRequest; import static com.hubspot.singularity.WebExceptions.checkConflict; import static com.hubspot.singularity.WebExceptions.checkNotNullBadRequest; <<<<<<< if (!requestWithState.getRequest().isLongRunning()) { throw WebExceptions.badRequest("Can not bounce a %s request (%s)", requestWithState.getRequest().getRequestType(), requestWithState); } ======= checkBadRequest(requestWithState.getRequest().isLongRunning(), "Can not bounce a scheduled or one-off request (%s)", requestWithState); >>>>>>> checkBadRequest(requestWithState.getRequest().isLongRunning(), "Can not bounce a %s request (%s)", requestWithState.getRequest().getRequestType(), requestWithState);
<<<<<<< import com.hubspot.singularity.api.SingularityMachineChangeRequest; ======= import com.hubspot.singularity.api.SingularityKillTaskRequest; >>>>>>> import com.hubspot.singularity.api.SingularityKillTaskRequest; import com.hubspot.singularity.api.SingularityMachineChangeRequest;
<<<<<<< public static final String MAX_SINGLE_UPLOAD_BYTES = "s3uploader.max.single.upload.size"; public static final String UPLOAD_PART_SIZE = "s3uploader.upload.part.size"; public static final String CHECK_FOR_OPEN_FILES = "s3uploader.check.for.open.files"; ======= public static final String RETRY_WAIT_MS = "s3uploader.retry.wait.ms"; public static final String RETRY_COUNT = "s3uploader.retry.count"; public static final String MAX_SINGLE_UPLOAD_BYTES = "s3uploader.max.single.upload.size"; public static final String UPLOAD_PART_SIZE = "s3uploader.upload.part.size"; >>>>>>> public static final String RETRY_WAIT_MS = "s3uploader.retry.wait.ms"; public static final String RETRY_COUNT = "s3uploader.retry.count"; public static final String MAX_SINGLE_UPLOAD_BYTES = "s3uploader.max.single.upload.size"; public static final String UPLOAD_PART_SIZE = "s3uploader.upload.part.size"; public static final String CHECK_FOR_OPEN_FILES = "s3uploader.check.for.open.files"; <<<<<<< @JsonProperty private long maxSingleUploadSizeBytes = 5368709120L; @JsonProperty private long uploadPartSize = 20971520L; @JsonProperty private boolean checkForOpenFiles = true; ======= @JsonProperty private int retryWaitMs = 1000; @JsonProperty private int retryCount = 2; @JsonProperty private long maxSingleUploadSizeBytes = 5368709120L; @JsonProperty private long uploadPartSize = 20971520L; >>>>>>> @JsonProperty private int retryWaitMs = 1000; @JsonProperty private int retryCount = 2; @JsonProperty private long maxSingleUploadSizeBytes = 5368709120L; @JsonProperty private long uploadPartSize = 20971520L; @JsonProperty private boolean checkForOpenFiles = true; <<<<<<< public long getMaxSingleUploadSizeBytes() { return maxSingleUploadSizeBytes; } public void setMaxSingleUploadSizeBytes(long maxSingleUploadSizeBytes) { this.maxSingleUploadSizeBytes = maxSingleUploadSizeBytes; } public long getUploadPartSize() { return uploadPartSize; } public void setUploadPartSize(long uploadPartSize) { this.uploadPartSize = uploadPartSize; } public boolean isCheckForOpenFiles() { return checkForOpenFiles; } public void setCheckForOpenFiles(boolean checkForOpenFiles) { this.checkForOpenFiles = checkForOpenFiles; } ======= public int getRetryCount() { return retryCount; } public void setRetryCount(int retryCount) { this.retryCount = retryCount; } public int getRetryWaitMs() { return retryWaitMs; } public void setRetryWaitMs(int retryWaitMs) { this.retryWaitMs = retryWaitMs; } public long getMaxSingleUploadSizeBytes() { return maxSingleUploadSizeBytes; } public void setMaxSingleUploadSizeBytes(long maxSingleUploadSizeBytes) { this.maxSingleUploadSizeBytes = maxSingleUploadSizeBytes; } public long getUploadPartSize() { return uploadPartSize; } public void setUploadPartSize(long uploadPartSize) { this.uploadPartSize = uploadPartSize; } >>>>>>> public int getRetryCount() { return retryCount; } public void setRetryCount(int retryCount) { this.retryCount = retryCount; } public int getRetryWaitMs() { return retryWaitMs; } public void setRetryWaitMs(int retryWaitMs) { this.retryWaitMs = retryWaitMs; } public long getMaxSingleUploadSizeBytes() { return maxSingleUploadSizeBytes; } public void setMaxSingleUploadSizeBytes(long maxSingleUploadSizeBytes) { this.maxSingleUploadSizeBytes = maxSingleUploadSizeBytes; } public long getUploadPartSize() { return uploadPartSize; } public void setUploadPartSize(long uploadPartSize) { this.uploadPartSize = uploadPartSize; } public boolean isCheckForOpenFiles() { return checkForOpenFiles; } public void setCheckForOpenFiles(boolean checkForOpenFiles) { this.checkForOpenFiles = checkForOpenFiles; } <<<<<<< ", maxSingleUploadSizeBytes=" + maxSingleUploadSizeBytes + ", uploadPartSize=" + uploadPartSize + ", chkecForOpenFiles=" + checkForOpenFiles + ======= ", retryWaitMs=" + retryWaitMs + ", retryCount=" + retryCount + ", maxSingleUploadSizeBytes=" + maxSingleUploadSizeBytes + ", uploadPartSize=" + uploadPartSize + >>>>>>> ", retryWaitMs=" + retryWaitMs + ", retryCount=" + retryCount + ", maxSingleUploadSizeBytes=" + maxSingleUploadSizeBytes + ", uploadPartSize=" + uploadPartSize + ", chkecForOpenFiles=" + checkForOpenFiles + <<<<<<< if (properties.containsKey(MAX_SINGLE_UPLOAD_BYTES)) { setMaxSingleUploadSizeBytes(Long.parseLong(properties.getProperty(MAX_SINGLE_UPLOAD_BYTES))); } if (properties.containsKey(UPLOAD_PART_SIZE)) { setUploadPartSize(Long.parseLong(properties.getProperty(UPLOAD_PART_SIZE))); } if (properties.containsKey(CHECK_FOR_OPEN_FILES)) { setCheckForOpenFiles(Boolean.parseBoolean(properties.getProperty(CHECK_FOR_OPEN_FILES))); } ======= if (properties.containsKey(RETRY_COUNT)) { setRetryCount(Integer.parseInt(properties.getProperty(RETRY_COUNT))); } if (properties.containsKey(RETRY_WAIT_MS)) { setRetryWaitMs(Integer.parseInt(RETRY_WAIT_MS)); } if (properties.containsKey(MAX_SINGLE_UPLOAD_BYTES)) { setMaxSingleUploadSizeBytes(Long.parseLong(properties.getProperty(MAX_SINGLE_UPLOAD_BYTES))); } if (properties.containsKey(UPLOAD_PART_SIZE)) { setUploadPartSize(Long.parseLong(properties.getProperty(UPLOAD_PART_SIZE))); } >>>>>>> if (properties.containsKey(RETRY_COUNT)) { setRetryCount(Integer.parseInt(properties.getProperty(RETRY_COUNT))); } if (properties.containsKey(RETRY_WAIT_MS)) { setRetryWaitMs(Integer.parseInt(RETRY_WAIT_MS)); } if (properties.containsKey(MAX_SINGLE_UPLOAD_BYTES)) { setMaxSingleUploadSizeBytes(Long.parseLong(properties.getProperty(MAX_SINGLE_UPLOAD_BYTES))); } if (properties.containsKey(UPLOAD_PART_SIZE)) { setUploadPartSize(Long.parseLong(properties.getProperty(UPLOAD_PART_SIZE))); } if (properties.containsKey(CHECK_FOR_OPEN_FILES)) { setCheckForOpenFiles(Boolean.parseBoolean(properties.getProperty(CHECK_FOR_OPEN_FILES))); }
<<<<<<< public SingularityHealthchecker(SingularityManagedScheduledExecutorServiceFactory executorServiceFactory, AsyncHttpClient http, SingularityConfiguration configuration, SingularityNewTaskChecker newTaskChecker, ======= public SingularityHealthchecker(@Named(SingularityMainModule.HEALTHCHECK_THREADPOOL_NAME) ScheduledExecutorService executorService, AsyncHttpClient http, OkHttpClient http2, SingularityConfiguration configuration, SingularityNewTaskChecker newTaskChecker, >>>>>>> public SingularityHealthchecker(SingularityManagedScheduledExecutorServiceFactory executorServiceFactory, AsyncHttpClient http, OkHttpClient http2, SingularityConfiguration configuration, SingularityNewTaskChecker newTaskChecker, <<<<<<< try { RequestBuilder builder = new RequestBuilder("GET"); builder.setFollowRedirects(true); builder.setUrl(uri.get()); builder.setRequestTimeout((int) TimeUnit.SECONDS.toMillis(timeoutSeconds)); ======= if (task.getTaskRequest().getDeploy().getHealthcheck().isPresent()) { HealthcheckOptions options = task.getTaskRequest().getDeploy().getHealthcheck().get(); method = options.getMethod().or(HealthcheckMethod.GET).getMethod(); timeoutSeconds = options.getResponseTimeoutSeconds().or(configuration.getHealthcheckTimeoutSeconds()); } else { timeoutSeconds = configuration.getHealthcheckTimeoutSeconds(); method = HealthcheckMethod.GET.getMethod(); } try { HealthcheckProtocol protocol = task.getTaskRequest().getDeploy().getHealthcheck().get().getProtocol().or(HealthcheckProtocol.HTTP); >>>>>>> if (task.getTaskRequest().getDeploy().getHealthcheck().isPresent()) { HealthcheckOptions options = task.getTaskRequest().getDeploy().getHealthcheck().get(); method = options.getMethod().or(HealthcheckMethod.GET).getMethod(); timeoutSeconds = options.getResponseTimeoutSeconds().or(configuration.getHealthcheckTimeoutSeconds()); } else { timeoutSeconds = configuration.getHealthcheckTimeoutSeconds(); method = HealthcheckMethod.GET.getMethod(); } try { HealthcheckProtocol protocol = task.getTaskRequest().getDeploy().getHealthcheck().get().getProtocol().or(HealthcheckProtocol.HTTP);
<<<<<<< import com.google.inject.Inject; import com.hubspot.singularity.SingularityHostState; import com.hubspot.singularity.SingularityPendingDeploy; import com.hubspot.singularity.SingularityRequestWithState; import com.hubspot.singularity.SingularityScheduledTasksInfo; import com.hubspot.singularity.SingularityState; import com.hubspot.singularity.config.SingularityConfiguration; import com.hubspot.singularity.data.DeployManager; import com.hubspot.singularity.data.RackManager; import com.hubspot.singularity.data.RequestManager; import com.hubspot.singularity.data.SlaveManager; import com.hubspot.singularity.data.StateManager; import com.hubspot.singularity.data.TaskManager; @Path("/state") ======= @Path(SingularityService.API_BASE_PATH + "/state") >>>>>>> import com.google.inject.Inject; import com.hubspot.singularity.SingularityHostState; import com.hubspot.singularity.SingularityPendingDeploy; import com.hubspot.singularity.SingularityRequestWithState; import com.hubspot.singularity.SingularityScheduledTasksInfo; import com.hubspot.singularity.SingularityState; import com.hubspot.singularity.config.SingularityConfiguration; import com.hubspot.singularity.data.DeployManager; import com.hubspot.singularity.data.RackManager; import com.hubspot.singularity.data.RequestManager; import com.hubspot.singularity.data.SlaveManager; import com.hubspot.singularity.data.StateManager; import com.hubspot.singularity.data.TaskManager; @Path(SingularityService.API_BASE_PATH + "/state")
<<<<<<< import com.hubspot.singularity.config.CustomExecutorConfiguration; import com.hubspot.singularity.smtp.JadeTemplateLoader; import com.hubspot.singularity.smtp.MailTemplateHelpers; import com.hubspot.singularity.smtp.SingularityMailRecordCleaner; import com.hubspot.singularity.smtp.SingularityMailer; import com.hubspot.singularity.smtp.SingularitySmtpSender; ======= >>>>>>>
<<<<<<< public HealthcheckOptions(@JsonProperty("uri") String uri, @JsonProperty("portIndex") Optional<Integer> portIndex, @JsonProperty("portNumber") Optional<Long> portNumber, @JsonProperty("protocol") Optional<HealthcheckProtocol> protocol, @JsonProperty("method") Optional<HealthcheckMethod> method, @JsonProperty("startupTimeoutSeconds") Optional<Integer> startupTimeoutSeconds, @JsonProperty("startupDelaySeconds") Optional<Integer> startupDelaySeconds, @JsonProperty("startupIntervalSeconds") Optional<Integer> startupIntervalSeconds, @JsonProperty("intervalSeconds") Optional<Integer> intervalSeconds, @JsonProperty("responseTimeoutSeconds") Optional<Integer> responseTimeoutSeconds, @JsonProperty("maxRetries") Optional<Integer> maxRetries, @JsonProperty("failureStatusCodes") Optional<List<Integer>> failureStatusCodes) { ======= public HealthcheckOptions(@JsonProperty("uri") String uri, @JsonProperty("portIndex") Optional<Integer> portIndex, @JsonProperty("portNumber") Optional<Long> portNumber, @JsonProperty("protocol") Optional<HealthcheckProtocol> protocol, @JsonProperty("startupTimeoutSeconds") Optional<Integer> startupTimeoutSeconds, @JsonProperty("startupDelaySeconds") Optional<Integer> startupDelaySeconds, @JsonProperty("startupIntervalSeconds") Optional<Integer> startupIntervalSeconds, @JsonProperty("intervalSeconds") Optional<Integer> intervalSeconds, @JsonProperty("responseTimeoutSeconds") Optional<Integer> responseTimeoutSeconds, @JsonProperty("maxRetries") Optional<Integer> maxRetries, @JsonProperty("failureStatusCodes") Optional<List<Integer>> failureStatusCodes) { >>>>>>> public HealthcheckOptions(@JsonProperty("uri") String uri, @JsonProperty("portIndex") Optional<Integer> portIndex, @JsonProperty("portNumber") Optional<Long> portNumber, @JsonProperty("protocol") Optional<HealthcheckProtocol> protocol, @JsonProperty("method") Optional<HealthcheckMethod> method, @JsonProperty("startupTimeoutSeconds") Optional<Integer> startupTimeoutSeconds, @JsonProperty("startupDelaySeconds") Optional<Integer> startupDelaySeconds, @JsonProperty("startupIntervalSeconds") Optional<Integer> startupIntervalSeconds, @JsonProperty("intervalSeconds") Optional<Integer> intervalSeconds, @JsonProperty("responseTimeoutSeconds") Optional<Integer> responseTimeoutSeconds, @JsonProperty("maxRetries") Optional<Integer> maxRetries, @JsonProperty("failureStatusCodes") Optional<List<Integer>> failureStatusCodes) { <<<<<<< @ApiModelProperty(required=false, value="Healthcheck protocol - HTTP or HTTPS for HTTP/1, HTTP2 or HTTPS2 for HTTP/2") ======= @Schema(description = "Healthcheck protocol - HTTP or HTTPS") >>>>>>> @Schema(description = "Healthcheck protocol - HTTP or HTTPS for HTTP/1, HTTP2 or HTTPS2 for HTTP/2") <<<<<<< @ApiModelProperty(required=false, value="Healthcheck HTTP method - GET or POST, GET by default") public Optional<HealthcheckMethod> getMethod() { return method; } @ApiModelProperty(required=false, value="Consider the task unhealthy/failed if the app has not started responding to healthchecks in this amount of time") ======= @Schema(description = "Consider the task unhealthy/failed if the app has not started responding to healthchecks in this amount of time") >>>>>>> @Schema(description ="Healthcheck HTTP method - GET or POST; GET by default") public Optional<HealthcheckMethod> getMethod() { return method; } @Schema(description = "Consider the task unhealthy/failed if the app has not started responding to healthchecks in this amount of time")
<<<<<<< SingularityMesosSchedulerDelegator(@Named(SingularityMesosModule.SCHEDULER_LOCK_NAME) final Lock lock, SingularityExceptionNotifier exceptionNotifier, SingularityMesosScheduler scheduler, SingularityStartup startup, SingularityLeaderCacheCoordinator leaderCacheCoordinator, SingularityAbort abort) { ======= SingularityMesosSchedulerDelegator(SingularitySchedulerLock lock, SingularityExceptionNotifier exceptionNotifier, SingularityMesosScheduler scheduler, SingularityStartup startup, SingularityAbort abort) { >>>>>>> SingularityMesosSchedulerDelegator(SingularitySchedulerLock lock, SingularityExceptionNotifier exceptionNotifier, SingularityMesosScheduler scheduler, SingularityStartup startup, SingularityLeaderCacheCoordinator leaderCacheCoordinator, SingularityAbort abort) {
<<<<<<< ======= import com.hubspot.mesos.Resources; import com.hubspot.mesos.SingularityMesosArtifact; >>>>>>> import com.hubspot.mesos.Resources; import com.hubspot.mesos.SingularityMesosArtifact; <<<<<<< ======= Optional<String> runId = runNowRequest.getRunId().or(Optional.of(UUID.randomUUID().toString())); Optional<String> message = runNowRequest.getMessage() .or(pendingDeploy.getDeployMarker().getMessage()); Optional<String> user = pendingDeploy.getDeployMarker().getUser(); Optional<List<String>> commandLineArgs = runNowRequest.getCommandLineArgs(); Optional<Boolean> skipHealthChecks = runNowRequest.getSkipHealthchecks().or(request.getSkipHealthchecks()); Optional<Resources> resources = runNowRequest.getResources(); List<SingularityMesosArtifact> extraArtifacts = runNowRequest.getExtraArtifacts(); >>>>>>> <<<<<<< pendingType = PendingType.IMMEDIATE; ======= PendingType pendingType = canceledOr(deployResult.getDeployState(), PendingType.IMMEDIATE); requestManager.addToPendingQueue(new SingularityPendingRequest(requestId, deployId, timestamp, user, pendingType, commandLineArgs, runId, skipHealthChecks, message, Optional.absent(), resources, extraArtifacts, runNowRequest.getRunAt())); >>>>>>> pendingType = PendingType.IMMEDIATE; <<<<<<< pendingType = PendingType.NEW_DEPLOY; ======= PendingType pendingType = canceledOr(deployResult.getDeployState(), PendingType.NEW_DEPLOY); requestManager.addToPendingQueue(new SingularityPendingRequest(requestId, deployId, timestamp, user, pendingType, commandLineArgs, runId, skipHealthChecks, message, Optional.absent(), resources, extraArtifacts, runNowRequest.getRunAt())); >>>>>>> pendingType = PendingType.NEW_DEPLOY; <<<<<<< pendingType = PendingType.ONEOFF; ======= PendingType pendingType = canceledOr(deployResult.getDeployState(), PendingType.ONEOFF); requestManager.addToPendingQueue(new SingularityPendingRequest(requestId, deployId, timestamp, user, pendingType, commandLineArgs, runId, skipHealthChecks, message, Optional.absent(), resources, extraArtifacts, runNowRequest.getRunAt())); >>>>>>> pendingType = PendingType.ONEOFF; <<<<<<< pendingType = PendingType.NEW_DEPLOY; ======= PendingType pendingType = canceledOr(deployResult.getDeployState(), PendingType.NEW_DEPLOY); requestManager.addToPendingQueue(new SingularityPendingRequest(requestId, deployId, timestamp, user, pendingType, commandLineArgs, runId, skipHealthChecks, message, Optional.absent(), resources, extraArtifacts, runNowRequest.getRunAt())); >>>>>>> pendingType = PendingType.NEW_DEPLOY;
<<<<<<< rackAffinity, slavePlacement, requiredSlaveAttributes, scheduledExpectedRuntimeMillis, waitAtLeastMillisAfterTaskFinishesForReschedule, group); ======= rackAffinity, slavePlacement, scheduledExpectedRuntimeMillis, waitAtLeastMillisAfterTaskFinishesForReschedule, group, readOnlyGroups); >>>>>>> rackAffinity, slavePlacement, requiredSlaveAttributes, scheduledExpectedRuntimeMillis, waitAtLeastMillisAfterTaskFinishesForReschedule, group, readOnlyGroups); <<<<<<< public SingularityRequestBuilder setRequiredSlaveAttributes(Optional<Map<String, String>> requiredSlaveAttributes) { this.requiredSlaveAttributes = requiredSlaveAttributes; return this; } ======= public Optional<Set<String>> getReadOnlyGroups() { return readOnlyGroups; } public SingularityRequestBuilder setReadOnlyGroups(Optional<Set<String>> readOnlyGroups) { this.readOnlyGroups = readOnlyGroups; return this; } >>>>>>> public SingularityRequestBuilder setRequiredSlaveAttributes(Optional<Map<String, String>> requiredSlaveAttributes) { this.requiredSlaveAttributes = requiredSlaveAttributes; return this; } public Optional<Set<String>> getReadOnlyGroups() { return readOnlyGroups; } public SingularityRequestBuilder setReadOnlyGroups(Optional<Set<String>> readOnlyGroups) { this.readOnlyGroups = readOnlyGroups; return this; } <<<<<<< return "SingularityRequestBuilder [id=" + id + ", requestType=" + requestType + ", owners=" + owners + ", numRetriesOnFailure=" + numRetriesOnFailure + ", schedule=" + schedule + ", quartzSchedule=" + quartzSchedule + ", scheduleType=" + scheduleType + ", killOldNonLongRunningTasksAfterMillis=" + killOldNonLongRunningTasksAfterMillis + ", scheduledExpectedRuntimeMillis=" + scheduledExpectedRuntimeMillis + ", waitAtLeastMillisAfterTaskFinishesForReschedule=" + waitAtLeastMillisAfterTaskFinishesForReschedule + ", daemon=" + daemon + ", instances=" + instances + ", rackSensitive=" + rackSensitive + ", rackAffinity=" + rackAffinity + ", slavePlacement=" + slavePlacement + ", requiredSlaveAttrbiutes=" + requiredSlaveAttributes + ", loadBalanced=" + loadBalanced + ", group=" + group + "]"; ======= return "SingularityRequestBuilder[" + "id='" + id + '\'' + ", requestType=" + requestType + ", owners=" + owners + ", numRetriesOnFailure=" + numRetriesOnFailure + ", schedule=" + schedule + ", quartzSchedule=" + quartzSchedule + ", scheduleType=" + scheduleType + ", killOldNonLongRunningTasksAfterMillis=" + killOldNonLongRunningTasksAfterMillis + ", scheduledExpectedRuntimeMillis=" + scheduledExpectedRuntimeMillis + ", waitAtLeastMillisAfterTaskFinishesForReschedule=" + waitAtLeastMillisAfterTaskFinishesForReschedule + ", daemon=" + daemon + ", instances=" + instances + ", rackSensitive=" + rackSensitive + ", rackAffinity=" + rackAffinity + ", slavePlacement=" + slavePlacement + ", loadBalanced=" + loadBalanced + ", group=" + group + ", readOnlyGroups=" + readOnlyGroups + ']'; >>>>>>> return "SingularityRequestBuilder[" + "id='" + id + '\'' + ", requestType=" + requestType + ", owners=" + owners + ", numRetriesOnFailure=" + numRetriesOnFailure + ", schedule=" + schedule + ", quartzSchedule=" + quartzSchedule + ", scheduleType=" + scheduleType + ", killOldNonLongRunningTasksAfterMillis=" + killOldNonLongRunningTasksAfterMillis + ", scheduledExpectedRuntimeMillis=" + scheduledExpectedRuntimeMillis + ", waitAtLeastMillisAfterTaskFinishesForReschedule=" + waitAtLeastMillisAfterTaskFinishesForReschedule + ", daemon=" + daemon + ", instances=" + instances + ", rackSensitive=" + rackSensitive + ", rackAffinity=" + rackAffinity + ", slavePlacement=" + slavePlacement + ", requiredSlaveAttrbiutes=" + requiredSlaveAttributes + ", loadBalanced=" + loadBalanced + ", group=" + group + ", readOnlyGroups=" + readOnlyGroups + ']';
<<<<<<< import java.util.Collections; ======= import com.hubspot.singularity.event.SingularityEventListener; >>>>>>> import com.hubspot.singularity.event.SingularityEventListener; import java.util.Collections; <<<<<<< ======= if (!hasReadScope(user)) { return false; } if (groupsIntersect(getReadGroups(request), user.getGroups())) { return true; } if (isJita(user)) { LOG.warn( "JITA ACTION - User: {}, RequestId: {}, Scope Used: {}", user.getId(), request.getId(), scope ); singularityEventListener.elevatedAccessEvent( new ElevatedAccessEvent( user.getId(), request.getId(), scope, System.currentTimeMillis() ) ); return true; } return false; case DEPLOY: if (!scopesConfiguration.getDeploy().isEmpty()) { if (!hasDeployScope(user)) { return false; } if (groupsIntersect(getWriteGroups(request), user.getGroups())) { return true; } if (isJita(user)) { LOG.warn( "JITA ACTION - User: {}, RequestId: {}, Scope Used: {}", user.getId(), request.getId(), scope ); singularityEventListener.elevatedAccessEvent( new ElevatedAccessEvent( user.getId(), request.getId(), scope, System.currentTimeMillis() ) ); return true; } return false; } else { if (!hasWriteScope(user)) { return false; } if (groupsIntersect(getWriteGroups(request), user.getGroups())) { return true; } if (isJita(user)) { LOG.warn( "JITA ACTION - User: {}, RequestId: {}, Scope Used: {}", user.getId(), request.getId(), scope ); singularityEventListener.elevatedAccessEvent( new ElevatedAccessEvent( user.getId(), request.getId(), scope, System.currentTimeMillis() ) ); return true; } return false; } >>>>>>> <<<<<<< warnJita(user, scope, request.getId()); ======= LOG.warn( "JITA ACTION - User: {}, RequestId: {}, Scope Used: {}", user.getId(), request.getId(), scope ); singularityEventListener.elevatedAccessEvent( new ElevatedAccessEvent( user.getId(), request.getId(), scope, System.currentTimeMillis() ) ); >>>>>>> warnJita(user, scope, request.getId()); singularityEventListener.elevatedAccessEvent( new ElevatedAccessEvent( user.getId(), request.getId(), scope, System.currentTimeMillis() ) ); <<<<<<< warnJita(user, scope, requestId); ======= LOG.warn( "JITA ACTION - User: {}, RequestId: {}, Scope Used: {}", user.getId(), requestId, scope ); singularityEventListener.elevatedAccessEvent( new ElevatedAccessEvent( user.getId(), requestId, scope, System.currentTimeMillis() ) ); >>>>>>> warnJita(user, scope, requestId); singularityEventListener.elevatedAccessEvent( new ElevatedAccessEvent( user.getId(), requestId, scope, System.currentTimeMillis() ) );
<<<<<<< if (request.isRackSensitive() && configuration.isRebalanceRacksOnScaleDown()) { rebalancingHelper.rebalanceRacks(request, remainingActiveTasks, user.getEmail()); } if (request.getSlaveAttributeMinimums().isPresent()) { Set<SingularityTaskId> cleanedTasks = rebalancingHelper.rebalanceAttributeDistribution(request, user.getEmail(), remainingActiveTasks); remainingActiveTasks.removeAll(cleanedTasks); ======= if (oldRequest.get().getInstancesSafe() > rackManager.getNumActive()) { if (request.isRackSensitive() && configuration.isRebalanceRacksOnScaleDown()) { List<SingularityTaskId> extraCleanedTasks = new ArrayList<>(); int numActiveRacks = rackManager.getNumActive(); double perRack = request.getInstancesSafe() / (double) numActiveRacks; Multiset<String> countPerRack = HashMultiset.create(); for (SingularityTaskId taskId : remainingActiveTasks) { countPerRack.add(taskId.getSanitizedRackId()); LOG.info("{} - {} - {} - {}", countPerRack, perRack, extraCleanedTasks.size(), taskId); if (countPerRack.count(taskId.getSanitizedRackId()) > 1 && countPerRack.count(taskId.getSanitizedRackId()) > perRack && extraCleanedTasks.size() < numActiveRacks / 2) { extraCleanedTasks.add(taskId); LOG.info("Cleaning up task {} to evenly distribute tasks among racks", taskId); taskManager.createTaskCleanup(new SingularityTaskCleanup(user.getEmail(), TaskCleanupType.REBALANCE_RACKS, System.currentTimeMillis(), taskId, Optional.<String>absent(), Optional.<String>absent(), Optional .absent())); } } } >>>>>>> if (oldRequest.get().getInstancesSafe() > rackManager.getNumActive()) { if (request.isRackSensitive() && configuration.isRebalanceRacksOnScaleDown()) { rebalancingHelper.rebalanceRacks(request, remainingActiveTasks, user.getEmail()); } } if (request.getSlaveAttributeMinimums().isPresent()) { Set<SingularityTaskId> cleanedTasks = rebalancingHelper.rebalanceAttributeDistribution(request, user.getEmail(), remainingActiveTasks); remainingActiveTasks.removeAll(cleanedTasks);
<<<<<<< private Optional<String> loggingS3Bucket; ======= private Optional<Boolean> preserveTaskSandboxAfterFinish; >>>>>>> private Optional<Boolean> preserveTaskSandboxAfterFinish; private Optional<String> loggingS3Bucket; <<<<<<< Optional<String> user, List<String> extraCmdLineArgs, Optional<String> loggingTag, Map<String, String> loggingExtraFields, Optional<Long> sigKillProcessesAfterMillis, Optional<Integer> maxTaskThreads, Optional<String> loggingS3Bucket) { ======= Optional<String> user, List<String> extraCmdLineArgs, Optional<String> loggingTag, Map<String, String> loggingExtraFields, Optional<Long> sigKillProcessesAfterMillis, Optional<Integer> maxTaskThreads, Optional<Boolean> preserveTaskSandboxAfterFinish) { >>>>>>> Optional<String> user, List<String> extraCmdLineArgs, Optional<String> loggingTag, Map<String, String> loggingExtraFields, Optional<Long> sigKillProcessesAfterMillis, Optional<Integer> maxTaskThreads, Optional<Boolean> preserveTaskSandboxAfterFinish, Optional<String> loggingS3Bucket) { <<<<<<< this.loggingS3Bucket = loggingS3Bucket; ======= this.preserveTaskSandboxAfterFinish = preserveTaskSandboxAfterFinish; >>>>>>> this.preserveTaskSandboxAfterFinish = preserveTaskSandboxAfterFinish; this.loggingS3Bucket = loggingS3Bucket; <<<<<<< return new ExecutorData(cmd, embeddedArtifacts, externalArtifacts, s3Artifacts, successfulExitCodes, user, runningSentinel, extraCmdLineArgs, loggingTag, loggingExtraFields, sigKillProcessesAfterMillis, maxTaskThreads, loggingS3Bucket); ======= return new ExecutorData(cmd, embeddedArtifacts, externalArtifacts, s3Artifacts, successfulExitCodes, user, runningSentinel, extraCmdLineArgs, loggingTag, loggingExtraFields, sigKillProcessesAfterMillis, maxTaskThreads, preserveTaskSandboxAfterFinish); >>>>>>> return new ExecutorData(cmd, embeddedArtifacts, externalArtifacts, s3Artifacts, successfulExitCodes, user, runningSentinel, extraCmdLineArgs, loggingTag, loggingExtraFields, sigKillProcessesAfterMillis, maxTaskThreads, preserveTaskSandboxAfterFinish, loggingS3Bucket); <<<<<<< public Optional<String> getLoggingS3Bucket() { return loggingS3Bucket; } public ExecutorDataBuilder setLoggingS3Bucket(Optional<String> loggingS3Bucket) { this.loggingS3Bucket = loggingS3Bucket; return this; } ======= public Optional<Boolean> getPreserveTaskSandboxAfterFinish() { return preserveTaskSandboxAfterFinish; } public ExecutorDataBuilder setPreserveTaskSandboxAfterFinish(Optional<Boolean> preserveTaskSandboxAfterFinish) { this.preserveTaskSandboxAfterFinish = preserveTaskSandboxAfterFinish; return this; } >>>>>>> public Optional<Boolean> getPreserveTaskSandboxAfterFinish() { return preserveTaskSandboxAfterFinish; } public ExecutorDataBuilder setPreserveTaskSandboxAfterFinish(Optional<Boolean> preserveTaskSandboxAfterFinish) { this.preserveTaskSandboxAfterFinish = preserveTaskSandboxAfterFinish; return this; } public Optional<String> getLoggingS3Bucket() { return loggingS3Bucket; } public ExecutorDataBuilder setLoggingS3Bucket(Optional<String> loggingS3Bucket) { this.loggingS3Bucket = loggingS3Bucket; return this; } <<<<<<< return "ExecutorDataBuilder[" + "cmd='" + cmd + '\'' + ", embeddedArtifacts=" + embeddedArtifacts + ", externalArtifacts=" + externalArtifacts + ", s3Artifacts=" + s3Artifacts + ", successfulExitCodes=" + successfulExitCodes + ", runningSentinel=" + runningSentinel + ", user=" + user + ", extraCmdLineArgs=" + extraCmdLineArgs + ", loggingTag=" + loggingTag + ", loggingExtraFields=" + loggingExtraFields + ", sigKillProcessesAfterMillis=" + sigKillProcessesAfterMillis + ", maxTaskThreads=" + maxTaskThreads + ", loggingS3Bucket=" + loggingS3Bucket + ']'; ======= return "ExecutorDataBuilder [cmd=" + cmd + ", embeddedArtifacts=" + embeddedArtifacts + ", externalArtifacts=" + externalArtifacts + ", s3Artifacts=" + s3Artifacts + ", successfulExitCodes=" + successfulExitCodes + ", runningSentinel=" + runningSentinel + ", user=" + user + ", extraCmdLineArgs=" + extraCmdLineArgs + ", loggingTag=" + loggingTag + ", loggingExtraFields=" + loggingExtraFields + ", sigKillProcessesAfterMillis=" + sigKillProcessesAfterMillis + ", maxTaskThreads=" + maxTaskThreads + ", preserveTaskSandboxAfterFinish=" + preserveTaskSandboxAfterFinish + "]"; >>>>>>> return "ExecutorDataBuilder[" + "cmd='" + cmd + '\'' + ", embeddedArtifacts=" + embeddedArtifacts + ", externalArtifacts=" + externalArtifacts + ", s3Artifacts=" + s3Artifacts + ", successfulExitCodes=" + successfulExitCodes + ", runningSentinel=" + runningSentinel + ", user=" + user + ", extraCmdLineArgs=" + extraCmdLineArgs + ", loggingTag=" + loggingTag + ", loggingExtraFields=" + loggingExtraFields + ", sigKillProcessesAfterMillis=" + sigKillProcessesAfterMillis + ", maxTaskThreads=" + maxTaskThreads + ", preserveTaskSandboxAfterFinish=" + preserveTaskSandboxAfterFinish + ", loggingS3Bucket=" + loggingS3Bucket + ']';
<<<<<<< public static final String RETRY_WAIT_MS = "s3uploader.retry.wait.ms"; public static final String RETRY_COUNT = "s3uploader.retry.count"; ======= public static final String MAX_SINGLE_UPLOAD_BYTES = "s3uploader.max.single.upload.size"; public static final String UPLOAD_PART_SIZE = "s3uploader.upload.part.size"; >>>>>>> public static final String RETRY_WAIT_MS = "s3uploader.retry.wait.ms"; public static final String RETRY_COUNT = "s3uploader.retry.count"; public static final String MAX_SINGLE_UPLOAD_BYTES = "s3uploader.max.single.upload.size"; public static final String UPLOAD_PART_SIZE = "s3uploader.upload.part.size"; <<<<<<< @JsonProperty private int retryWaitMs = 1000; @JsonProperty private int retryCount = 2; ======= @JsonProperty private long maxSingleUploadSizeBytes = 5368709120L; @JsonProperty private long uploadPartSize = 20971520L; >>>>>>> @JsonProperty private int retryWaitMs = 1000; @JsonProperty private int retryCount = 2; @JsonProperty private long maxSingleUploadSizeBytes = 5368709120L; @JsonProperty private long uploadPartSize = 20971520L; <<<<<<< public int getRetryCount() { return retryCount; } public void setRetryCount(int retryCount) { this.retryCount = retryCount; } public int getRetryWaitMs() { return retryWaitMs; } public void setRetryWaitMs(int retryWaitMs) { this.retryWaitMs = retryWaitMs; } ======= public long getMaxSingleUploadSizeBytes() { return maxSingleUploadSizeBytes; } public void setMaxSingleUploadSizeBytes(long maxSingleUploadSizeBytes) { this.maxSingleUploadSizeBytes = maxSingleUploadSizeBytes; } public long getUploadPartSize() { return uploadPartSize; } public void setUploadPartSize(long uploadPartSize) { this.uploadPartSize = uploadPartSize; } >>>>>>> public int getRetryCount() { return retryCount; } public void setRetryCount(int retryCount) { this.retryCount = retryCount; } public int getRetryWaitMs() { return retryWaitMs; } public void setRetryWaitMs(int retryWaitMs) { this.retryWaitMs = retryWaitMs; } public long getMaxSingleUploadSizeBytes() { return maxSingleUploadSizeBytes; } public void setMaxSingleUploadSizeBytes(long maxSingleUploadSizeBytes) { this.maxSingleUploadSizeBytes = maxSingleUploadSizeBytes; } public long getUploadPartSize() { return uploadPartSize; } public void setUploadPartSize(long uploadPartSize) { this.uploadPartSize = uploadPartSize; } <<<<<<< ", retryWaitMs=" + retryWaitMs + ", retryCount=" + retryCount + ======= ", maxSingleUploadSizeBytes=" + maxSingleUploadSizeBytes + ", uploadPartSize=" + uploadPartSize + >>>>>>> ", retryWaitMs=" + retryWaitMs + ", retryCount=" + retryCount + ", maxSingleUploadSizeBytes=" + maxSingleUploadSizeBytes + ", uploadPartSize=" + uploadPartSize + <<<<<<< if (properties.containsKey(RETRY_COUNT)) { setRetryCount(Integer.parseInt(properties.getProperty(RETRY_COUNT))); } if (properties.containsKey(RETRY_WAIT_MS)) { setRetryWaitMs(Integer.parseInt(RETRY_WAIT_MS)); } ======= if (properties.containsKey(MAX_SINGLE_UPLOAD_BYTES)) { setMaxSingleUploadSizeBytes(Long.parseLong(properties.getProperty(MAX_SINGLE_UPLOAD_BYTES))); } if (properties.containsKey(UPLOAD_PART_SIZE)) { setUploadPartSize(Long.parseLong(properties.getProperty(UPLOAD_PART_SIZE))); } >>>>>>> if (properties.containsKey(RETRY_COUNT)) { setRetryCount(Integer.parseInt(properties.getProperty(RETRY_COUNT))); } if (properties.containsKey(RETRY_WAIT_MS)) { setRetryWaitMs(Integer.parseInt(RETRY_WAIT_MS)); } if (properties.containsKey(MAX_SINGLE_UPLOAD_BYTES)) { setMaxSingleUploadSizeBytes(Long.parseLong(properties.getProperty(MAX_SINGLE_UPLOAD_BYTES))); } if (properties.containsKey(UPLOAD_PART_SIZE)) { setUploadPartSize(Long.parseLong(properties.getProperty(UPLOAD_PART_SIZE))); }
<<<<<<< } else if (value instanceof UUID) { if (titanPredicate == Cmp.EQUAL) { return (key + ":\"" + escapeValue(value) + "\""); } else if (titanPredicate == Cmp.NOT_EQUAL) { return ("-" + key + ":\"" + escapeValue(value) + "\""); } else { throw new IllegalArgumentException("Relation is not supported for uuid value: " + titanPredicate); } } else throw new IllegalArgumentException("Unsupported type: " + value); ======= } else if (value instanceof Date) { String queryValue = escapeValue(toIsoDate((Date)value)); Preconditions.checkArgument(titanPredicate instanceof Cmp, "Relation not supported on date types: " + titanPredicate); Cmp numRel = (Cmp) titanPredicate; switch (numRel) { case EQUAL: return (key + ":" + queryValue); case NOT_EQUAL: return ("-" + key + ":" + queryValue); case LESS_THAN: //use right curly to mean up to but not including value return (key + ":[* TO " + queryValue + "}"); case LESS_THAN_EQUAL: return (key + ":[* TO " + queryValue + "]"); case GREATER_THAN: //use left curly to mean greater than but not including value return (key + ":{" + queryValue + " TO *]"); case GREATER_THAN_EQUAL: return (key + ":[" + queryValue + " TO *]"); default: throw new IllegalArgumentException("Unexpected relation: " + numRel); } } else if (value instanceof Boolean) { Cmp numRel = (Cmp) titanPredicate; String queryValue = escapeValue(value); switch (numRel) { case EQUAL: return (key + ":" + queryValue); case NOT_EQUAL: return ("-" + key + ":" + queryValue); default: throw new IllegalArgumentException("Boolean types only support EQUAL or NOT_EQUAL"); } } else throw new IllegalArgumentException("Unsupported type: " + value); >>>>>>> } else if (value instanceof Date) { String queryValue = escapeValue(toIsoDate((Date)value)); Preconditions.checkArgument(titanPredicate instanceof Cmp, "Relation not supported on date types: " + titanPredicate); Cmp numRel = (Cmp) titanPredicate; switch (numRel) { case EQUAL: return (key + ":" + queryValue); case NOT_EQUAL: return ("-" + key + ":" + queryValue); case LESS_THAN: //use right curly to mean up to but not including value return (key + ":[* TO " + queryValue + "}"); case LESS_THAN_EQUAL: return (key + ":[* TO " + queryValue + "]"); case GREATER_THAN: //use left curly to mean greater than but not including value return (key + ":{" + queryValue + " TO *]"); case GREATER_THAN_EQUAL: return (key + ":[" + queryValue + " TO *]"); default: throw new IllegalArgumentException("Unexpected relation: " + numRel); } } else if (value instanceof Boolean) { Cmp numRel = (Cmp) titanPredicate; String queryValue = escapeValue(value); switch (numRel) { case EQUAL: return (key + ":" + queryValue); case NOT_EQUAL: return ("-" + key + ":" + queryValue); default: throw new IllegalArgumentException("Boolean types only support EQUAL or NOT_EQUAL"); } } else if (value instanceof UUID) { if (titanPredicate == Cmp.EQUAL) { return (key + ":\"" + escapeValue(value) + "\""); } else if (titanPredicate == Cmp.NOT_EQUAL) { return ("-" + key + ":\"" + escapeValue(value) + "\""); } else { throw new IllegalArgumentException("Relation is not supported for uuid value: " + titanPredicate); } } else throw new IllegalArgumentException("Unsupported type: " + value); <<<<<<< } else if (dataType == UUID.class) { return titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL; ======= } else if (dataType == Date.class) { if (titanPredicate instanceof Cmp) return true; } else if (dataType == Boolean.class) { return titanPredicate == Cmp.EQUAL || titanPredicate == Cmp.NOT_EQUAL; >>>>>>> } else if (dataType == Date.class) { if (titanPredicate instanceof Cmp) return true; } else if (dataType == Boolean.class) { return titanPredicate == Cmp.EQUAL || titanPredicate == Cmp.NOT_EQUAL; } else if (dataType == UUID.class) { return titanPredicate == Cmp.EQUAL || titanPredicate==Cmp.NOT_EQUAL; <<<<<<< if (Number.class.isAssignableFrom(dataType) || dataType == Geoshape.class || dataType == UUID.class) { ======= if (Number.class.isAssignableFrom(dataType) || dataType == Geoshape.class || dataType == Date.class || dataType == Boolean.class) { >>>>>>> if (Number.class.isAssignableFrom(dataType) || dataType == Geoshape.class || dataType == Date.class || dataType == Boolean.class || dataType == UUID.class) { <<<<<<< } else if (datatype.equals(UUID.class)) { postfix = "_uuid"; }else throw new IllegalArgumentException("Unsupported data type ["+datatype+"] for field: " + key); ======= } else if (datatype.equals(Date.class)) { postfix = "_dt"; } else if (datatype.equals(Boolean.class)) { postfix = "_b"; } else throw new IllegalArgumentException("Unsupported data type ["+datatype+"] for field: " + key); >>>>>>> } else if (datatype.equals(Date.class)) { postfix = "_dt"; } else if (datatype.equals(Boolean.class)) { postfix = "_b"; } else if (datatype.equals(UUID.class)) { postfix = "_uuid"; } else throw new IllegalArgumentException("Unsupported data type ["+datatype+"] for field: " + key);
<<<<<<< public static final String MAX_SINGLE_UPLOAD_BYTES = "s3uploader.max.single.upload.size"; public static final String UPLOAD_PART_SIZE = "s3uploader.upload.part.size"; ======= public static final String MAX_SINGLE_UPLOAD_BYTES = "s3uploader.max.single.upload.size"; public static final String UPLOAD_PART_SIZE = "s3uploader.upload.part.size"; public static final String CHECK_FOR_OPEN_FILES = "s3uploader.check.for.open.files"; >>>>>>> public static final String CHECK_FOR_OPEN_FILES = "s3uploader.check.for.open.files"; <<<<<<< @JsonProperty private long maxSingleUploadSizeBytes = 5368709120L; @JsonProperty private long uploadPartSize = 20971520L; ======= @JsonProperty private long maxSingleUploadSizeBytes = 5368709120L; @JsonProperty private long uploadPartSize = 20971520L; @JsonProperty private boolean checkForOpenFiles = true; >>>>>>> @JsonProperty private boolean checkForOpenFiles = true; <<<<<<< public long getMaxSingleUploadSizeBytes() { return maxSingleUploadSizeBytes; } public void setMaxSingleUploadSizeBytes(long maxSingleUploadSizeBytes) { this.maxSingleUploadSizeBytes = maxSingleUploadSizeBytes; } public long getUploadPartSize() { return uploadPartSize; } public void setUploadPartSize(long uploadPartSize) { this.uploadPartSize = uploadPartSize; } ======= public long getMaxSingleUploadSizeBytes() { return maxSingleUploadSizeBytes; } public void setMaxSingleUploadSizeBytes(long maxSingleUploadSizeBytes) { this.maxSingleUploadSizeBytes = maxSingleUploadSizeBytes; } public long getUploadPartSize() { return uploadPartSize; } public void setUploadPartSize(long uploadPartSize) { this.uploadPartSize = uploadPartSize; } public boolean isCheckForOpenFiles() { return checkForOpenFiles; } public void setCheckForOpenFiles(boolean checkForOpenFiles) { this.checkForOpenFiles = checkForOpenFiles; } >>>>>>> public boolean isCheckForOpenFiles() { return checkForOpenFiles; } public void setCheckForOpenFiles(boolean checkForOpenFiles) { this.checkForOpenFiles = checkForOpenFiles; } <<<<<<< if (properties.containsKey(MAX_SINGLE_UPLOAD_BYTES)) { setMaxSingleUploadSizeBytes(Long.parseLong(properties.getProperty(MAX_SINGLE_UPLOAD_BYTES))); } if (properties.containsKey(UPLOAD_PART_SIZE)) { setUploadPartSize(Long.parseLong(properties.getProperty(UPLOAD_PART_SIZE))); } ======= if (properties.containsKey(MAX_SINGLE_UPLOAD_BYTES)) { setMaxSingleUploadSizeBytes(Long.parseLong(properties.getProperty(MAX_SINGLE_UPLOAD_BYTES))); } if (properties.containsKey(UPLOAD_PART_SIZE)) { setUploadPartSize(Long.parseLong(properties.getProperty(UPLOAD_PART_SIZE))); } if (properties.containsKey(CHECK_FOR_OPEN_FILES)) { setCheckForOpenFiles(Boolean.parseBoolean(properties.getProperty(CHECK_FOR_OPEN_FILES))); } >>>>>>> if (properties.containsKey(CHECK_FOR_OPEN_FILES)) { setCheckForOpenFiles(Boolean.parseBoolean(properties.getProperty(CHECK_FOR_OPEN_FILES))); }
<<<<<<< ======= import ch.qos.logback.classic.LoggerContext; >>>>>>> <<<<<<< public SingularityAbort(SingularitySmtpSender smtpSender, ServerProvider serverProvider, SingularityConfiguration configuration, SingularityExceptionNotifier exceptionNotifier, @Named(SingularityMainModule.HTTP_HOST_AND_PORT) HostAndPort hostAndPort) { ======= public SingularityAbort(SingularitySmtpSender smtpSender, SingularityConfiguration configuration, ServerProvider serverProvider, SingularityExceptionNotifier exceptionNotifier, @Named(SingularityMainModule.HTTP_HOST_AND_PORT) HostAndPort hostAndPort) { >>>>>>> public SingularityAbort(SingularitySmtpSender smtpSender, ServerProvider serverProvider, SingularityConfiguration configuration, SingularityExceptionNotifier exceptionNotifier, @Named(SingularityMainModule.HTTP_HOST_AND_PORT) HostAndPort hostAndPort) { <<<<<<< this.serverProvider = serverProvider; this.hostAndPort = hostAndPort; ======= this.hostAndPort = hostAndPort; >>>>>>> this.hostAndPort = hostAndPort; <<<<<<< try { serverProvider.get().stop(); } catch (Throwable t) { LOG.error("Failed to call stop() on server", t); } finally { System.exit(1); } } private void sendAbortNotification(AbortReason abortReason) { final String message = String.format("Singularity on %s is aborting due to %s", hostAndPort.getHostText()); sendAbortMail(message); exceptionNotifier.notify(message); ======= Optional<Server> server = serverProvider.get(); if (server.isPresent()) { try { server.get().stop(); } catch (Exception e) { LOG.warn("While aborting server", e); } finally { System.exit(1); } } else { LOG.warn("SingularityAbort called before server has fully initialized!"); System.exit(1); // Use the hammer. } } private void sendAbortNotification(AbortReason abortReason) { final String message = String.format("Singularity on %s is aborting due to %s", hostAndPort.getHostText(), abortReason); sendAbortMail(message); exceptionNotifier.notify(message); >>>>>>> try { serverProvider.get().stop(); } catch (Throwable t) { LOG.error("Failed to call stop() on server", t); } finally { System.exit(1); } } private void sendAbortNotification(AbortReason abortReason) { final String message = String.format("Singularity on %s is aborting due to %s", hostAndPort.getHostText(), abortReason); sendAbortMail(message); exceptionNotifier.notify(message);
<<<<<<< import java.util.Map; ======= import java.util.List; >>>>>>> import java.util.List; import java.util.Map;
<<<<<<< @JsonProperty("actionId") String actionId, @JsonProperty("bounce") Optional<Boolean> bounce) { super(scaleRequest, requestId, user, startMillis, actionId); ======= @JsonProperty("actionId") String actionId) { super(scaleRequest, user, startMillis, actionId, requestId); >>>>>>> @JsonProperty("actionId") String actionId, @JsonProperty("bounce") Optional<Boolean> bounce) { super(scaleRequest, user, startMillis, actionId, requestId);
<<<<<<< ======= import static com.google.common.base.Preconditions.checkNotNull; >>>>>>> import static com.google.common.base.Preconditions.checkNotNull; <<<<<<< import com.hubspot.singularity.bundles.CorsBundle; ======= import com.hubspot.singularity.bundles.AcceptLanguageFilterBundle; import com.hubspot.singularity.bundles.CorsBundle; >>>>>>> import com.hubspot.singularity.bundles.CorsBundle;
<<<<<<< private Optional<Integer> expectedRacksCount = Optional.empty(); ======= private double preferredSlaveScaleFactor = 1.5; // high cpu slave, based on cpu to memory ratio private double highCpuSlaveCutOff = 1.5; //TODO // high memory slave, based on cpu to memory ratio private double highMemorySlaveCutOff = 0.5; //TODO >>>>>>> private Optional<Integer> expectedRacksCount = Optional.empty(); private double preferredSlaveScaleFactor = 1.5; // high cpu slave, based on cpu to memory ratio private double highCpuSlaveCutOff = 1.5; //TODO // high memory slave, based on cpu to memory ratio private double highMemorySlaveCutOff = 0.5; //TODO <<<<<<< public Optional<Integer> getExpectedRacksCount() { return expectedRacksCount; } public void setExpectedRacksCount(Optional<Integer> expectedRacksCount) { this.expectedRacksCount = expectedRacksCount; } ======= public double getPreferredSlaveScaleFactor() { return preferredSlaveScaleFactor; } public void setPreferredSlaveScaleFactor(double preferredSlaveScaleFactor) { this.preferredSlaveScaleFactor = preferredSlaveScaleFactor; } public double getHighCpuSlaveCutOff() { return highCpuSlaveCutOff; } public void setHighCpuSlaveCutOff(double highCpuSlaveCutOff) { this.highCpuSlaveCutOff = highCpuSlaveCutOff; } public double getHighMemorySlaveCutOff() { return highMemorySlaveCutOff; } public void setHighMemorySlaveCutOff(double highMemorySlaveCutOff) { this.highMemorySlaveCutOff = highMemorySlaveCutOff; } >>>>>>> public double getPreferredSlaveScaleFactor() { return preferredSlaveScaleFactor; } public void setPreferredSlaveScaleFactor(double preferredSlaveScaleFactor) { this.preferredSlaveScaleFactor = preferredSlaveScaleFactor; } public double getHighCpuSlaveCutOff() { return highCpuSlaveCutOff; } public void setHighCpuSlaveCutOff(double highCpuSlaveCutOff) { this.highCpuSlaveCutOff = highCpuSlaveCutOff; } public double getHighMemorySlaveCutOff() { return highMemorySlaveCutOff; } public void setHighMemorySlaveCutOff(double highMemorySlaveCutOff) { this.highMemorySlaveCutOff = highMemorySlaveCutOff; } public Optional<Integer> getExpectedRacksCount() { return expectedRacksCount; } public void setExpectedRacksCount(Optional<Integer> expectedRacksCount) { this.expectedRacksCount = expectedRacksCount; }
<<<<<<< import java.util.Map; ======= import java.util.Objects; >>>>>>> import java.util.Map; import java.util.Objects; <<<<<<< private final Map<String, String> envOverrides; ======= private final List<SingularityMesosArtifact> extraArtifacts; >>>>>>> private final Map<String, String> envOverrides; private final List<SingularityMesosArtifact> extraArtifacts; <<<<<<< this(requestId, deployId, timestamp, user, pendingType, cmdLineArgsList, runId, skipHealthchecks, message, actionId, Optional.<Resources>absent(),null, Optional.<Long>absent()); ======= this(requestId, deployId, timestamp, user, pendingType, cmdLineArgsList, runId, skipHealthchecks, message, actionId, Optional.<Resources>absent(), null, Optional.<Long>absent()); >>>>>>> this(requestId, deployId, timestamp, user, pendingType, cmdLineArgsList, runId, skipHealthchecks, message, actionId, Optional.<Resources>absent(), null, null, Optional.<Long>absent()); <<<<<<< public SingularityPendingRequest( @JsonProperty("requestId") String requestId, @JsonProperty("deployId") String deployId, @JsonProperty("timestamp") long timestamp, @JsonProperty("user") Optional<String> user, @JsonProperty("pendingType") PendingType pendingType, @JsonProperty("cmdLineArgsList") Optional<List<String>> cmdLineArgsList, @JsonProperty("runId") Optional<String> runId, @JsonProperty("skipHealthchecks") Optional<Boolean> skipHealthchecks, @JsonProperty("message") Optional<String> message, @JsonProperty("actionId") Optional<String> actionId, @JsonProperty("resources") Optional<Resources> resources, @JsonProperty("envOverrides") Map<String, String> envOverrides, @JsonProperty("runAt") Optional<Long> runAt) { ======= public SingularityPendingRequest(@JsonProperty("requestId") String requestId, @JsonProperty("deployId") String deployId, @JsonProperty("timestamp") long timestamp, @JsonProperty("user") Optional<String> user, @JsonProperty("pendingType") PendingType pendingType, @JsonProperty("cmdLineArgsList") Optional<List<String>> cmdLineArgsList, @JsonProperty("runId") Optional<String> runId, @JsonProperty("skipHealthchecks") Optional<Boolean> skipHealthchecks, @JsonProperty("message") Optional<String> message, @JsonProperty("actionId") Optional<String> actionId, @JsonProperty("resources") Optional<Resources> resources, @JsonProperty("extraArtifacts") List<SingularityMesosArtifact> extraArtifacts, @JsonProperty("runAt") Optional<Long> runAt) { >>>>>>> public SingularityPendingRequest(@JsonProperty("requestId") String requestId, @JsonProperty("deployId") String deployId, @JsonProperty("timestamp") long timestamp, @JsonProperty("user") Optional<String> user, @JsonProperty("pendingType") PendingType pendingType, @JsonProperty("cmdLineArgsList") Optional<List<String>> cmdLineArgsList, @JsonProperty("runId") Optional<String> runId, @JsonProperty("skipHealthchecks") Optional<Boolean> skipHealthchecks, @JsonProperty("message") Optional<String> message, @JsonProperty("actionId") Optional<String> actionId, @JsonProperty("resources") Optional<Resources> resources, @JsonProperty("envOverrides") Map<String, String> envOverrides, @JsonProperty("extraArtifacts") List<SingularityMesosArtifact> extraArtifacts, @JsonProperty("runAt") Optional<Long> runAt) { <<<<<<< this.envOverrides = envOverrides == null ? Collections.emptyMap() : envOverrides; ======= if (Objects.nonNull(extraArtifacts)) { this.extraArtifacts = extraArtifacts; } else { this.extraArtifacts = Collections.emptyList(); } >>>>>>> if (Objects.nonNull(envOverrides)) { this.envOverrides = envOverrides; } else { this.envOverrides = Collections.emptyMap(); } if (Objects.nonNull(extraArtifacts)) { this.extraArtifacts = extraArtifacts; } else { this.extraArtifacts = Collections.emptyList(); } <<<<<<< public Map<String, String> getEnvOverrides() { return envOverrides; } ======= public List<SingularityMesosArtifact> getExtraArtifacts() { return extraArtifacts; } >>>>>>> public Map<String, String> getEnvOverrides() { return envOverrides; } public List<SingularityMesosArtifact> getExtraArtifacts() { return extraArtifacts; }
<<<<<<< import com.hubspot.singularity.mesos.SingularitySchedulerLock; ======= import com.hubspot.singularity.data.DisasterManager; import com.hubspot.singularity.mesos.SingularityMesosModule; >>>>>>> import com.hubspot.singularity.mesos.SingularitySchedulerLock; import com.hubspot.singularity.data.DisasterManager; <<<<<<< SingularityDeployPoller(SingularityDeployChecker deployChecker, SingularityConfiguration configuration, SingularitySchedulerLock lock) { ======= SingularityDeployPoller(SingularityDeployChecker deployChecker, SingularityConfiguration configuration, @Named(SingularityMesosModule.SCHEDULER_LOCK_NAME) final Lock lock, DisasterManager disasterManager) { >>>>>>> SingularityDeployPoller(SingularityDeployChecker deployChecker, SingularityConfiguration configuration, SingularitySchedulerLock lock, DisasterManager disasterManager) {
<<<<<<< @NotEmpty @JsonProperty private String switchUserCommandFormat = "sudo -E -u %s"; ======= @JsonProperty @NotEmpty private List<String> artifactSignatureVerificationCommand = Arrays.asList("/usr/bin/gpg", "--verify", "{artifactSignaturePath}"); @JsonProperty private boolean failTaskOnInvalidArtifactSignature = true; @JsonProperty @NotEmpty private String signatureVerifyOut = "executor.gpg.out"; >>>>>>> @NotEmpty @JsonProperty private String switchUserCommandFormat = "sudo -E -u %s"; @JsonProperty @NotEmpty private List<String> artifactSignatureVerificationCommand = Arrays.asList("/usr/bin/gpg", "--verify", "{artifactSignaturePath}"); @JsonProperty private boolean failTaskOnInvalidArtifactSignature = true; @JsonProperty @NotEmpty private String signatureVerifyOut = "executor.gpg.out"; <<<<<<< public String getSwitchUserCommandFormat() { return switchUserCommandFormat; } public void setSwitchUserCommandFormat(String switchUserCommandFormat) { this.switchUserCommandFormat = switchUserCommandFormat; } ======= public List<String> getArtifactSignatureVerificationCommand() { return artifactSignatureVerificationCommand; } public void setArtifactSignatureVerificationCommand(List<String> artifactSignatureVerificationCommand) { this.artifactSignatureVerificationCommand = artifactSignatureVerificationCommand; } public boolean isFailTaskOnInvalidArtifactSignature() { return failTaskOnInvalidArtifactSignature; } public void setFailTaskOnInvalidArtifactSignature(boolean failTaskOnInvalidArtifactSignature) { this.failTaskOnInvalidArtifactSignature = failTaskOnInvalidArtifactSignature; } public String getSignatureVerifyOut() { return signatureVerifyOut; } public void setSignatureVerifyOut(String signatureVerifyOut) { this.signatureVerifyOut = signatureVerifyOut; } >>>>>>> public String getSwitchUserCommandFormat() { return switchUserCommandFormat; } public void setSwitchUserCommandFormat(String switchUserCommandFormat) { this.switchUserCommandFormat = switchUserCommandFormat; } public List<String> getArtifactSignatureVerificationCommand() { return artifactSignatureVerificationCommand; } public void setArtifactSignatureVerificationCommand(List<String> artifactSignatureVerificationCommand) { this.artifactSignatureVerificationCommand = artifactSignatureVerificationCommand; } public boolean isFailTaskOnInvalidArtifactSignature() { return failTaskOnInvalidArtifactSignature; } public void setFailTaskOnInvalidArtifactSignature(boolean failTaskOnInvalidArtifactSignature) { this.failTaskOnInvalidArtifactSignature = failTaskOnInvalidArtifactSignature; } public String getSignatureVerifyOut() { return signatureVerifyOut; } public void setSignatureVerifyOut(String signatureVerifyOut) { this.signatureVerifyOut = signatureVerifyOut; }
<<<<<<< ", applyS3StorageClassAfterBytes='" + applyS3StorageClassAfterBytes + '\'' + ", s3StorageClass='" + s3StorageClass + '\'' + ']'; ======= ", useFileAttributes=" + useFileAttributes + '}'; >>>>>>> ", applyS3StorageClassAfterBytes='" + applyS3StorageClassAfterBytes + '\'' + ", s3StorageClass='" + s3StorageClass + '\'' + ", useFileAttributes=" + useFileAttributes + '}';
<<<<<<< final List<String> to = getOwners(request); final String subject = String.format("Task %s has not started yet", taskId.getId()); ======= final List<String> to = request.getOwners(); final String subject = String.format("Task %s has not started yet — Singularity", taskId.getId()); >>>>>>> final List<String> to = getOwners(request); final String subject = String.format("Task %s has not started yet — Singularity", taskId.getId()); <<<<<<< final List<String> to = getOwners(request); final String subject = String.format("Request %s is PAUSED", request.getId()); ======= final List<String> to = request.getOwners(); final String subject = String.format("Request %s is paused — Singularity", request.getId()); >>>>>>> final List<String> to = getOwners(request); final String subject = String.format("Request %s is paused — Singularity", request.getId()); <<<<<<< private String getSubjectForTaskHistory(SingularityTaskId taskId, TaskState state, Collection<SingularityTaskHistoryUpdate> history) { if (!taskEverRan(history)) { return String.format("(%s) - Task %s never started in mesos", state.name(), taskId.toString()); ======= private String getSubjectForTaskHistory(SingularityTaskId taskId, TaskState state, Optional<SingularityTaskHistory> taskHistory) { if (!taskHistory.isPresent() || !taskEverRan(taskHistory.get())) { return String.format("Task %s never started in mesos (State: %s) — Singularity", taskId.toString(), state.name()); >>>>>>> private String getSubjectForTaskHistory(SingularityTaskId taskId, TaskState state, Collection<SingularityTaskHistoryUpdate> history) { if (!taskEverRan(history)) { return String.format("Task %s never started in mesos (State: %s) — Singularity", taskId.toString(), state.name());
<<<<<<< import java.util.Collections; ======= import java.util.Optional; >>>>>>> import java.util.Collections; import java.util.Optional; <<<<<<< Collection<String> prefixes = SingularityS3FormatHelper.getS3KeyPrefixes("%Y/%m/%taskId", taskId, Optional.<String> absent(), start, end, "default", Collections.emptyList()); ======= Collection<String> prefixes = SingularityS3FormatHelper.getS3KeyPrefixes("%Y/%m/%taskId", taskId, Optional.<String>empty(), start, end, "default"); >>>>>>> Collection<String> prefixes = SingularityS3FormatHelper.getS3KeyPrefixes("%Y/%m/%taskId", taskId, Optional.<String>empty(), start, end, "default", Collections.emptyList()); <<<<<<< prefixes = SingularityS3FormatHelper.getS3KeyPrefixes("%Y/%taskId", taskId, Optional.<String> absent(), start, end, "default", Collections.emptyList()); ======= prefixes = SingularityS3FormatHelper.getS3KeyPrefixes("%Y/%taskId", taskId, Optional.<String>empty(), start, end, "default"); >>>>>>> prefixes = SingularityS3FormatHelper.getS3KeyPrefixes("%Y/%taskId", taskId, Optional.<String>empty(), start, end, "default", Collections.emptyList());
<<<<<<< @JsonProperty public List<SingularityExecutorShellCommandDescriptor> shellCommands = Collections.emptyList(); @JsonProperty public String shellCommandOutFile = "executor.commands.log"; @JsonProperty private String pidCommandPlaceholder = "{PID}"; ======= @NotEmpty @JsonProperty private String cgroupsMesosCpuTasksFormat = "/cgroup/cpu/%s/tasks"; @NotEmpty @JsonProperty private String procCgroupFormat = "/proc/%s/cgroup"; @NotEmpty @JsonProperty private String switchUserCommandFormat = "sudo -E -u %s"; @JsonProperty @NotEmpty private List<String> artifactSignatureVerificationCommand = Arrays.asList("/usr/bin/gpg", "--verify", "{artifactSignaturePath}"); @JsonProperty private boolean failTaskOnInvalidArtifactSignature = true; @JsonProperty @NotEmpty private String signatureVerifyOut = "executor.gpg.out"; >>>>>>> @NotEmpty @JsonProperty private String cgroupsMesosCpuTasksFormat = "/cgroup/cpu/%s/tasks"; @NotEmpty @JsonProperty private String procCgroupFormat = "/proc/%s/cgroup"; @NotEmpty @JsonProperty private String switchUserCommandFormat = "sudo -E -u %s"; @JsonProperty @NotEmpty private List<String> artifactSignatureVerificationCommand = Arrays.asList("/usr/bin/gpg", "--verify", "{artifactSignaturePath}"); @JsonProperty private boolean failTaskOnInvalidArtifactSignature = true; @JsonProperty @NotEmpty private String signatureVerifyOut = "executor.gpg.out"; @JsonProperty public List<SingularityExecutorShellCommandDescriptor> shellCommands = Collections.emptyList(); @JsonProperty public String shellCommandOutFile = "executor.commands.log"; @JsonProperty private String pidCommandPlaceholder = "{PID}"; <<<<<<< public List<SingularityExecutorShellCommandDescriptor> getShellCommands() { return shellCommands; } public void setShellCommands(List<SingularityExecutorShellCommandDescriptor> shellCommands) { this.shellCommands = shellCommands; } public String getShellCommandOutFile() { return shellCommandOutFile; } public void setShellCommandOutFile(String shellCommandOutFile) { this.shellCommandOutFile = shellCommandOutFile; } ======= public String getCgroupsMesosCpuTasksFormat() { return cgroupsMesosCpuTasksFormat; } public void setCgroupsMesosCpuTasksFormat(String cgroupsMesosCpuTasksFormat) { this.cgroupsMesosCpuTasksFormat = cgroupsMesosCpuTasksFormat; } public String getProcCgroupFormat() { return procCgroupFormat; } public void setProcCgroupFormat(String procCgroupFormat) { this.procCgroupFormat = procCgroupFormat; } public String getSwitchUserCommandFormat() { return switchUserCommandFormat; } public void setSwitchUserCommandFormat(String switchUserCommandFormat) { this.switchUserCommandFormat = switchUserCommandFormat; } public List<String> getArtifactSignatureVerificationCommand() { return artifactSignatureVerificationCommand; } public void setArtifactSignatureVerificationCommand(List<String> artifactSignatureVerificationCommand) { this.artifactSignatureVerificationCommand = artifactSignatureVerificationCommand; } public boolean isFailTaskOnInvalidArtifactSignature() { return failTaskOnInvalidArtifactSignature; } public void setFailTaskOnInvalidArtifactSignature(boolean failTaskOnInvalidArtifactSignature) { this.failTaskOnInvalidArtifactSignature = failTaskOnInvalidArtifactSignature; } public String getSignatureVerifyOut() { return signatureVerifyOut; } public void setSignatureVerifyOut(String signatureVerifyOut) { this.signatureVerifyOut = signatureVerifyOut; } >>>>>>> public String getCgroupsMesosCpuTasksFormat() { return cgroupsMesosCpuTasksFormat; } public void setCgroupsMesosCpuTasksFormat(String cgroupsMesosCpuTasksFormat) { this.cgroupsMesosCpuTasksFormat = cgroupsMesosCpuTasksFormat; } public String getProcCgroupFormat() { return procCgroupFormat; } public void setProcCgroupFormat(String procCgroupFormat) { this.procCgroupFormat = procCgroupFormat; } public String getSwitchUserCommandFormat() { return switchUserCommandFormat; } public void setSwitchUserCommandFormat(String switchUserCommandFormat) { this.switchUserCommandFormat = switchUserCommandFormat; } public List<String> getArtifactSignatureVerificationCommand() { return artifactSignatureVerificationCommand; } public void setArtifactSignatureVerificationCommand(List<String> artifactSignatureVerificationCommand) { this.artifactSignatureVerificationCommand = artifactSignatureVerificationCommand; } public boolean isFailTaskOnInvalidArtifactSignature() { return failTaskOnInvalidArtifactSignature; } public void setFailTaskOnInvalidArtifactSignature(boolean failTaskOnInvalidArtifactSignature) { this.failTaskOnInvalidArtifactSignature = failTaskOnInvalidArtifactSignature; } public String getSignatureVerifyOut() { return signatureVerifyOut; } public void setSignatureVerifyOut(String signatureVerifyOut) { this.signatureVerifyOut = signatureVerifyOut; } public List<SingularityExecutorShellCommandDescriptor> getShellCommands() { return shellCommands; } public void setShellCommands(List<SingularityExecutorShellCommandDescriptor> shellCommands) { this.shellCommands = shellCommands; } public String getShellCommandOutFile() { return shellCommandOutFile; } public void setShellCommandOutFile(String shellCommandOutFile) { this.shellCommandOutFile = shellCommandOutFile; } <<<<<<< return "SingularityExecutorConfiguration [executorJavaLog=" + executorJavaLog + ", executorBashLog=" + executorBashLog + ", serviceLog=" + serviceLog + ", defaultRunAsUser=" + defaultRunAsUser + ", taskAppDirectory=" + taskAppDirectory + ", shutdownTimeoutWaitMillis=" + shutdownTimeoutWaitMillis + ", idleExecutorShutdownWaitMillis=" + idleExecutorShutdownWaitMillis + ", stopDriverAfterMillis=" + stopDriverAfterMillis + ", globalTaskDefinitionDirectory=" + globalTaskDefinitionDirectory + ", globalTaskDefinitionSuffix=" + globalTaskDefinitionSuffix + ", hardKillAfterMillis=" + hardKillAfterMillis + ", killThreads=" + killThreads + ", threadCheckThreads=" + threadCheckThreads + ", checkThreadsEveryMillis=" + checkThreadsEveryMillis + ", maxTaskMessageLength=" + maxTaskMessageLength + ", logrotateCommand=" + logrotateCommand + ", logrotateStateFile=" + logrotateStateFile + ", logrotateConfDirectory=" + logrotateConfDirectory + ", logrotateToDirectory=" + logrotateToDirectory + ", logrotateMaxageDays=" + logrotateMaxageDays + ", logrotateCount=" + logrotateCount + ", logrotateDateformat=" + logrotateDateformat + ", logrotateExtrasDateformat=" + logrotateExtrasDateformat + ", logrotateAdditionalFiles=" + logrotateAdditionalFiles + ", s3UploaderAdditionalFiles=" + s3UploaderAdditionalFiles + ", tailLogLinesToSave=" + tailLogLinesToSave + ", serviceFinishedTailLog=" + serviceFinishedTailLog + ", s3UploaderKeyPattern=" + s3UploaderKeyPattern + ", s3UploaderBucket=" + s3UploaderBucket + ", useLocalDownloadService=" + useLocalDownloadService + ", localDownloadServiceTimeoutMillis=" + localDownloadServiceTimeoutMillis + ", maxTaskThreads=" + maxTaskThreads + ", dockerPrefix=" + dockerPrefix + ", dockerStopTimeout=" + dockerStopTimeout + ", shellCommands=" + shellCommands + ", shellCommandOutFile=" + shellCommandOutFile + ", pidCommandPlaceholder=" + pidCommandPlaceholder + "]"; ======= return "SingularityExecutorConfiguration[" + "executorJavaLog='" + executorJavaLog + '\'' + ", executorBashLog='" + executorBashLog + '\'' + ", serviceLog='" + serviceLog + '\'' + ", defaultRunAsUser='" + defaultRunAsUser + '\'' + ", taskAppDirectory='" + taskAppDirectory + '\'' + ", shutdownTimeoutWaitMillis=" + shutdownTimeoutWaitMillis + ", idleExecutorShutdownWaitMillis=" + idleExecutorShutdownWaitMillis + ", stopDriverAfterMillis=" + stopDriverAfterMillis + ", globalTaskDefinitionDirectory='" + globalTaskDefinitionDirectory + '\'' + ", globalTaskDefinitionSuffix='" + globalTaskDefinitionSuffix + '\'' + ", hardKillAfterMillis=" + hardKillAfterMillis + ", killThreads=" + killThreads + ", threadCheckThreads=" + threadCheckThreads + ", checkThreadsEveryMillis=" + checkThreadsEveryMillis + ", maxTaskMessageLength=" + maxTaskMessageLength + ", logrotateCommand='" + logrotateCommand + '\'' + ", logrotateStateFile='" + logrotateStateFile + '\'' + ", logrotateConfDirectory='" + logrotateConfDirectory + '\'' + ", logrotateToDirectory='" + logrotateToDirectory + '\'' + ", logrotateMaxageDays=" + logrotateMaxageDays + ", logrotateCount=" + logrotateCount + ", logrotateDateformat='" + logrotateDateformat + '\'' + ", logrotateExtrasDateformat='" + logrotateExtrasDateformat + '\'' + ", logrotateAdditionalFiles=" + logrotateAdditionalFiles + ", s3UploaderAdditionalFiles=" + s3UploaderAdditionalFiles + ", tailLogLinesToSave=" + tailLogLinesToSave + ", serviceFinishedTailLog='" + serviceFinishedTailLog + '\'' + ", s3UploaderKeyPattern='" + s3UploaderKeyPattern + '\'' + ", s3UploaderBucket='" + s3UploaderBucket + '\'' + ", useLocalDownloadService=" + useLocalDownloadService + ", localDownloadServiceTimeoutMillis=" + localDownloadServiceTimeoutMillis + ", maxTaskThreads=" + maxTaskThreads + ", dockerPrefix='" + dockerPrefix + '\'' + ", dockerStopTimeout=" + dockerStopTimeout + ", cgroupsMesosCpuTasksFormat='" + cgroupsMesosCpuTasksFormat + '\'' + ", procCgroupFormat='" + procCgroupFormat + '\'' + ", switchUserCommandFormat='" + switchUserCommandFormat + '\'' + ", artifactSignatureVerificationCommand=" + artifactSignatureVerificationCommand + ", failTaskOnInvalidArtifactSignature=" + failTaskOnInvalidArtifactSignature + ", signatureVerifyOut='" + signatureVerifyOut + '\'' + ']'; >>>>>>> return "SingularityExecutorConfiguration[" + "executorJavaLog='" + executorJavaLog + '\'' + ", executorBashLog='" + executorBashLog + '\'' + ", serviceLog='" + serviceLog + '\'' + ", defaultRunAsUser='" + defaultRunAsUser + '\'' + ", taskAppDirectory='" + taskAppDirectory + '\'' + ", shutdownTimeoutWaitMillis=" + shutdownTimeoutWaitMillis + ", idleExecutorShutdownWaitMillis=" + idleExecutorShutdownWaitMillis + ", stopDriverAfterMillis=" + stopDriverAfterMillis + ", globalTaskDefinitionDirectory='" + globalTaskDefinitionDirectory + '\'' + ", globalTaskDefinitionSuffix='" + globalTaskDefinitionSuffix + '\'' + ", hardKillAfterMillis=" + hardKillAfterMillis + ", killThreads=" + killThreads + ", threadCheckThreads=" + threadCheckThreads + ", checkThreadsEveryMillis=" + checkThreadsEveryMillis + ", maxTaskMessageLength=" + maxTaskMessageLength + ", logrotateCommand='" + logrotateCommand + '\'' + ", logrotateStateFile='" + logrotateStateFile + '\'' + ", logrotateConfDirectory='" + logrotateConfDirectory + '\'' + ", logrotateToDirectory='" + logrotateToDirectory + '\'' + ", logrotateMaxageDays=" + logrotateMaxageDays + ", logrotateCount=" + logrotateCount + ", logrotateDateformat='" + logrotateDateformat + '\'' + ", logrotateExtrasDateformat='" + logrotateExtrasDateformat + '\'' + ", logrotateAdditionalFiles=" + logrotateAdditionalFiles + ", s3UploaderAdditionalFiles=" + s3UploaderAdditionalFiles + ", tailLogLinesToSave=" + tailLogLinesToSave + ", serviceFinishedTailLog='" + serviceFinishedTailLog + '\'' + ", s3UploaderKeyPattern='" + s3UploaderKeyPattern + '\'' + ", s3UploaderBucket='" + s3UploaderBucket + '\'' + ", useLocalDownloadService=" + useLocalDownloadService + ", localDownloadServiceTimeoutMillis=" + localDownloadServiceTimeoutMillis + ", maxTaskThreads=" + maxTaskThreads + ", dockerPrefix='" + dockerPrefix + '\'' + ", dockerStopTimeout=" + dockerStopTimeout + ", cgroupsMesosCpuTasksFormat='" + cgroupsMesosCpuTasksFormat + '\'' + ", procCgroupFormat='" + procCgroupFormat + '\'' + ", switchUserCommandFormat='" + switchUserCommandFormat + '\'' + ", artifactSignatureVerificationCommand=" + artifactSignatureVerificationCommand + ", failTaskOnInvalidArtifactSignature=" + failTaskOnInvalidArtifactSignature + ", signatureVerifyOut='" + signatureVerifyOut + '\'' + ", shellCommands=" + shellCommands + ", shellCommandOutFile='" + shellCommandOutFile + '\'' + ", pidCommandPlaceholder='" + pidCommandPlaceholder + '\'' + ']';
<<<<<<< private long checkReconcileWhenRunningEveryMillis = TimeUnit.SECONDS.toMillis(30); @NotNull private long checkScheduledJobsEveryMillis = TimeUnit.MINUTES.toMillis(10); ======= private long checkReconcileWhenRunningEveryMillis = TimeUnit.SECONDS.toMillis(30); >>>>>>> private long checkReconcileWhenRunningEveryMillis = TimeUnit.SECONDS.toMillis(30); <<<<<<< @JsonProperty("s3") private S3Configuration s3Configuration; @NotNull private boolean sandboxDefaultsToTaskId = false; @NotNull private long saveStateEverySeconds = 60; @JsonProperty("sentry") private SentryConfiguration sentryConfiguration; @JsonProperty("smtp") private SMTPConfiguration smtpConfiguration; ======= @JsonProperty("s3") private S3Configuration s3Configuration; >>>>>>> @JsonProperty("s3") private S3Configuration s3Configuration; <<<<<<< private long warnIfScheduledJobIsRunningForAtLeastMillis = TimeUnit.DAYS.toMillis(1); ======= private long sandboxHttpTimeoutMillis = TimeUnit.SECONDS.toMillis(5); >>>>>>> private long warnIfScheduledJobIsRunningForAtLeastMillis = TimeUnit.DAYS.toMillis(1); <<<<<<< public long getCheckReconcileWhenRunningEveryMillis() { return checkReconcileWhenRunningEveryMillis; } public long getCheckScheduledJobsEveryMillis() { return checkScheduledJobsEveryMillis; } public long getCheckSchedulerEverySeconds() { return checkSchedulerEverySeconds; } ======= public long getCheckReconcileWhenRunningEveryMillis() { return checkReconcileWhenRunningEveryMillis; } public long getCheckSchedulerEverySeconds() { return checkSchedulerEverySeconds; } >>>>>>> public long getCheckReconcileWhenRunningEveryMillis() { return checkReconcileWhenRunningEveryMillis; } public long getCheckSchedulerEverySeconds() { return checkSchedulerEverySeconds; } <<<<<<< public void setCheckReconcileWhenRunningEveryMillis(long checkReconcileWhenRunningEveryMillis) { this.checkReconcileWhenRunningEveryMillis = checkReconcileWhenRunningEveryMillis; } public void setCheckScheduledJobsEveryMillis(long checkScheduledJobsEveryMillis) { this.checkScheduledJobsEveryMillis = checkScheduledJobsEveryMillis; } public void setCheckSchedulerEverySeconds(long checkSchedulerEverySeconds) { this.checkSchedulerEverySeconds = checkSchedulerEverySeconds; } ======= public void setCheckReconcileWhenRunningEveryMillis(long checkReconcileWhenRunningEveryMillis) { this.checkReconcileWhenRunningEveryMillis = checkReconcileWhenRunningEveryMillis; } public void setCheckSchedulerEverySeconds(long checkSchedulerEverySeconds) { this.checkSchedulerEverySeconds = checkSchedulerEverySeconds; } >>>>>>> public void setCheckReconcileWhenRunningEveryMillis(long checkReconcileWhenRunningEveryMillis) { this.checkReconcileWhenRunningEveryMillis = checkReconcileWhenRunningEveryMillis; } public void setCheckSchedulerEverySeconds(long checkSchedulerEverySeconds) { this.checkSchedulerEverySeconds = checkSchedulerEverySeconds; } <<<<<<< public void setStartNewReconcileEverySeconds(long startNewReconcileEverySeconds) { this.startNewReconcileEverySeconds = startNewReconcileEverySeconds; ======= public void setStartNewReconcileEverySeconds(long startNewReconcileEverySeconds) { this.startNewReconcileEverySeconds = startNewReconcileEverySeconds; } public void setUiConfiguration(UIConfiguration uiConfiguration) { this.uiConfiguration = uiConfiguration; } public void setZookeeperAsyncTimeout(long zookeeperAsyncTimeout) { this.zookeeperAsyncTimeout = zookeeperAsyncTimeout; >>>>>>> public void setStartNewReconcileEverySeconds(long startNewReconcileEverySeconds) { this.startNewReconcileEverySeconds = startNewReconcileEverySeconds; <<<<<<< public void setWarnIfScheduledJobIsRunningForAtLeastMillis(long warnIfScheduledJobIsRunningForAtLeastMillis) { this.warnIfScheduledJobIsRunningForAtLeastMillis = warnIfScheduledJobIsRunningForAtLeastMillis; } public void setWarnIfScheduledJobIsRunningPastNextRunPct(float warnIfScheduledJobIsRunningPastNextRunPct) { this.warnIfScheduledJobIsRunningPastNextRunPct = warnIfScheduledJobIsRunningPastNextRunPct; } public void setZookeeperAsyncTimeout(long zookeeperAsyncTimeout) { this.zookeeperAsyncTimeout = zookeeperAsyncTimeout; } public void setZooKeeperConfiguration(ZooKeeperConfiguration zooKeeperConfiguration) { this.zooKeeperConfiguration = zooKeeperConfiguration; } ======= >>>>>>> public void setWarnIfScheduledJobIsRunningForAtLeastMillis(long warnIfScheduledJobIsRunningForAtLeastMillis) { this.warnIfScheduledJobIsRunningForAtLeastMillis = warnIfScheduledJobIsRunningForAtLeastMillis; } public void setWarnIfScheduledJobIsRunningPastNextRunPct(float warnIfScheduledJobIsRunningPastNextRunPct) { this.warnIfScheduledJobIsRunningPastNextRunPct = warnIfScheduledJobIsRunningPastNextRunPct; } public void setZookeeperAsyncTimeout(long zookeeperAsyncTimeout) { this.zookeeperAsyncTimeout = zookeeperAsyncTimeout; } public void setZooKeeperConfiguration(ZooKeeperConfiguration zooKeeperConfiguration) { this.zooKeeperConfiguration = zooKeeperConfiguration; }
<<<<<<< this.daemon = Optional.absent(); ======= this.scheduledExpectedRuntimeMillis = Optional.absent(); >>>>>>> this.scheduledExpectedRuntimeMillis = Optional.absent(); this.daemon = Optional.absent(); <<<<<<< return new SingularityRequest(id, requestType, owners, numRetriesOnFailure, schedule, daemon, instances, rackSensitive, loadBalanced, killOldNonLongRunningTasksAfterMillis, scheduleType, quartzSchedule, rackAffinity, slavePlacement); ======= return new SingularityRequest(id, owners, numRetriesOnFailure, schedule, daemon, instances, rackSensitive, loadBalanced, killOldNonLongRunningTasksAfterMillis, scheduleType, quartzSchedule, rackAffinity, slavePlacement, scheduledExpectedRuntimeMillis); >>>>>>> return new SingularityRequest(id, requestType, owners, numRetriesOnFailure, schedule, daemon, instances, rackSensitive, loadBalanced, killOldNonLongRunningTasksAfterMillis, scheduleType, quartzSchedule, rackAffinity, slavePlacement, scheduledExpectedRuntimeMillis); <<<<<<< public RequestType getRequestType() { return requestType; } ======= public Optional<Long> getScheduledExpectedRuntimeMillis() { return scheduledExpectedRuntimeMillis; } public SingularityRequestBuilder setScheduledExpectedRuntimeMillis(Optional<Long> scheduledExpectedRuntimeMillis) { this.scheduledExpectedRuntimeMillis = scheduledExpectedRuntimeMillis; return this; } >>>>>>> public Optional<Long> getScheduledExpectedRuntimeMillis() { return scheduledExpectedRuntimeMillis; } public SingularityRequestBuilder setScheduledExpectedRuntimeMillis(Optional<Long> scheduledExpectedRuntimeMillis) { this.scheduledExpectedRuntimeMillis = scheduledExpectedRuntimeMillis; return this; } public RequestType getRequestType() { return requestType; } <<<<<<< return "SingularityRequestBuilder [id=" + id + ", requestType=" + requestType + ", owners=" + owners + ", numRetriesOnFailure=" + numRetriesOnFailure + ", schedule=" + schedule + ", quartzSchedule=" + quartzSchedule + ", scheduleType=" + scheduleType + ", killOldNonLongRunningTasksAfterMillis=" + killOldNonLongRunningTasksAfterMillis + ", daemon=" + daemon + ", instances=" + instances + ", rackSensitive=" + rackSensitive + ", rackAffinity=" + rackAffinity + ", slavePlacement=" + slavePlacement + ", loadBalanced=" + loadBalanced + "]"; ======= return "SingularityRequestBuilder [id=" + id + ", owners=" + owners + ", numRetriesOnFailure=" + numRetriesOnFailure + ", schedule=" + schedule + ", quartzSchedule=" + quartzSchedule + ", scheduleType=" + scheduleType + ", killOldNonLongRunningTasksAfterMillis=" + killOldNonLongRunningTasksAfterMillis + ", scheduledExpectedRuntimeMillis=" + scheduledExpectedRuntimeMillis + ", daemon=" + daemon + ", instances=" + instances + ", rackSensitive=" + rackSensitive + ", rackAffinity=" + rackAffinity + ", slavePlacement=" + slavePlacement + ", loadBalanced=" + loadBalanced + "]"; >>>>>>> return "SingularityRequestBuilder [id=" + id + ", requestType=" + requestType + ", owners=" + owners + ", numRetriesOnFailure=" + numRetriesOnFailure + ", schedule=" + schedule + ", quartzSchedule=" + quartzSchedule + ", scheduleType=" + scheduleType + ", killOldNonLongRunningTasksAfterMillis=" + killOldNonLongRunningTasksAfterMillis + ", scheduledExpectedRuntimeMillis=" + scheduledExpectedRuntimeMillis + ", daemon=" + daemon + ", instances=" + instances + ", rackSensitive=" + rackSensitive + ", rackAffinity=" + rackAffinity + ", slavePlacement=" + slavePlacement + ", loadBalanced=" + loadBalanced + "]";
<<<<<<< ======= import com.hubspot.singularity.SingularityS3Log; import com.hubspot.singularity.s3uploader.config.SingularityS3UploaderContentHeaders; >>>>>>> import com.hubspot.singularity.SingularityS3Log; <<<<<<< if (shouldApplyStorageClass(fileSizeBytes)) { LOG.debug("{} adding storage class {} to {}", logIdentifier, uploadMetadata.getS3StorageClass().get(), file); object.addMetadata("x-amz-storage-class", uploadMetadata.getS3StorageClass().get()); } ======= LOG.debug("Uploading object with metadata {}", object.getMetadataMap()); >>>>>>> if (shouldApplyStorageClass(fileSizeBytes)) { LOG.debug("{} adding storage class {} to {}", logIdentifier, uploadMetadata.getS3StorageClass().get(), file); object.addMetadata("x-amz-storage-class", uploadMetadata.getS3StorageClass().get()); } LOG.debug("Uploading object with metadata {}", object.getMetadataMap());