<commit_before>package com.ctrip.hermes.core.meta.internal;

import java.util.concurrent.atomic.AtomicLong;

import org.unidal.lookup.annotation.Named;

import com.ctrip.hermes.core.bo.Tpg;
import com.ctrip.hermes.core.lease.DefaultLease;
import com.ctrip.hermes.core.lease.Lease;
import com.ctrip.hermes.core.lease.LeaseAcquireResponse;
import com.ctrip.hermes.core.meta.MetaProxy;

@Named(type = MetaProxy.class, value = LocalMetaProxy.ID)
public class LocalMetaProxy implements MetaProxy {

	public final static String ID = "local";

	private AtomicLong m_leaseId = new AtomicLong(0);

	@Override
	public LeaseAcquireResponse tryAcquireConsumerLease(Tpg tpg, String sessionId) {
		// TODO
		long expireTime = System.currentTimeMillis() + 10 * 1000L;
		long leaseId = m_leaseId.incrementAndGet();
		return new LeaseAcquireResponse(true, new DefaultLease(leaseId, expireTime), expireTime);
	}

	@Override
	public LeaseAcquireResponse tryRenewConsumerLease(Tpg tpg, Lease lease, String sessionId) {
		// TODO
		return new LeaseAcquireResponse(false, null, System.currentTimeMillis() + 10 * 1000L);
	}

	@Override
	public LeaseAcquireResponse tryRenewBrokerLease(String topic, int partition, Lease lease, String sessionId) {
		// TODO
		long expireTime = System.currentTimeMillis() + 10 * 1000L;
		long leaseId = m_leaseId.incrementAndGet();
		return new LeaseAcquireResponse(true, new DefaultLease(leaseId, expireTime), expireTime);
	}

	@Override
	public LeaseAcquireResponse tryAcquireBrokerLease(String topic, int partition, String sessionId) {
		// TODO
		return new LeaseAcquireResponse(false, null, System.currentTimeMillis() + 10 * 1000L);
	}
<commit_msg>refine local meta proxy impl<commit_after>package com.ctrip.hermes.core.meta.internal;

import java.util.concurrent.atomic.AtomicLong;

import org.unidal.lookup.annotation.Named;

import com.ctrip.hermes.core.bo.Tpg;
import com.ctrip.hermes.core.lease.DefaultLease;
import com.ctrip.hermes.core.lease.Lease;
import com.ctrip.hermes.core.lease.LeaseAcquireResponse;
import com.ctrip.hermes.core.meta.MetaProxy;

@Named(type = MetaProxy.class, value = LocalMetaProxy.ID)
public class LocalMetaProxy implements MetaProxy {

	public final static String ID = "local";

	private AtomicLong m_leaseId = new AtomicLong(0);

	@Override
	public LeaseAcquireResponse tryAcquireConsumerLease(Tpg tpg, String sessionId) {
		// TODO
		long expireTime = System.currentTimeMillis() + 10 * 1000L;
		long leaseId = m_leaseId.incrementAndGet();
		return new LeaseAcquireResponse(true, new DefaultLease(leaseId, expireTime), expireTime);
	}

	@Override
	public LeaseAcquireResponse tryRenewConsumerLease(Tpg tpg, Lease lease, String sessionId) {
		// TODO
		return new LeaseAcquireResponse(false, null, System.currentTimeMillis() + 10 * 1000L);
	}

	@Override
	public LeaseAcquireResponse tryRenewBrokerLease(String topic, int partition, Lease lease, String sessionId) {
		// TODO
		long expireTime = System.currentTimeMillis() + 10 * 1000L;
		long leaseId = m_leaseId.incrementAndGet();
		return new LeaseAcquireResponse(true, new DefaultLease(leaseId, expireTime), expireTime);
	}

	@Override
	public LeaseAcquireResponse tryAcquireBrokerLease(String topic, int partition, String sessionId) {
		// TODO
		long expireTime = System.currentTimeMillis() + 10 * 1000L;
		long leaseId = m_leaseId.incrementAndGet();
		return new LeaseAcquireResponse(true, new DefaultLease(leaseId, expireTime), expireTime);
	}

{'fraction_non_alphanumeric': 0.09683966367062917, 'fraction_numerical': 0.014496955639315743, 'mean_word_length': 5.609195402298851, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5939576', 'n_tokens_mistral': 1205, 'n_tokens_neox': 1103, 'n_words': 252}