List of usage examples for java.util.concurrent TimeUnit NANOSECONDS
TimeUnit NANOSECONDS
To view the source code for java.util.concurrent TimeUnit NANOSECONDS.
Click Source Link
From source file:com.vmware.identity.idm.server.provider.ldap.LdapWithAdMappingsProvider.java
protected String getPrimaryGroupDNAndGroupObject(ILdapConnectionEx connection, byte[] userObjectSID, int groupRID, Set<Group> groups, IIdmAuthStatRecorder authStatRecorder) throws NoSuchGroupException { String groupDn = null;// w w w .ja v a2 s .com String searchBaseDn = (this.useGroupBaseDnForNestedGroups()) ? this.getStoreDataEx().getGroupBaseDn() : ServerUtils.getDomainDN(this.getDomain()); SecurityIdentifier sid = SecurityIdentifier.build(userObjectSID); sid.setRID(groupRID); String groupSidString = sid.toString(); final String ATTR_NAME_GROUP_CN = _ldapSchemaMapping .getGroupAttribute(IdentityStoreAttributeMapping.AttributeIds.GroupAttributeAccountName); String[] attrNames = new String[] { ATTR_NAME_GROUP_CN }; String filter = String.format(_ldapSchemaMapping.getGroupQueryByObjectUniqueId(), LdapFilterString.encode(groupSidString)); long startTime = System.nanoTime(); ILdapMessage message = connection.search(searchBaseDn, LdapScope.SCOPE_SUBTREE, filter, attrNames, false); if (authStatRecorder != null) { long elapsed = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startTime); authStatRecorder .add(new LdapQueryStat(filter, searchBaseDn, getConnectionString(connection), elapsed, 1)); } try { ILdapEntry[] entries = message.getEntries(); if ((entries != null && entries.length > 0)) { if (entries.length != 1) { throw new IllegalStateException("Entry length > 1"); } ILdapEntry entry = entries[0]; String groupName = ServerUtils.getStringValue(entry.getAttributeValues(ATTR_NAME_GROUP_CN)); String groupDomainName = ServerUtils.getDomainFromDN(entry.getDN()); PrincipalId groupId = new PrincipalId(groupName, groupDomainName); Group g = new Group(groupId, null/*alias*/, groupSidString, null/*detail*/ ); groups.add(g); groupDn = entry.getDN(); } else // we did not find the entry { if (!(this.useGroupBaseDnForNestedGroups())) { logger.error(String.format("Unable to find primary group with SID=[%s]", groupSidString)); } } } finally { message.close(); } return groupDn; }
From source file:com.dilmus.dilshad.scabi.core.async.DComputeAsync.java
public boolean finish(long checkTillNanoSec) throws Exception { if (false == m_isPerformInProgress) return true; long time1 = System.nanoTime(); log.debug("finish(nanosec) m_splitTotal : {}", m_splitTotal); log.debug("finish(nanosec) m_crunList.size() : {}", m_crunList.size()); log.debug("finish(nanosec) m_crunListReady : {}", m_crunListReady); log.debug("finish() m_futureListReady : {}", m_futureListReady); try {//from www .jav a 2 s . c om m_futureCompute.get(checkTillNanoSec, TimeUnit.NANOSECONDS); m_futureRetry.get(checkTillNanoSec, TimeUnit.NANOSECONDS); } catch (CancellationException | InterruptedException | ExecutionException e) { //e.printStackTrace(); closeCNBConnections(); throw e; } log.debug("finish() m_futureList.size() : {}", m_futureList.size()); int gap = 0; while (false == m_futureListReady) { // TODO log.debug from this point onwards doesn't work if we don't use log.debug here!!! if (0 == gap % 1000000000) // reduce this number if needed to make it print atleast once log.debug("finish() m_futureListReady : {}", m_futureListReady); gap++; // this is just for the log.debug issue mentioned above if (System.nanoTime() - time1 >= checkTillNanoSec) return false; } log.debug("finish() m_futureList.size() : {}", m_futureList.size()); for (Future<?> f : m_futureList) { String result = null; try { f.get(checkTillNanoSec, TimeUnit.NANOSECONDS); } catch (CancellationException | InterruptedException | ExecutionException e) { //e.printStackTrace(); result = DMJson.error(DMUtil.clientErrMsg(e)); DRangeRunner rr = getFutureRRunMap(f); for (int j = rr.getStartCRun(); j <= rr.getEndCRun(); j++) { DComputeAsyncRun crun = m_crunList.get(j); DComputeAsyncConfig config = crun.getConfig(); synchronized (config) { if (false == config.isResultSet(crun.getSU())) { crun.setExecutionError(result); } } } // End for } // End catch } // End for closeCNBConnections(); log.debug("finfinish(nanosec) Exiting finish()"); initialize(); return true; }
From source file:com.medallia.spider.SpiderServlet.java
/** @return the PostAction returned from {@link StRenderer#actionAndRender(ObjectProvider, Map)} on the given task */ private PostAction render(ITask t, Map<String, String[]> reqParams, RequestHandler request, final List<EmbeddedContent> embeddedContent, final String relativeTemplatePath) { StRenderer renderer = new StRenderer(stringTemplateFactory, t) { @Override//from w ww.j a va 2 s .c om protected Pattern getClassNamePrefixPattern() { return CLASS_NAME_PREFIX_PATTERN; } @Override protected String getPageRelativePath() { return relativeTemplatePath; } @Override protected String renderFinal(StringTemplate st) { if (embeddedContent != null) addEmbedded(embeddedContent, st); return super.renderFinal(st); } }; registerInputArgParser(renderer); ObjectProvider injector = makeObjectProvider(request); long nt = System.nanoTime(); PostAction po = renderer.actionAndRender(injector, makeLifecycleHandlerSet(request), reqParams); log.info("StRender of " + t.getClass().getSimpleName() + " in " + TimeUnit.MILLISECONDS.convert(System.nanoTime() - nt, TimeUnit.NANOSECONDS) + " ms"); return po; }
From source file:org.apache.hadoop.hbase.client.RawAsyncHBaseAdmin.java
RawAsyncHBaseAdmin(AsyncConnectionImpl connection, HashedWheelTimer retryTimer, AsyncAdminBuilderBase builder) { this.connection = connection; this.retryTimer = retryTimer; this.metaTable = connection.getTable(META_TABLE_NAME); this.rpcTimeoutNs = builder.rpcTimeoutNs; this.operationTimeoutNs = builder.operationTimeoutNs; this.pauseNs = builder.pauseNs; if (builder.pauseForCQTBENs < builder.pauseNs) { LOG.warn(/*from ww w .j a v a 2 s .com*/ "Configured value of pauseForCQTBENs is {} ms, which is less than" + " the normal pause value {} ms, use the greater one instead", TimeUnit.NANOSECONDS.toMillis(builder.pauseForCQTBENs), TimeUnit.NANOSECONDS.toMillis(builder.pauseNs)); this.pauseForCQTBENs = builder.pauseNs; } else { this.pauseForCQTBENs = builder.pauseForCQTBENs; } this.maxAttempts = builder.maxAttempts; this.startLogErrorsCnt = builder.startLogErrorsCnt; this.ng = connection.getNonceGenerator(); }
From source file:MSUmpire.DIA.DIAPack.java
public void TargetedExtractionQuant(boolean export, FragmentLibManager libManager, float ReSearchProb, float RTWindow) throws IOException, SQLException, XmlPullParserException { if (IDsummary.GetMappedPepIonList().isEmpty()) { Logger.getRootLogger().error("There is no peptide ion for targeted re-extraction."); return;//from w w w. j av a2 s . com } parameter.RT_window_Targeted = RTWindow; GenerateClusterScanNomapping(); ExecutorService executorPool = null; //Targeted re-extraction scoring TScoring = new TargetMatchScoring(Filename, libManager.LibID); if (parameter.UseOldVersion) { TScoring.SetUseOldVersion(); } Logger.getRootLogger().info("No. of identified peptide ions: " + IDsummary.GetPepIonList().size()); Logger.getRootLogger().info("No. of mapped peptide ions: " + IDsummary.GetMappedPepIonList().size()); ArrayList<PepIonID> SearchList = new ArrayList<>(); //For each peptide ions in targeted re-extraction, determine whether to research the peptide ion given a re-search probability threshold for (PepIonID pepIonID : IDsummary.GetMappedPepIonList().values()) { if (libManager.PeptideFragmentLib.containsKey(pepIonID.GetKey()) && libManager.GetFragmentLib(pepIonID.GetKey()).FragmentGroups.size() >= 3 && pepIonID.TargetedProbability() < ReSearchProb) { pepIonID.CreateQuantInstance(parameter.MaxNoPeakCluster); pepIonID.MS1PeakClusters = new ArrayList<>(); pepIonID.MS2UnfragPeakClusters = new ArrayList<>(); pepIonID.UScoreProbability_MS1 = 0f; pepIonID.MS1AlignmentProbability = 0f; pepIonID.UScoreProbability_MS2 = 0f; pepIonID.MS2AlignmentProbability = 0f; pepIonID.TPPModSeq = "Ext"; SearchList.add(pepIonID); } } Logger.getRootLogger().info("No. of searchable peptide ions: " + SearchList.size()); for (LCMSPeakDIAMS2 DIAWindow : DIAWindows) { Logger.getRootLogger().info("Assigning clusters for peak groups in MS2 isolation window:" + FilenameUtils.getBaseName(DIAWindow.ScanCollectionName)); if (!DIAWindow.ReadPeakCluster() || !DIAWindow.ReadPrecursorFragmentClu2Cur()) { Logger.getRootLogger().warn("Reading results for " + DIAWindow.ScanCollectionName + " failed"); continue; } executorPool = Executors.newFixedThreadPool(NoCPUs); //For each target peptide ion for (PepIonID pepIonID : SearchList) { if (DIAWindow.DIA_MZ_Range.getX() <= pepIonID.NeutralPrecursorMz() && DIAWindow.DIA_MZ_Range.getY() >= pepIonID.NeutralPrecursorMz()) { //If the spectrum of peptide ion in the spectral library has more than three fragment peaks if (libManager.GetFragmentLib(pepIonID.GetKey()).FragmentGroups.size() >= 3) { //U-score spectral matching UmpireSpecLibMatch matchunit = new UmpireSpecLibMatch(MS1FeatureMap, DIAWindow, pepIonID, libManager.GetFragmentLib(pepIonID.GetKey()), libManager.GetDecoyFragmentLib(pepIonID.GetKey()), parameter); executorPool.execute(matchunit); TScoring.libTargetMatches.add(matchunit); } else { Logger.getRootLogger() .warn("skipping " + pepIonID.GetKey() + ", it has only " + libManager.GetFragmentLib(pepIonID.GetKey()).FragmentGroups.size() + " matched fragments"); } } } //For each identified peptide ion, calculate their U-score for LDA training for (PepIonID pepIonID : IDsummary.GetPepIonList().values()) { if (libManager.PeptideFragmentLib.containsKey(pepIonID.GetKey()) && DIAWindow.DIA_MZ_Range.getX() <= pepIonID.NeutralPrecursorMz() && DIAWindow.DIA_MZ_Range.getY() >= pepIonID.NeutralPrecursorMz()) { //If the spectrum of peptide ion in the spectral library has more than three fragment peaks if (libManager.GetFragmentLib(pepIonID.GetKey()).FragmentGroups.size() >= 3) { //U-score spectral matching UmpireSpecLibMatch matchunit = new UmpireSpecLibMatch(MS1FeatureMap, DIAWindow, pepIonID, libManager.GetFragmentLib(pepIonID.GetKey()), libManager.GetDecoyFragmentLib(pepIonID.GetKey()), parameter); matchunit.IdentifiedPeptideIon = true; executorPool.execute(matchunit); TScoring.libIDMatches.add(matchunit); } else { Logger.getRootLogger() .warn("skipping " + pepIonID.GetKey() + ", it has only " + libManager.GetFragmentLib(pepIonID.GetKey()).FragmentGroups.size() + " matched fragments"); } } } executorPool.shutdown(); try { executorPool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { Logger.getRootLogger().info("interrupted.."); } DIAWindow.ClearAllPeaks(); } Logger.getRootLogger().info("Removing entries with no precursor signal hits: total target entries: " + TScoring.libTargetMatches.size()); ArrayList<UmpireSpecLibMatch> newlist = new ArrayList<>(); for (UmpireSpecLibMatch match : TScoring.libTargetMatches) { if (!match.DecoyHits.isEmpty() || !match.TargetHits.isEmpty()) { newlist.add(match); } } TScoring.libTargetMatches = newlist; Logger.getRootLogger().info("Remaining entries: " + TScoring.libTargetMatches.size()); //U-score and probablilty calculatation TScoring.Process(); TargetHitPepXMLWriter pepxml = new TargetHitPepXMLWriter(GetiProphExtPepxml(libManager.LibID), IDsummary.FastaPath, IDsummary.DecoyTag, TScoring); TScoring = null; executorPool = Executors.newFixedThreadPool(NoCPUs); //Assign precursor peak cluster, extract fragments and do quantification for (PepIonID pepIonID : IDsummary.GetMappedPepIonList().values()) { DIAAssignQuantUnit quantunit = new DIAAssignQuantUnit(pepIonID, MS1FeatureMap, parameter); executorPool.execute(quantunit); } for (PepIonID pepIonID : IDsummary.GetPepIonList().values()) { DIAAssignQuantUnit quantunit = new DIAAssignQuantUnit(pepIonID, MS1FeatureMap, parameter); executorPool.execute(quantunit); } executorPool.shutdown(); try { executorPool.awaitTermination(Long.MAX_VALUE, TimeUnit.NANOSECONDS); } catch (InterruptedException e) { Logger.getRootLogger().info("interrupted.."); } if (export) { ExportID(); } }
From source file:org.apache.hadoop.ha.ZKFailoverController.java
/** * Check the current state of the service, and join the election * if it should be in the election.// w w w . j ava2s . c om */ private void recheckElectability() { // Maintain lock ordering of elector -> ZKFC synchronized (elector) { synchronized (this) { boolean healthy = lastHealthState == State.SERVICE_HEALTHY; long remainingDelay = delayJoiningUntilNanotime - System.nanoTime(); if (remainingDelay > 0) { if (healthy) { LOG.info("Would have joined master election, but this node is " + "prohibited from doing so for " + TimeUnit.NANOSECONDS.toMillis(remainingDelay) + " more ms"); } scheduleRecheck(remainingDelay); return; } switch (lastHealthState) { case SERVICE_HEALTHY: elector.joinElection(targetToData(localTarget)); if (quitElectionOnBadState) { quitElectionOnBadState = false; } break; case INITIALIZING: LOG.info("Ensuring that " + localTarget + " does not " + "participate in active master election"); elector.quitElection(false); serviceState = HAServiceState.INITIALIZING; break; case SERVICE_UNHEALTHY: case SERVICE_NOT_RESPONDING: LOG.info("Quitting master election for " + localTarget + " and marking that fencing is necessary"); elector.quitElection(true); serviceState = HAServiceState.INITIALIZING; break; case HEALTH_MONITOR_FAILED: fatalError("Health monitor failed!"); break; default: throw new IllegalArgumentException("Unhandled state:" + lastHealthState); } } } }
From source file:org.apache.hadoop.hbase.client.RawAsyncHBaseAdmin.java
private <T> MasterRequestCallerBuilder<T> newMasterCaller() { return this.connection.callerFactory.<T>masterRequest().rpcTimeout(rpcTimeoutNs, TimeUnit.NANOSECONDS) .operationTimeout(operationTimeoutNs, TimeUnit.NANOSECONDS).pause(pauseNs, TimeUnit.NANOSECONDS) .pauseForCQTBE(pauseForCQTBENs, TimeUnit.NANOSECONDS).maxAttempts(maxAttempts) .startLogErrorsCnt(startLogErrorsCnt); }
From source file:org.apache.hadoop.hbase.client.RawAsyncHBaseAdmin.java
private <T> AdminRequestCallerBuilder<T> newAdminCaller() { return this.connection.callerFactory.<T>adminRequest().rpcTimeout(rpcTimeoutNs, TimeUnit.NANOSECONDS) .operationTimeout(operationTimeoutNs, TimeUnit.NANOSECONDS).pause(pauseNs, TimeUnit.NANOSECONDS) .pauseForCQTBE(pauseForCQTBENs, TimeUnit.NANOSECONDS).maxAttempts(maxAttempts) .startLogErrorsCnt(startLogErrorsCnt); }
From source file:com.xunlei.shortvideo.activity.VideoPublishLocal3Activity.java
private void initQupaiEditor() { //?????/*www . ja va 2 s .c o m*/ mSessionClient = new VideoSessionClientFactoryImpl().createSessionClient(this, null); WorkspaceClient workspace = mSessionClient.createWorkspace(this); mProjectConnection = new ProjectConnection(workspace); mActionParser = new EditorAction(mActionExecutor); mDataProvider = mSessionClient.getAssetRepository(); mVideoSessionCreateInfo = mSessionClient.getCreateInfo(); //?? SceneFactoryClient sceneFactoryClient = new SceneFactoryClientImpl(this, mDataProvider, mSessionClient.getJSONSupport()); //?? SoundProjectFactoryClient soundFactoryClient = new SoundProjectFactoryClient(mDataProvider); mStageHost = new StageHost.Builder().addBitmapResolver(new BitmapLoader(this)) // .addBitmapResolver(new BitmapGenerator(sceneFactoryClient)) .get(); // //intent?project,??savejson,?jsonproject String projectFilePath = mProjectUri.getPath(); File projectFile = new File(projectFilePath); //?project.json???project mProject = ProjectUtil.readProject(projectFile, mSessionClient.getJSONSupport()); if (mProject != null) { mProject.setProjectDir(projectFile.getParentFile(), projectFile); mProjectConnection.setProject(mProject); } //??.?1:1????. // if(mProject.getRotation() == 90 || mProject.getRotation() == 270){ // mProject.setCanvasSize(mSessionClient.getProjectOptions().videoHeight, mSessionClient.getProjectOptions().videoWidth); // }else { // mProject.setCanvasSize(mSessionClient.getProjectOptions().videoWidth, mSessionClient.getProjectOptions().videoHeight); // } mClient = new ProjectClient(mProjectConnection, mDataProvider, sceneFactoryClient, soundFactoryClient, mSessionClient.getJSONSupport()); mClient.setDurationLimit(mProject.getDurationNano()); mClient.setVideoFramerate(mSessionClient.getProjectOptions().videoFrameRate); mClientDelegate = new ProjectClientDelegate(mClient); mRepoClient = new AssetRepositoryClient(mDataProvider); // mPlayer = new ProjectPlayerControl(mStageHost); mPlayer.setOnProgressCallback(this); // setContentView(R.layout.activity_editor); mClient.setOnChangeListener(mClientDelegate); //? mRenderConf = new RenderConfImpl(mProject, sceneFactoryClient, soundFactoryClient, mSessionClient.getJSONSupport()); // mRenderConf.setVideoFrameRate(mSessionClient.getProjectOptions().videoFrameRate); // mRenderConf.setDurationLimit(TimeUnit.NANOSECONDS.toMillis(mProject.getDurationNano())); mEditorSession = new EditorSession(this, mPlayer, mDataProvider, mRenderConf, mSessionClient.getPageNavigator(), mClient); mStage = new Stage(mStageHost); mStage.realize(); mDisplaySurface = (SurfaceView) findViewById(R.id.surface_view); //? int screenWidth = getResources().getDisplayMetrics().widthPixels; int screenHeight = getResources().getDisplayMetrics().heightPixels; FrameLayout.LayoutParams lp = (FrameLayout.LayoutParams) mDisplaySurface.getLayoutParams(); VideoScaleHelper helper = new VideoScaleHelper(); helper.setVideoWidthAndHeight(mClient.getVideoWidth(), mClient.getVideoHeight()) .setScreenWidthAndHeight(screenWidth, screenHeight).generateDisplayLayoutParams(lp); SurfaceHolder holder = mDisplaySurface.getHolder(); mPlayer.getImpl().setSurface(holder); // AspectRatioLayout video_frame = (AspectRatioLayout) findViewById(R.id.video); // video_frame.setOriginalSize(480, 480); // ViewStack view_stack = new ViewStack(View.INVISIBLE); // view_stack.addView(findViewById(R.id.effect_list_filter)); // RecyclerView filter_list_view = (RecyclerView) findViewById(R.id.effect_list_filter); mMVlist = (RecyclerView) findViewById(R.id.effect_list_mv); // mFilterChooserMediator = new QupaiFilterChooseMediator(mClient, mDataProvider); mClientDelegate.addOnChangeListener(mFilterChooserMediator); mMVChooserMediator = new MVChooserMediator2(mMVlist, mEditorSession, mClientDelegate, mRepoClient); mMVChooserMediator.setMVItemClickListener(new MVChooserMediator2.OnMVItemClickListener() { @Override public void onItemClick(RecyclerView.Adapter adapter, View view, int position) { //reset filter mFilterIndex = 0; mFilterChooserMediator.setChecked(mFilterIndex); mConfig.setUseFilter(false); mConfig.setUseMV(position != 0); } }); // ?MV new LoadDownloadMVTask().execute(); //?,? mEditorSession.setPart(UIEditorPage.FILTER_EFFECT, mFilterChooserMediator); mEditorSession.setPart(UIEditorPage.MV, mMVChooserMediator); mEditorSession.updatePlayer(Integer.MAX_VALUE); mPlayer.start(); mRenderTaskManager = new RenderTaskManager(getApplicationContext()); mRenderTaskManager.setOnRenderTaskListener(this); mFilterIndex = 0; final int total = mFilterChooserMediator.getCount(); final GestureDetector detector = new GestureDetector(new GestureDetector.OnGestureListener() { @Override public boolean onDown(MotionEvent e) { mFilterChanged = false; return false; } @Override public void onShowPress(MotionEvent e) { } @Override public boolean onSingleTapUp(MotionEvent e) { hideMV(); mFilterChanged = false; return true; } @Override public boolean onScroll(MotionEvent e1, MotionEvent e2, float distanceX, float distanceY) { float x = Math.abs(distanceX); if (x >= FILTER_TRIGGER_DISTANCE && !isMVMode()) { float y = Math.abs(distanceY); if ((y / x) < FILTER_TRIGGER_BIAS && !mFilterChanged) { //0.577 is 30 degree if (distanceX < 0) { statistic_click_filter(); mFilterChanged = true; mFilterIndex++; if (mFilterIndex >= total) { mFilterIndex = 0; } // Log.d(TAG, "event.getx is " + event.getX() + " DownX is " + mDownX + " mFilterChanged is " + mFilterChanged); mMVChooserMediator.resetPosition(0); mEditorSession.setActiveEditorPage(UIEditorPage.FILTER_EFFECT); mFilterChooserMediator.setChecked(mFilterIndex); mFilterNameTv.setText(mFilterChooserMediator.getItemTitle(mFilterIndex)); mFilterNameTv.setAlpha(1); mFilterNameTv.animate().alpha(0).setDuration(2000).start(); } else { statistic_click_filter(); mFilterChanged = true; mFilterIndex--; if (mFilterIndex < 0) { mFilterIndex = total - 1; } // Log.d(TAG, "event.getx is " + event.getX() + " DownX is " + mDownX + " mFilterChanged is " + mFilterChanged); mMVChooserMediator.resetPosition(0); mEditorSession.setActiveEditorPage(UIEditorPage.FILTER_EFFECT); mFilterChooserMediator.setChecked(mFilterIndex); mFilterNameTv.setText(mFilterChooserMediator.getItemTitle(mFilterIndex)); mFilterNameTv.setAlpha(1); mFilterNameTv.animate().alpha(0).setDuration(2000).start(); } mConfig.setUseFilter(mFilterIndex != 0); mConfig.setUseMV(false); return true; } } return false; } @Override public void onLongPress(MotionEvent e) { } @Override public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX, float velocityY) { return false; } }); mFilterOpLayer.setOnTouchListener(new View.OnTouchListener() { @Override public boolean onTouch(View v, MotionEvent event) { detector.onTouchEvent(event); return true; } }); // mFilterOpLayer.setOnTouchListener(new View.OnTouchListener() { // // @Override // public boolean onTouch(View v, MotionEvent event) { // switch (event.getAction()) { // case MotionEvent.ACTION_DOWN: // hideMV(); // mDownX = event.getX(); // mFilterChanged = false; //// Log.d(TAG, "DownX is " + mDownX + " mFilterChanged is " + mFilterChanged); // return true; // case MotionEvent.ACTION_MOVE: // if((event.getX() - mDownX > 50) && !mFilterChanged) { // statistic_click_filter(); // mFilterChanged = true; // mFilterIndex ++; // if(mFilterIndex >= total) { // mFilterIndex = 0; // } //// Log.d(TAG, "event.getx is " + event.getX() + " DownX is " + mDownX + " mFilterChanged is " + mFilterChanged); // mEditorSession.setActiveEditorPage(UIEditorPage.FILTER_EFFECT); // mFilterChooserMediator.resetPosition(mFilterIndex); // mFilterNameTv.setText(mFilterChooserMediator.getItemTitle(mFilterIndex)); // mFilterNameTv.setAlpha(1); // mFilterNameTv.animate().alpha(0).setDuration(2000).start(); // //select next // return true; // } else if((mDownX - event.getX() > 50) && !mFilterChanged) { // //select pre // statistic_click_filter(); // mFilterChanged = true; // mFilterIndex --; // if(mFilterIndex < 0) { // mFilterIndex = total -1; // } //// Log.d(TAG, "event.getx is " + event.getX() + " DownX is " + mDownX + " mFilterChanged is " + mFilterChanged); // mEditorSession.setActiveEditorPage(UIEditorPage.FILTER_EFFECT); // mFilterChooserMediator.resetPosition(mFilterIndex); // mFilterNameTv.setText(mFilterChooserMediator.getItemTitle(mFilterIndex)); // mFilterNameTv.setAlpha(1); // mFilterNameTv.animate().alpha(0).setDuration(2000).start(); // return true; // } // break; // case MotionEvent.ACTION_UP: // mFilterChanged = false; // return false; // } // return false; // } // }); mBtnChooseMv.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if (mMvChooseContainer.getVisibility() != View.VISIBLE) { mBottomOpBar.setVisibility(View.GONE); mMvChooseContainer.setVisibility(View.VISIBLE); statistic_click_mv(); } else { mBottomOpBar.setVisibility(View.VISIBLE); mMvChooseContainer.setVisibility(View.GONE); } } }); mMvChooseContainer.setVisibility(View.GONE); initDir(); }
From source file:org.apache.hadoop.hive.llap.tezplugins.LlapTaskCommunicator.java
public void registerKnownNode(LlapNodeId nodeId) { Long old = knownNodeMap.putIfAbsent(nodeId, TimeUnit.MILLISECONDS.convert(System.nanoTime(), TimeUnit.NANOSECONDS)); if (old == null) { if (LOG.isInfoEnabled()) { LOG.info("Added new known node: {}", nodeId); }/*from w ww . j a va2s. c o m*/ } }