Author Archives: Robins

[Solved] Zabbix-server startup error: cannot start alert manager service: Cannot bind socket to “/var/run/zabbix/zabbix_server_alerter.sock”: [13] Permission denied.

The following error is reported when starting zabbix-server:

29171:20180714:084911.367 cannot start alert manager service: Cannot bind socket to "/var/run/zabbix/zabbix_server_alerter.sock": [13] Permission denied.
29142:20180714:084911.368 One child process died (PID:29171,exitcode/signal:1). Exiting ...
29225:20180714:084923.611 cannot start preprocessing service: Cannot bind socket to "/var/run/zabbix/zabbix_server_preprocessing.sock": [13] Permission denied.
 29213:20180714:084923.613 server #18 started [poller #2]
 29195:20180714:084923.614 One child process died (PID:29225,exitcode/signal:1). Exiting ...
 29195:20180714:084925.615 syncing history data...
 29195:20180714:084925.615 syncing history data done
 29195:20180714:084925.615 syncing trend data...
 29195:20180714:084925.615 syncing trend data done
 29195:20180714:084925.615 Zabbix Server stopped. Zabbix 3.4.10 (revision 81503).

  The above is only pasted part of the error log.
The above reason is because SELINUX starts
sestatus

SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          disabled
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

The solution is as follows:
vim /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected. 
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 

  Modify the SELINUX=disabledconfiguration file and close it permanently.
setenforce 0: Temporarily close SELINUX.

New Spring boot startup error Failed to auto-configure a DataSource

Learn springboot today and use idea to create projects. Mysq was added when selecting the component, and an error was reported when it was started for the first time. The error message is as follows:

***************************
APPLICATION FAILED TO START
***************************
Description:
Failed to auto-configure a DataSource: ‘spring.datasource.url’ is not specified and no embedded datasource could be auto-configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.

If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).

After multi-party verification, you need to add exclude in the @EnableAutoConfiguration or @SpringBootApplication of the startup class

= {DataSourceAutoConfiguration.class}, exclude this type of autoconfig. After starting, it can run normally.

This is because the database component is added, so autoconfig will read the data source configuration, and my newly created project has not yet configured the data source, so an exception will occur.

Solution to the problem 2: No need to change the adding statement, pay attention to the correctness of the project file structure

Good text to top follow me

Win10 installs ubuntu system, error WslRegisterDistribution failed with error: 0x8007019e

Install the ubuntu system in the windows application store, and report the error WslRegisterDistribution failed with error: 0x8007019e

1. Report an error:

Installing, this may take a few minutes...
Installation Failed!
Error : 0x8007019e
Press any key to  continue ...

2. Reason: Windows subsystem support is not installed.

3. Solution:

1.win+x, select Windows PowerShell (Administrator)

  2. Input: Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

  3. Press Enter, enter Y, and restart!

  4. Reopen the installed subsystem, wait a few minutes, and enter the account and password.

[Solved] Shell error: syntax error: unexpected end of file

Sometimes an error will be reported when executing the script:

[root@host1 shell]# sh -x test. sh  
+ $ ' \r '
: command not found
test. sh : line 37 : syntax error: unexpected end of file

reasons may be:

The text editor is the file written by Notepad or other editors under windows, and it runs in the cygwin simulation LINUX software environment.

Solutions:

The file format difference between DOS and Linux is caused.

The text file under DOS uses \r\n as the line break mark, expressed in hexadecimal is 0D 0A. The text file under Unix uses \n as a line break mark, which is 0A in hexadecimal.

[In windows, the two symbols used for line feed, carriage return \r, line feed symbol \n, under linux, only one symbol \n is enough .]

A text file in DOS format under Linux will display ^M at the end of the line when opened with a lower version of vi. Of course, you may not be able to see it, but in vi, the format of the file will be displayed below, “M.txt “[dos] 8L, 72C means a dos file format.

solution:

Use the following command to set the file format to unix format to solve the above error

vi test. sh 
:set fileformat = unix
:wq

Why can’t the script edited under windows be directly copied to the unix system and run directly?

Linux executes SHELL script error “syntax error near unexpected token `in”

long long ago….. Old teletypewriters used two characters to start a new line. One character moves the carriage back to the first position (called carriage return, <CR>, ASCII code 0D), and another character moves the paper up one line (called line feed, <LF>, ASCII code 0A). When computers came out, memory used to be very expensive. Some people think it is unnecessary to use two characters to indicate the end of a line. Unix developers decided that they could use a character to indicate the end of a line, Linux followed Unix, and it was also <LF>. Apple developers specified the use of <CR>. The guys who developed MS-DOS and Windows decided to use the old <CR><LF>.

Because MS-DOS and Windows use carriage return + line feed to represent line feed, so under Linux, use Vim to view the code written in VC under Windows. The “^M” symbol at the end of the line indicates a symbol.

Common problems and solutions for CheckStyle errors

Common problems and solutions for CheckStyle errors

1 Warning: Type is missing a javadoc commentClass

Description: Missing type description

Solution: add javadoc description

2 Warning: “{” should be on the previous line

Explanation: “{” should be on the previous line.

Solution: put “{” on the previous line

3 Warning: Methos is missing a javadoc comment

Explanation: The javadoc comment is missing in front of the method.

Solution: add javadoc comments

4 Warning: Expected @throws tag for “Exception”

Description: I hope @throws in the comments

Solution: Add this line in the comment before the method: * @throws Exception if has error (exception description)

5 Warning: “.” Is preceeded with whitespace

Note: There can be no spaces before “.”.

Solution: remove the space in front of “.”

6 Warning: “.” Is followed by whitespace

Note: There can be no spaces after “.”.

Solution: remove the space after “.”

7 Warning: “=” is not preceeded with whitespace

Explanation: Missing spaces before “=”.

Solution: add a space in front of “=”

8 Warning: “=” is not followed with whitespace

Explanation: Missing spaces after “=”.

Solution: add a space after “=”

9 Warning: “}” should be on the same line

Explanation: “}” should be on the same line as the next statement.

Solution: put “}” in front of the next line

10 Warning: Unused @param tag for “unused”

Note: There is no parameter “unused”, no comment is required

Solution: “* @param unusedparameter additional(parameter name)” Remove the comment of this line of unused parameter “

11 Warning: Variable “CA” missingjavadoc

Explanation: The variable “CA” lacks javadoc comments

Solution: Add a javadoc comment before the “CA” variable: /** CA. */ (Note: Be sure to add the “.” after CA)

12 Warning: Line longer than 80characters

Explanation: The line length exceeds 80.

Solution: divide it into multiple lines to write. When necessary, you can ctrl+shift+f

13 Warning: Line contains a tab character

Note: The line contains the “tab” character.

14 Warning: Redundant “Public” modifier

Description: Redundant “public” modifier.

Solution: redundant “public”

15 Warning: Final modifier out of order with the JSL suggestion

Explanation: The order of the Final modifier is wrong

16 Warning: Avoid using the “.*” formof import

Note: Avoid using “.*” in Import format

17 Warning: Redundant import from the same package

Description: Import content from the same package

18 Warning: Unusedimport-java.util.list

Explanation: The java.util.list imported by Import is not used.

Solution: remove the imported redundant classes

19 Warning: Duplicate import to line 13

Description: Repeat Import the same content

Solution: remove the imported redundant classes

20 Tips: Import from illegalpackage

Description: Import content from illegal package

21 Warning: “while” construct must use “{}”

Explanation: The “while” statement is missing “{}”

22 Warning: Variable “sTest1” must beprivate and have accessor method

Description: The variable “sTest1” should be private, and there is a way to call it

23 Warning: Variable “ABC” must matchpattern “^[az][a-zA-Z0-9]*$”

Explanation: The variable “ABC” does not conform to the naming rule “^[az][a-zA-Z0-9]*$”

Solution: Change this name to the name “aBC” that complies with the rules

24 Warning: “(” is followed by whitespace “)” is proceeded by whitespace

Note: “(” cannot be followed by spaces and “)” cannot be preceded by spaces

Solution: remove the spaces before or after

25 Warning: First sentence should end with a period.

Solution: You should add a “.” at the end of the first line of your comment.

26 Tips: Redundant throws:’NameNotFoundException’ is subclass of’NamingException’.

Description:’NameNotFoundException’ is a subclass of’NamingException’ that repeatedly throws exceptions.

Solution: If two exceptions are thrown, one exception class is a subclass of the other, then only the parent class needs to be written

Remove the NameNotFoundException exception, the corresponding javadoc comment exception comment also needs to be removed

27 Warning: Parameter docType should be final.

Description: The parameter docType should be final

Solution: add a final in front of the parameter docType

28 Warning: Line has trailing spaces.

Description: Extra blank lines

Solution: remove this blank line

29 Warning: Must have at least onestatement.

Description: At least one statement

Solution: The exception catch in try{}catch(){} cannot be empty, add a sentence to the exception. Such as printing

30 Warning:’>’ is not followed by whitespace. And there is'(‘is preceded with whitespace.

Note: When defining collections and enumerations, there must be spaces after the last “>”, and spaces before “(” are not allowed.

Solution: remove the generic type (usually generic types are prone to this problem)

31 Warning: Got an exception-java.lang.RuntimeException: Unable to get classinformation for @throws tag’SystemException’.

Explanation: Unreasonable throws.

Solution: Make sure that certain types, such as certain classes and interfaces, are not thrown. Remove the declared exception. Throw an exception in the implementation class

Online reference solutions: 1. This is an error reported by CheckStyle. Usually need to Refreh, clean/build this Project. If not, you can try clean all projects, restart Eclipse.

2. Because the compiled class is not in the classpath of checkstyle. So, as long as the compiled class is configured in the classpath of <checkstyle/>, there is no such problem. In addition, I also found that the line length of checkstyle seems to be a bit problematic. , Obviously there is no more than 120 characters, but it still reports an error. I have no choice but to change the Maximumline with in java> code style> formatter in Eclipse to 100, and then format it, there is basically no problem

32 Warning: File does not end with anewline.

Solution: delete the error-reporting class, create a new class with the same name, and copy all the code over

33 Warning: Utility classes should not have a public or default constructor.

Note: There should not be public or default construction methods in the inner class in the interface

Solution: In the inner class, define a private construction method, and then declare the inner class as a final type. If there is static before, then final must also be placed after static

34 Warning: Variable’functionCode’ must be private and have accessor methods

Description: The variable should be changed to private and then provide access method

Solution: Change the modifiers of these variables to private, then provide set and get methods, and add corresponding method javadoc comments and parameter comments. And add final before the return value and parameter type. And change the place where this variable is called to access by method

35 Warning:’X’ hides a field.

Note: The global private int X; and the local publicFoo (int X) X variable names are the same.
Solution: Change the parameter name in the method to public Foo(int newBar)

36 Warning: Got an exception -Unexpected character 0xfffd in identifier

Note: This is because CheckStyle does not recognize the established encoding format.

Online reference solution:

1. It can be configured in Eclipse, and can be specified in Other–>checker

2. You can modify the checkstyle configuration file:

<modulename=”Checker”>

<propertyname=”severity” value=”warning”/>

<property name=”charset”value=”UTF-8″/>

<modulename=”TreeWalker”>

If it is UTF-8, just add the sentence in bold and italic, and that’s it.

37 Warning: Got an exception -java.lang.RuntimeException: Unable to get class information for @throws tag*whatever*.

Solution: CheckSytle JavaDoc –> Method JavaDoc –> logLoadErrors. if it is CheckStyle own loading errors, a Log on it, do not the whole Errors scare people. (This problem has not been encountered, so did not try)
Coding Problems –> Redundant Throws –> logLoadErrors check the same error.

38 Warning: Expected @param tag for ‘dataManager’.
Explanation: Missing comment for dataManager parameter

Solution: Add @param dataManager DataManager to the comment

Duplicate entry ‘1’ for key’PRIMARY’ (How to Solve)

When using MySQL+ibatis for insert test, an error is reported: The information is as follows:

Test insert
com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in com/study/ibatis/Student.xml.  
--- The error occurred while applying a parameter map.  
--- Check the addStudent-InlineParameterMap.  
--- Check the statement (update failed).  
--- Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1' for key 'PRIMARY'
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:107)
    at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.insert(SqlMapExecutorDelegate.java:393)
    at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.insert(SqlMapSessionImpl.java:82)
    at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.insert(SqlMapClientImpl.java:58)
    at com.study.ibatis.StudentDaoImpl.addStudent(StudentDaoImpl.java:33)
    but com.study.ibatis.TestIbatis.main (TestIbatis.java: 14 )
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '1' for key 'PRIMARY'
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
    at com.mysql.jdbc.Util.getInstance(Util.java:381)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1015)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)
    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1734)
    at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:995)
    at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeUpdate(SqlExecutor.java:80)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.sqlExecuteUpdate(MappedStatement.java:216)
    at com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeUpdate(MappedStatement.java:94)
    ... 5 more
false

The meaning of the error is: Repeatedly input the “1” key as “primary” to enter the database, and when querying the table tbl_student, three records were found, one of which was a primary key. Considering that when I was testing, the default primary key in the database was 1. So delete the record whose primary key is 1 in the database. Then the test passed.

Summary: I set the primary key in ibatis to the default 1. As a result, the test starts directly from the default 1. Then an error is reported, and the default value of the primary key is set to null to solve the problem.

[Solved] Vue’s error: Uncaught TypeError: Cannot assign to read only property’exports’ of object’#

 I just ran a previous demo of Vue+webpack. After running, there was no expected effect and an error was reported.

Uncaught TypeError: Cannot assign to read only property’exports’ of object’#<Object>’

 

Click on the wrong file and mark the wrong place as this piece of code:

import {normalTime} from'./timeFormat'; 

module.exports = {
  normalTime
};

Is module.exports;

The reason is: The code above is ok. You can mix  and . You can’t mix  and . require export import module.exports

there is nothing wrong with the code. When webpack is packaged, you can mix require and export in the js file. But import and module.exports cannot be mixed.

Because import and module.exports are not allowed to be mixed in webpack 2,

The solution is to change it to ES6.

import {normalTime} from'./timeFormat' ;

export default normalTime;

Finally it runs successfully.

How to Solve Pydicom Read Dicom File Error: OSError

Before using pydicom to read dicom files, everything is normal, but when reading a batch of data recently, an error will be reported

Read code

file = pydicom.read_file(filepath)
data = file.pixel_array

The problem lies in the attribute of pixel_array, the error is reported as follows

OSError                                   Traceback (most recent call last)
c:\python35\lib\site-packages\pydicom\pixel_data_handlers\pillow_handler.py in get_pixeldata(dicom_dataset)
    196                 fio = io.BytesIO(pixel_data)
--> 197                 decompressed_image = Image.open(fio)
    198             except IOError as e:

c:\python35\lib\site-packages\PIL\Image.py in open(fp, mode)
   2571     raise IOError("cannot identify image file %r"
-> 2572                   % (filename if filename else fp))
   2573 

OSError: cannot identify image file <_io.BytesIO object at 0x000002418FC85CA8>

During handling of the above exception, another exception occurred:

NotImplementedError                       Traceback (most recent call last)
<ipython-input-55-c00f3f09682d> in <module>()
----> 1 file.pixel_array

c:\python35\lib\site-packages\pydicom\dataset.py in pixel_array(self)
    899             The Pixel Data (7FE0,0010) as a NumPy ndarray.
    900         """
--> 901         self.convert_pixel_data()
    902         return self._pixel_array
    903 

c:\python35\lib\site-packages\pydicom\dataset.py in convert_pixel_data(self)
    845         )
    846 
--> 847         raise last_exception
    848 
    849     def decompress(self):

c:\python35\lib\site-packages\pydicom\dataset.py in convert_pixel_data(self)
    813             try:
    814                 # Use the handler to get a 1D numpy array of the pixel data
--> 815                 arr = handler.get_pixeldata(self)
    816                 self._pixel_array = reshape_pixel_array(self, arr)
    817 

c:\python35\lib\site-packages\pydicom\pixel_data_handlers\pillow_handler.py in get_pixeldata(dicom_dataset)
    197                 decompressed_image = Image.open(fio)
    198             except IOError as e:
--> 199                 raise NotImplementedError(e.strerror)
    200             UncompressedPixelData.extend(decompressed_image.tobytes())
    201     except Exception:

NotImplementedError: None

 

Solution:

this compression format can not be read with pydicom, using SimpleITK can solve

file = sitk.ReadImage (filepath) 
data = sitk.GetArrayFromImage (file)

Start error in maven web project java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener

Environment: Groovy/Grails Tool Suite 3.1.0.RELEASE ( BASED ON ECLIPSE JUNO 3.8.1 ), JDK1.6, Maven3.05, Tomcat6

wrong description:

SEVERE: Error configuring application listener of class org.springframework.web.util.Log4jConfigListener
java.lang.ClassNotFoundException: org.springframework.web.util.Log4jConfigListener

Problem resolution:

All dependencies (jdk/jar/classes) in the Maven project are managed by it. So if it is determined that the package or file (org.springframework.web.util.Log4jConfigListener) does exist in the project, it must be due to the fact that the project does not add a maven dependency.

solution:

ctrl+Enter error project->Deployment Assembly->Add->Java buid path entries->Next->Maven Dependencies

Clear!

At this time, there are more sub-nodes spring-web-3.2.3.RELEASE.jar under the related project module in the Servers module (the package where the Log4jConfigListener class configured in web.xml is located)

[Solved] RSA encryption request error: javax.crypto.badpaddingexception: decryption error

📖 Abstract


Share today — RSA encryption request error: javax. Crypto. Badpaddingexception: decryption error , welcome to pay attention!

Read related articles: spring boot + security based on the separation of the front and back RSA password encryption login process


🌂 resolvent

In the login method, the space can be replaced by a + sign, just ask if you want to be coquettish

String inputDecryptData = "";
        try {
            Object privateKey = redisUtil.get(Constant.RSA_PRIVATE_KEY);

            inputDecryptData =  RSAUtils.decrypt(password.replaceAll(" ","+"), RSAUtils.getPrivateKey(privateKey.toString()));
        } catch (Exception e) {
            log.error("RSA encryption and decryption exceptions occurred ======>", e);
            throw new BizException("RSA encryption and decryption exception occurred");
        }

Finally, thank you for watching patiently, leaving a like collection is your greatest encouragement to me!

Solve git upload file error [rejected] master -> master (fetch first) error: failed to push some refs to ‘

When push is executed, an error will be reported. The error code is as follows:

$ git push -u origin master
To gitee.com:backspacegit/aafdajs.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'gitee.com:backspacegit/aafdajs.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

This problem occurs because the readme.md file in GitHub is not in the local code directory. You can merge the code with the following command

git pull --rebase origin master

Then execute the statement

git push -u origin master

Done!

To customize the aggregate function of Flink (Step-by-Step Tutorial)

In Flink computing, some common operations are map or flatmap. After some data, keyby opens a window to calculate. So what are the operators in these calculations?

There are two types of operators.

Incremental aggregation includes reduce and aggregate operators, and total aggregation includes apply and process operators. So today we will mainly explain the commonly used incremental aggregation operator, aggregate operator
three types of aggregate method signature & lt; Data source type, accumulator type, output type & gt
the four types of window function method signature are < IN, OUT, KEY, W extends Window>

Step 1: convert datastream to windowedstream


        // Reading data from kafka
        val inputStream = env.addSource(new FlinkKafkaConsumer[String]("hotitems", new SimpleStringSchema(), properties))
            .map(data => {
                val dataArray = data.split(",")
                UserBehavior(dataArray(0).toLong, dataArray(1).toLong, dataArray(2).toInt, dataArray(3), dataArray(4).toLong)
            })
            .assignAscendingTimestamps(_.timestamp * 1000L)
        
        // Performing window aggregation on data
        val aggStream: DataStream[ItemViewCount] = inputStream
            .filter(_.behavior == "pv") // filter out the pv data
            .keyBy(_.itemId)
            .timeWindow(Time.hours(1), Time.minutes(5)) // open window for statistics
            .aggregate(new CountAgg(), new WindowCountResult()) // Aggregate the count of the current item in the time window

Step 2: user defined aggregate function

// A custom pre-aggregation function that adds one to the data
class CountAgg() extends AggregateFunction[UserBehavior, Long, Long] {
    // The add method is an accumulator method, here is the simplest +1 operation
    override def add(value: UserBehavior, accumulator: Long): Long = accumulator + 1
    //initialize the accumulator value
    override def createAccumulator(): Long = 0L
    // finally return the value, here is the accumulator
    override def getResult(accumulator: Long): Long = accumulator
    // partition processing of the summation operation, here all the results of the summation process are added together
    override def merge(a: Long, b: Long): Long = a + b
}

Part 3: custom window function

// Custom window function
class WindowCountResult() extends WindowFunction[Long, ItemViewCount, Long, TimeWindow] {
    //Long type Key is the return value of the custom accumulator in the previous step
    //Window is the difference to your button type, no window type in the first step, TimeWindow
    //input is the type of data received, in this case the Long type iterator
    //out is the type returned by this method, here is the set of ItemViewCount sample class objects
    override def apply(key: Long, window: TimeWindow, input: Iterable[Long], out: Collector[ItemViewCount]): Unit = {
        // Call the constructor of the ItemViewCount sample class object to construct the ItemViewCount sample class in turn and return
        out.collect(ItemViewCount(key, window.getEnd, input.iterator.next()))
    }
}