Blockchain non small query
The relevant certificates can be issued online for the data of blockchain storage and network forensics through easysaving. Through the record number on the certificate, the blockchain query can be concted directly through the official website of easysaving and relevant arbitration commission, including the preservation subject, preservation time stamp, Guangzhou Internet court evidence number, blockchain hash value and other relevant information
Through the record number on the forensics certificate, you can also directly query the blockchain on the official websites of easy security, notary office and Arbitration Commission, including the preservation subject, preservation timestamp, Guangzhou Internet court evidence number, blockchain hash value and other relevant information, so as to ensure the openness, transparency and traceability of blockchain storage data
3) if it is "blockchain information", you can go to all kinds of blockchain media or financial media, and almost every day there are relevant blockchain instry information and news reports. Such as: Babbitt, coin you finance, blocknet, golden, daily, etc
4) if it's "blockchain audio", you can go to Himalaya FM, litchi micro class, qianchat and other platforms. For example, the audio related to "voice of money", "Yu Lingxiong", "Wang Feng" and some other financial media blockchain is also good, with various dry goods and in-depth analysis
therefore, the above four points are all related to blockchain. It depends on your choice.
(1) in the case of sudden high concurrency, when the server is under great pressure and calls some methods for more than 100ms and does not respond, we should automatically reject the service instead of blocking until the server crashes, It can be regarded as a disguised service degradation
(2) for the unpredictable code that may have deadlock, add time threshold limit to avoid unlimited resource competition
(3) for the unpredictable code that may have deadlock, add time threshold monitoring, Avoid dead cycle deterioration
some mature open source frameworks generally have the function of timeout response, such as
search framework: Lucene, Solr, elasticsearch,
RPC framework: Dubbo, thrift,
service coordination framework: zookeeper, etc.
if we want to add this function, what should we do
in fact, it's not difficult to add a timing function before and after the method call. If the threshold is exceeded, the thread should be terminated actively and the exception code should be thrown. Of course, in order not to affect the operation of the main service, this code should run independently in a sub thread, rather than coupled in the main thread. The idea is roughly the same. Of course, in order not to build a wheel repeatedly, we suggest to use Google's open source guava toolkit, which provides many useful functions, including the automatic termination of timeout method introced this time, and some functions to limit network traffic or the number of visits within a specified period of time, You can see guava's documentation for yourself<
timelimiter is an interface. There are two subclasses below,
faketimelimiter, which is often used to limit time-out debugging ring debugging.
simpletimelimiter is often used in formal methods, which call method time-out, that is, throw exception.
this paper focuses on the use of simpletimelimiter, There are mainly two methods in this class:
(1) newproxy implements timeout interception through JDK dynamic proxy and callwithtimeout
(2) callwithtimeout implements timeout interception through callable callback
the difference between the two methods lies in that the strategy implemented through proxy can be applied to every called method in this class, The implementation of timeout interception
and the implementation strategy through callback is applicable to the implementation of timeout interception only for a certain code block or method
introce the latest guava package through Maven:
java code
& lt; dependency> < br /> < groupId> com.google.guava</ groupId> < br /> < artifactId> guava</ artifactId> < br /> < version> 19.0</ version> < br /> </ dependency> <
A: Interception Based on proxy mode:
since guava uses JDK dynamic proxy to implement AOP interception, it requires that the proxy class must have an interface implementation, so it's a little troublesome to use.
we need to define an interface first, then define the implementation class, and rewrite the method to be called:
b: callback based usage, which is relatively simple, Because there is no need to use proxy mode,
both methods can implement method call timeout interruption, proxy mode is suitable for class level method timeout interruption, while callback based mode is more suitable for any single method.
bus line: No.34, the whole journey is about 3.0KM
1. Walk about 450m from the administrative center to gaoshengqiao station
2. Take No.34, pass 4 stops, and reach qingyanggong station (or take No.59)
3. Walk about 130m to qingyanggong Ximen